forked from ChrisChrome/weather-bot
- Automatically get room list from server
- Remove iem.json (see above) - Add blacklist.json (see above) - Move JSON data files to dedicated folder. Cleaning up root
This commit is contained in:
parent
710e4258f3
commit
5cadf7a8d0
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -130,4 +130,6 @@ dist
|
|||
.pnp.*
|
||||
config.json
|
||||
channels.db
|
||||
private/
|
||||
private/
|
||||
error/
|
||||
old/
|
49
data/blacklist.json
Normal file
49
data/blacklist.json
Normal file
|
@ -0,0 +1,49 @@
|
|||
[
|
||||
"mkx_madison_spotters@conference.weather.im",
|
||||
"michiganwxalerts@conference.weather.im",
|
||||
"skywarnstatewidechase@conference.weather.im",
|
||||
"wws44fl@conference.weather.im",
|
||||
"crisfield-chat@conference.weather.im",
|
||||
"gstweather@conference.weather.im",
|
||||
"franklin_chat@conference.weather.im",
|
||||
"mke-skywarn@conference.weather.im",
|
||||
"tnwxdiscuss@conference.weather.im",
|
||||
"khws@conference.weather.im",
|
||||
"kodster@conference.weather.im",
|
||||
"wxst@conference.weather.im",
|
||||
"reddit_weatherlab@conference.weather.im",
|
||||
"nalsw@conference.weather.im",
|
||||
"barnburnerwi@conference.weather.im",
|
||||
"ohiostormspottersteamoss@conference.weather.im",
|
||||
"n90@conference.weather.im",
|
||||
"nerfcchat@conference.weather.im",
|
||||
"pitchat@conference.weather.im",
|
||||
"chachat@conference.weather.im",
|
||||
"spcmobile2006@conference.weather.im",
|
||||
"phl@conference.weather.im",
|
||||
"wbkoweatherwatchers@conference.weather.im",
|
||||
"easwtalk@conference.weather.im",
|
||||
"gccc-nc-skywarn@conference.weather.im",
|
||||
"cyschat@conference.weather.im",
|
||||
"mseas-weather-discussion@conference.weather.im",
|
||||
"abc3340@conference.weather.im",
|
||||
"okc_chatrooms@conference.weather.im",
|
||||
"wisconsin_storm_spotters@conference.weather.im",
|
||||
"uswat@conference.weather.im",
|
||||
"whntweather@conference.weather.im",
|
||||
"knsw@conference.weather.im",
|
||||
"test@conference.weather.im",
|
||||
"abc3340skywatcher@conference.weather.im",
|
||||
"byzchat@conference.weather.im",
|
||||
"bmxspotterchat@conference.weather.im",
|
||||
"wwsreport@conference.weather.im",
|
||||
"bmxalertchat@conference.weather.im",
|
||||
"twitter@conference.weather.im",
|
||||
"potomac_tracon@conference.weather.im",
|
||||
"detroiteaschat@conference.weather.im",
|
||||
"cwest@conference.weather.im",
|
||||
"wpcchat@conference.weather.im",
|
||||
"sweaseops1@conference.weather.im",
|
||||
"scwx@conference.weather.im",
|
||||
"nwsc@conference.weather.im"
|
||||
]
|
696
iem.json
696
iem.json
|
@ -1,696 +0,0 @@
|
|||
{
|
||||
"channels": [
|
||||
{
|
||||
"jid": "ilnchat@conference.weather.im",
|
||||
"name": "ilnchat"
|
||||
},
|
||||
{
|
||||
"jid": "zhuchat@conference.weather.im",
|
||||
"name": "zhuchat"
|
||||
},
|
||||
{
|
||||
"jid": "rerchat@conference.weather.im",
|
||||
"name": "Record Event Reports (RER)"
|
||||
},
|
||||
{
|
||||
"jid": "ncrfcchat@conference.weather.im",
|
||||
"name": "ncrfcchat"
|
||||
},
|
||||
{
|
||||
"jid": "zmechat@conference.weather.im",
|
||||
"name": "zmechat"
|
||||
},
|
||||
{
|
||||
"jid": "ggwchat@conference.weather.im",
|
||||
"name": "ggwchat"
|
||||
},
|
||||
{
|
||||
"jid": "sewchat@conference.weather.im",
|
||||
"name": "sewchat"
|
||||
},
|
||||
{
|
||||
"jid": "ohxchat@conference.weather.im",
|
||||
"name": "ohxchat"
|
||||
},
|
||||
{
|
||||
"jid": "megchat@conference.weather.im",
|
||||
"name": "megchat"
|
||||
},
|
||||
{
|
||||
"jid": "mobchat@conference.weather.im",
|
||||
"name": "mobchat"
|
||||
},
|
||||
{
|
||||
"jid": "brochat@conference.weather.im",
|
||||
"name": "brochat"
|
||||
},
|
||||
{
|
||||
"jid": "ddcchat@conference.weather.im",
|
||||
"name": "ddcchat"
|
||||
},
|
||||
{
|
||||
"jid": "zanchat@conference.weather.im",
|
||||
"name": "zanchat"
|
||||
},
|
||||
{
|
||||
"jid": "mflchat@conference.weather.im",
|
||||
"name": "mflchat"
|
||||
},
|
||||
{
|
||||
"jid": "dvnchat@conference.weather.im",
|
||||
"name": "dvnchat"
|
||||
},
|
||||
{
|
||||
"jid": "gjtchat@conference.weather.im",
|
||||
"name": "gjtchat"
|
||||
},
|
||||
{
|
||||
"jid": "ztlchat@conference.weather.im",
|
||||
"name": "ztlchat"
|
||||
},
|
||||
{
|
||||
"jid": "lmkchat@conference.weather.im",
|
||||
"name": "lmkchat"
|
||||
},
|
||||
{
|
||||
"jid": "hatchat@conference.weather.im",
|
||||
"name": "hatchat"
|
||||
},
|
||||
{
|
||||
"jid": "fwdchat@conference.weather.im",
|
||||
"name": "fwdchat"
|
||||
},
|
||||
{
|
||||
"jid": "boichat@conference.weather.im",
|
||||
"name": "boichat"
|
||||
},
|
||||
{
|
||||
"jid": "slcchat@conference.weather.im",
|
||||
"name": "slcchat"
|
||||
},
|
||||
{
|
||||
"jid": "zobchat@conference.weather.im",
|
||||
"name": "zobchat"
|
||||
},
|
||||
{
|
||||
"jid": "amachat@conference.weather.im",
|
||||
"name": "amachat"
|
||||
},
|
||||
{
|
||||
"jid": "pqrchat@conference.weather.im",
|
||||
"name": "pqrchat"
|
||||
},
|
||||
{
|
||||
"jid": "tws_chat@conference.weather.im",
|
||||
"name": "tws_chat"
|
||||
},
|
||||
{
|
||||
"jid": "zidchat@conference.weather.im",
|
||||
"name": "zidchat"
|
||||
},
|
||||
{
|
||||
"jid": "cnrfcchat@conference.weather.im",
|
||||
"name": "cnrfcchat"
|
||||
},
|
||||
{
|
||||
"jid": "nhcchat@conference.weather.im",
|
||||
"name": "nhcchat"
|
||||
},
|
||||
{
|
||||
"jid": "stochat@conference.weather.im",
|
||||
"name": "stochat"
|
||||
},
|
||||
{
|
||||
"jid": "jklchat@conference.weather.im",
|
||||
"name": "jklchat"
|
||||
},
|
||||
{
|
||||
"jid": "grrchat@conference.weather.im",
|
||||
"name": "grrchat"
|
||||
},
|
||||
{
|
||||
"jid": "hnxchat@conference.weather.im",
|
||||
"name": "hnxchat"
|
||||
},
|
||||
{
|
||||
"jid": "spcchat@conference.weather.im",
|
||||
"name": "Storm Prediction Center Chatroom"
|
||||
},
|
||||
{
|
||||
"jid": "lchchat@conference.weather.im",
|
||||
"name": "lchchat"
|
||||
},
|
||||
{
|
||||
"jid": "kcichat@conference.weather.im",
|
||||
"name": "kcichat"
|
||||
},
|
||||
{
|
||||
"jid": "zbwchat@conference.weather.im",
|
||||
"name": "zbwchat"
|
||||
},
|
||||
{
|
||||
"jid": "otxchat@conference.weather.im",
|
||||
"name": "otxchat"
|
||||
},
|
||||
{
|
||||
"jid": "vefchat@conference.weather.im",
|
||||
"name": "vefchat"
|
||||
},
|
||||
{
|
||||
"jid": "pubchat@conference.weather.im",
|
||||
"name": "pubchat"
|
||||
},
|
||||
{
|
||||
"jid": "psrchat@conference.weather.im",
|
||||
"name": "psrchat"
|
||||
},
|
||||
{
|
||||
"jid": "sgxchat@conference.weather.im",
|
||||
"name": "sgxchat"
|
||||
},
|
||||
{
|
||||
"jid": "pbzchat@conference.weather.im",
|
||||
"name": "pbzchat"
|
||||
},
|
||||
{
|
||||
"jid": "ekachat@conference.weather.im",
|
||||
"name": "ekachat"
|
||||
},
|
||||
{
|
||||
"jid": "ilxchat@conference.weather.im",
|
||||
"name": "ilxchat"
|
||||
},
|
||||
{
|
||||
"jid": "jsjchat@conference.weather.im",
|
||||
"name": "jsjchat"
|
||||
},
|
||||
{
|
||||
"jid": "mlbchat@conference.weather.im",
|
||||
"name": "mlbchat"
|
||||
},
|
||||
{
|
||||
"jid": "arxchat@conference.weather.im",
|
||||
"name": "arxchat"
|
||||
},
|
||||
{
|
||||
"jid": "ilmchat@conference.weather.im",
|
||||
"name": "ilmchat"
|
||||
},
|
||||
{
|
||||
"jid": "okxchat@conference.weather.im",
|
||||
"name": "okxchat"
|
||||
},
|
||||
{
|
||||
"jid": "botstalk@conference.weather.im",
|
||||
"name": "botstalk"
|
||||
},
|
||||
{
|
||||
"jid": "lknchat@conference.weather.im",
|
||||
"name": "lknchat"
|
||||
},
|
||||
{
|
||||
"jid": "siawx_chat@conference.weather.im",
|
||||
"name": "siawx_chat"
|
||||
},
|
||||
{
|
||||
"jid": "rahchat@conference.weather.im",
|
||||
"name": "rahchat"
|
||||
},
|
||||
{
|
||||
"jid": "afcchat@conference.weather.im",
|
||||
"name": "afcchat"
|
||||
},
|
||||
{
|
||||
"jid": "lotchat@conference.weather.im",
|
||||
"name": "lotchat"
|
||||
},
|
||||
{
|
||||
"jid": "boxchat@conference.weather.im",
|
||||
"name": "boxchat"
|
||||
},
|
||||
{
|
||||
"jid": "znychat@conference.weather.im",
|
||||
"name": "znychat"
|
||||
},
|
||||
{
|
||||
"jid": "akqchat@conference.weather.im",
|
||||
"name": "akqchat"
|
||||
},
|
||||
{
|
||||
"jid": "zkcchat@conference.weather.im",
|
||||
"name": "zkcchat"
|
||||
},
|
||||
{
|
||||
"jid": "bischat@conference.weather.im",
|
||||
"name": "bischat"
|
||||
},
|
||||
{
|
||||
"jid": "twcchat@conference.weather.im",
|
||||
"name": "twcchat"
|
||||
},
|
||||
{
|
||||
"jid": "lmrfcchat@conference.weather.im",
|
||||
"name": "lmrfcchat"
|
||||
},
|
||||
{
|
||||
"jid": "abrchat@conference.weather.im",
|
||||
"name": "abrchat"
|
||||
},
|
||||
{
|
||||
"jid": "mbrfcchat@conference.weather.im",
|
||||
"name": "mbrfcchat"
|
||||
},
|
||||
{
|
||||
"jid": "pihchat@conference.weather.im",
|
||||
"name": "pihchat"
|
||||
},
|
||||
{
|
||||
"jid": "zoachat@conference.weather.im",
|
||||
"name": "zoachat"
|
||||
},
|
||||
{
|
||||
"jid": "mtrchat@conference.weather.im",
|
||||
"name": "mtrchat"
|
||||
},
|
||||
{
|
||||
"jid": "sjuchat@conference.weather.im",
|
||||
"name": "sjuchat"
|
||||
},
|
||||
{
|
||||
"jid": "gidchat@conference.weather.im",
|
||||
"name": "gidchat"
|
||||
},
|
||||
{
|
||||
"jid": "zmpchat@conference.weather.im",
|
||||
"name": "zmpchat"
|
||||
},
|
||||
{
|
||||
"jid": "phichat@conference.weather.im",
|
||||
"name": "phichat"
|
||||
},
|
||||
{
|
||||
"jid": "chschat@conference.weather.im",
|
||||
"name": "chschat"
|
||||
},
|
||||
{
|
||||
"jid": "ajkchat@conference.weather.im",
|
||||
"name": "ajkchat"
|
||||
},
|
||||
{
|
||||
"jid": "bmxchat@conference.weather.im",
|
||||
"name": "bmxchat"
|
||||
},
|
||||
{
|
||||
"jid": "lixchat@conference.weather.im",
|
||||
"name": "lixchat"
|
||||
},
|
||||
{
|
||||
"jid": "apxchat@conference.weather.im",
|
||||
"name": "apxchat"
|
||||
},
|
||||
{
|
||||
"jid": "hunchat@conference.weather.im",
|
||||
"name": "hunchat"
|
||||
},
|
||||
{
|
||||
"jid": "zmachat@conference.weather.im",
|
||||
"name": "zmachat"
|
||||
},
|
||||
{
|
||||
"jid": "dtxchat@conference.weather.im",
|
||||
"name": "dtxchat"
|
||||
},
|
||||
{
|
||||
"jid": "gumchat@conference.weather.im",
|
||||
"name": "gumchat"
|
||||
},
|
||||
{
|
||||
"jid": "gcwxchat@conference.weather.im",
|
||||
"name": "gcwxchat"
|
||||
},
|
||||
{
|
||||
"jid": "zzmkxchat@conference.weather.im",
|
||||
"name": "zzmkxchat"
|
||||
},
|
||||
{
|
||||
"jid": "dentcoeas@conference.weather.im",
|
||||
"name": "dentcoeas"
|
||||
},
|
||||
{
|
||||
"jid": "marfcchat@conference.weather.im",
|
||||
"name": "marfcchat"
|
||||
},
|
||||
{
|
||||
"jid": "crpchat@conference.weather.im",
|
||||
"name": "crpchat"
|
||||
},
|
||||
{
|
||||
"jid": "zjxchat@conference.weather.im",
|
||||
"name": "zjxchat"
|
||||
},
|
||||
{
|
||||
"jid": "shvchat@conference.weather.im",
|
||||
"name": "shvchat"
|
||||
},
|
||||
{
|
||||
"jid": "tbwchat@conference.weather.im",
|
||||
"name": "tbwchat"
|
||||
},
|
||||
{
|
||||
"jid": "hfochat@conference.weather.im",
|
||||
"name": "hfochat"
|
||||
},
|
||||
{
|
||||
"jid": "dmxchat@conference.weather.im",
|
||||
"name": "dmxchat"
|
||||
},
|
||||
{
|
||||
"jid": "zsechat@conference.weather.im",
|
||||
"name": "zsechat"
|
||||
},
|
||||
{
|
||||
"jid": "revchat@conference.weather.im",
|
||||
"name": "revchat"
|
||||
},
|
||||
{
|
||||
"jid": "carchat@conference.weather.im",
|
||||
"name": "carchat"
|
||||
},
|
||||
{
|
||||
"jid": "msochat@conference.weather.im",
|
||||
"name": "msochat"
|
||||
},
|
||||
{
|
||||
"jid": "keychat@conference.weather.im",
|
||||
"name": "keychat"
|
||||
},
|
||||
{
|
||||
"jid": "riwchat@conference.weather.im",
|
||||
"name": "riwchat"
|
||||
},
|
||||
{
|
||||
"jid": "awpwxchat@conference.weather.im",
|
||||
"name": "awpwxchat"
|
||||
},
|
||||
{
|
||||
"jid": "mhxchat@conference.weather.im",
|
||||
"name": "mhxchat"
|
||||
},
|
||||
{
|
||||
"jid": "caechat@conference.weather.im",
|
||||
"name": "caechat"
|
||||
},
|
||||
{
|
||||
"jid": "indchat@conference.weather.im",
|
||||
"name": "indchat"
|
||||
},
|
||||
{
|
||||
"jid": "dlhchat@conference.weather.im",
|
||||
"name": "dlhchat"
|
||||
},
|
||||
{
|
||||
"jid": "unrchat@conference.weather.im",
|
||||
"name": "unrchat"
|
||||
},
|
||||
{
|
||||
"jid": "wilchat@conference.weather.im",
|
||||
"name": "wilchat"
|
||||
},
|
||||
{
|
||||
"jid": "kdtxchat@conference.weather.im",
|
||||
"name": "kdtxchat"
|
||||
},
|
||||
{
|
||||
"jid": "zabchat@conference.weather.im",
|
||||
"name": "zabchat"
|
||||
},
|
||||
{
|
||||
"jid": "wnpchat@conference.weather.im",
|
||||
"name": "wnpchat"
|
||||
},
|
||||
{
|
||||
"jid": "zlcchat@conference.weather.im",
|
||||
"name": "zlcchat"
|
||||
},
|
||||
{
|
||||
"jid": "ffcchat@conference.weather.im",
|
||||
"name": "ffcchat"
|
||||
},
|
||||
{
|
||||
"jid": "epzchat@conference.weather.im",
|
||||
"name": "epzchat"
|
||||
},
|
||||
{
|
||||
"jid": "taechat@conference.weather.im",
|
||||
"name": "taechat"
|
||||
},
|
||||
{
|
||||
"jid": "fox6chat@conference.weather.im",
|
||||
"name": "fox6chat"
|
||||
},
|
||||
{
|
||||
"jid": "cbrfcchat@conference.weather.im",
|
||||
"name": "cbrfcchat"
|
||||
},
|
||||
{
|
||||
"jid": "tfxchat@conference.weather.im",
|
||||
"name": "tfxchat"
|
||||
},
|
||||
{
|
||||
"jid": "abqchat@conference.weather.im",
|
||||
"name": "abqchat"
|
||||
},
|
||||
{
|
||||
"jid": "nwrfcchat@conference.weather.im",
|
||||
"name": "nwrfcchat"
|
||||
},
|
||||
{
|
||||
"jid": "rlxchat@conference.weather.im",
|
||||
"name": "rlxchat"
|
||||
},
|
||||
{
|
||||
"jid": "ounchat@conference.weather.im",
|
||||
"name": "ounchat"
|
||||
},
|
||||
{
|
||||
"jid": "clechat@conference.weather.im",
|
||||
"name": "clechat"
|
||||
},
|
||||
{
|
||||
"jid": "loxchat@conference.weather.im",
|
||||
"name": "loxchat"
|
||||
},
|
||||
{
|
||||
"jid": "fsdchat@conference.weather.im",
|
||||
"name": "fsdchat"
|
||||
},
|
||||
{
|
||||
"jid": "bgmchat@conference.weather.im",
|
||||
"name": "bgmchat"
|
||||
},
|
||||
{
|
||||
"jid": "wgrfcchat@conference.weather.im",
|
||||
"name": "wgrfcchat"
|
||||
},
|
||||
{
|
||||
"jid": "ewxchat@conference.weather.im",
|
||||
"name": "ewxchat"
|
||||
},
|
||||
{
|
||||
"jid": "iowawx@conference.weather.im",
|
||||
"name": "iowawx"
|
||||
},
|
||||
{
|
||||
"jid": "ohrfcchat@conference.weather.im",
|
||||
"name": "ohrfcchat"
|
||||
},
|
||||
{
|
||||
"jid": "serfcchat@conference.weather.im",
|
||||
"name": "serfcchat"
|
||||
},
|
||||
{
|
||||
"jid": "stichat@conference.weather.im",
|
||||
"name": "stichat"
|
||||
},
|
||||
{
|
||||
"jid": "zdvchat@conference.weather.im",
|
||||
"name": "zdvchat"
|
||||
},
|
||||
{
|
||||
"jid": "eaxchat@conference.weather.im",
|
||||
"name": "eaxchat"
|
||||
},
|
||||
{
|
||||
"jid": "iwxchat@conference.weather.im",
|
||||
"name": "iwxchat"
|
||||
},
|
||||
{
|
||||
"jid": "lubchat@conference.weather.im",
|
||||
"name": "lubchat"
|
||||
},
|
||||
{
|
||||
"jid": "bufchat@conference.weather.im",
|
||||
"name": "bufchat"
|
||||
},
|
||||
{
|
||||
"jid": "pdtchat@conference.weather.im",
|
||||
"name": "pdtchat"
|
||||
},
|
||||
{
|
||||
"jid": "mkxchat@conference.weather.im",
|
||||
"name": "mkxchat"
|
||||
},
|
||||
{
|
||||
"jid": "grbchat@conference.weather.im",
|
||||
"name": "grbchat"
|
||||
},
|
||||
{
|
||||
"jid": "topchat@conference.weather.im",
|
||||
"name": "topchat"
|
||||
},
|
||||
{
|
||||
"jid": "rnkchat@conference.weather.im",
|
||||
"name": "rnkchat"
|
||||
},
|
||||
{
|
||||
"jid": "lzkchat@conference.weather.im",
|
||||
"name": "lzkchat"
|
||||
},
|
||||
{
|
||||
"jid": "ctpchat@conference.weather.im",
|
||||
"name": "ctpchat"
|
||||
},
|
||||
{
|
||||
"jid": "gldchat@conference.weather.im",
|
||||
"name": "gldchat"
|
||||
},
|
||||
{
|
||||
"jid": "abrfcchat@conference.weather.im",
|
||||
"name": "abrfcchat"
|
||||
},
|
||||
{
|
||||
"jid": "mpxchat@conference.weather.im",
|
||||
"name": "mpxchat"
|
||||
},
|
||||
{
|
||||
"jid": "zdcchat@conference.weather.im",
|
||||
"name": "zdcchat"
|
||||
},
|
||||
{
|
||||
"jid": "lsxchat@conference.weather.im",
|
||||
"name": "lsxchat"
|
||||
},
|
||||
{
|
||||
"jid": "pahchat@conference.weather.im",
|
||||
"name": "pahchat"
|
||||
},
|
||||
{
|
||||
"jid": "bouchat@conference.weather.im",
|
||||
"name": "bouchat"
|
||||
},
|
||||
{
|
||||
"jid": "tsachat@conference.weather.im",
|
||||
"name": "tsachat"
|
||||
},
|
||||
{
|
||||
"jid": "zfwchat@conference.weather.im",
|
||||
"name": "zfwchat"
|
||||
},
|
||||
{
|
||||
"jid": "zauchat@conference.weather.im",
|
||||
"name": "zauchat"
|
||||
},
|
||||
{
|
||||
"jid": "aprfcchat@conference.weather.im",
|
||||
"name": "aprfcchat"
|
||||
},
|
||||
{
|
||||
"jid": "mqtchat@conference.weather.im",
|
||||
"name": "mqtchat"
|
||||
},
|
||||
{
|
||||
"jid": "mafchat@conference.weather.im",
|
||||
"name": "mafchat"
|
||||
},
|
||||
{
|
||||
"jid": "mrxchat@conference.weather.im",
|
||||
"name": "mrxchat"
|
||||
},
|
||||
{
|
||||
"jid": "fgzchat@conference.weather.im",
|
||||
"name": "fgzchat"
|
||||
},
|
||||
{
|
||||
"jid": "oaxchat@conference.weather.im",
|
||||
"name": "oaxchat"
|
||||
},
|
||||
{
|
||||
"jid": "btvchat@conference.weather.im",
|
||||
"name": "btvchat"
|
||||
},
|
||||
{
|
||||
"jid": "ictchat@conference.weather.im",
|
||||
"name": "ictchat"
|
||||
},
|
||||
{
|
||||
"jid": "mfrchat@conference.weather.im",
|
||||
"name": "mfrchat"
|
||||
},
|
||||
{
|
||||
"jid": "hgxchat@conference.weather.im",
|
||||
"name": "hgxchat"
|
||||
},
|
||||
{
|
||||
"jid": "afgchat@conference.weather.im",
|
||||
"name": "afgchat"
|
||||
},
|
||||
{
|
||||
"jid": "sgfchat@conference.weather.im",
|
||||
"name": "sgfchat"
|
||||
},
|
||||
{
|
||||
"jid": "hawaii@conference.weather.im",
|
||||
"name": "Hawaii Weather"
|
||||
},
|
||||
{
|
||||
"jid": "zlachat@conference.weather.im",
|
||||
"name": "zlachat"
|
||||
},
|
||||
{
|
||||
"jid": "alychat@conference.weather.im",
|
||||
"name": "alychat"
|
||||
},
|
||||
{
|
||||
"jid": "sjtchat@conference.weather.im",
|
||||
"name": "sjtchat"
|
||||
},
|
||||
{
|
||||
"jid": "janchat@conference.weather.im",
|
||||
"name": "janchat"
|
||||
},
|
||||
{
|
||||
"jid": "gspchat@conference.weather.im",
|
||||
"name": "gspchat"
|
||||
},
|
||||
{
|
||||
"jid": "lwxchat@conference.weather.im",
|
||||
"name": "lwxchat"
|
||||
},
|
||||
{
|
||||
"jid": "gyxchat@conference.weather.im",
|
||||
"name": "gyxchat"
|
||||
},
|
||||
{
|
||||
"jid": "lbfchat@conference.weather.im",
|
||||
"name": "lbfchat"
|
||||
},
|
||||
{
|
||||
"jid": "jaxchat@conference.weather.im",
|
||||
"name": "jaxchat"
|
||||
},
|
||||
{
|
||||
"jid": "fgfchat@conference.weather.im",
|
||||
"name": "fgfchat"
|
||||
}
|
||||
]
|
||||
}
|
80
index.js
80
index.js
|
@ -1,9 +1,9 @@
|
|||
// Requires
|
||||
const fs = require("fs");
|
||||
const config = require("./config.json");
|
||||
const wfos = require("./wfos.json");
|
||||
const iem = require("./iem.json");
|
||||
const events = require("./events.json");
|
||||
const wfos = require("./data/wfos.json");
|
||||
const blacklist = require("./data/blacklist.json");
|
||||
const events = require("./data/events.json");
|
||||
const { client, xml } = require("@xmpp/client");
|
||||
const fetch = require("node-fetch");
|
||||
const html = require("html-entities")
|
||||
|
@ -37,11 +37,7 @@ const db = new sqlite3.Database("channels.db", (err) => {
|
|||
db.run(`CREATE TABLE IF NOT EXISTS userAlerts (userid TEXT, iemchannel TEXT, filter TEXT, filterEvt TEXT, minPriority INT)`);
|
||||
});
|
||||
|
||||
// Setup stuff
|
||||
var startup = true;
|
||||
var startTimestap = new Date();
|
||||
var messages = 0;
|
||||
var errCount = 0;
|
||||
|
||||
// Random funcs
|
||||
const parseProductID = function (product_id) {
|
||||
const [timestamp, station, wmo, pil] = product_id.split("-");
|
||||
|
@ -227,6 +223,15 @@ const generateUUID = function () {
|
|||
return generateRandomString({ lower: true, upper: true, number: true }, 8) + "-" + generateRandomString({ lower: true, upper: true, number: true }, 4) + "-" + generateRandomString({ lower: true, upper: true, number: true }, 4) + "-" + generateRandomString({ lower: true, upper: true, number: true }, 4) + "-" + generateRandomString({ lower: true, upper: true, number: true }, 12);
|
||||
}
|
||||
|
||||
// Variable setup
|
||||
var iem = []
|
||||
var startup = true;
|
||||
var startTimestap = new Date();
|
||||
var messages = 0;
|
||||
var errCount = 0;
|
||||
const curUUID = generateUUID();
|
||||
|
||||
|
||||
const xmpp = client({
|
||||
service: "xmpp://conference.weather.im",
|
||||
domain: "weather.im",
|
||||
|
@ -253,24 +258,30 @@ xmpp.on("offline", () => {
|
|||
})
|
||||
});
|
||||
|
||||
|
||||
xmpp.on("stanza", (stanza) => {
|
||||
// If room list, console.log
|
||||
// Debug stuff
|
||||
if (config.debug >= 2) console.log(`${colors.magenta("[DEBUG]")} Stanza: ${stanza.toString()}`);
|
||||
|
||||
|
||||
// Handle Room List
|
||||
if (stanza.is("iq") && stanza.attrs.type === "result" && stanza.getChild("query")) {
|
||||
query = stanza.getChild("query");
|
||||
if (query.attrs.xmlns === "http://jabber.org/protocol/disco#items") {
|
||||
query.getChildren("item").forEach((item) => {
|
||||
console.log(`${colors.cyan("[INFO]")} Found room: ${JSON.stringify(item.attrs)}`);
|
||||
// Check if the JID is on the blacklist, if so, ignore it
|
||||
if (blacklist.includes(item.attrs.jid)) return;
|
||||
iem.push(item.attrs);
|
||||
console.log(`${colors.cyan("[INFO]")} Found room: ${item.attrs.jid}`);
|
||||
// Join the room
|
||||
//xmpp.send(xml("presence", { to: `${channel.jid}/${channel.name}/${curUUID}` }, xml("item", { role: "visitor" })));
|
||||
xmpp.send(xml("presence", { to: `${item.attrs.jid}/${curUUID}` }, xml("item", { role: "visitor" })));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (config.debug >= 2) console.log(`${colors.magenta("[DEBUG]")} Stanza: ${stanza.toString()}`);
|
||||
// Stops spam from getting old messages
|
||||
if (startup) return;
|
||||
// Get new messages and log them, ignore old messages
|
||||
if (stanza.is("message") && stanza.attrs.type === "groupchat") {
|
||||
// Stops spam from getting old messages
|
||||
if (startup) return;
|
||||
// Get channel name
|
||||
fromChannel = stanza.attrs.from.split("@")[0];
|
||||
// Ignores
|
||||
|
@ -448,7 +459,7 @@ xmpp.on("online", async (address) => {
|
|||
|
||||
errCount = 0;
|
||||
// Start listening on all channels, (dont ban me funny man)
|
||||
// for (const channel in iem.channels) {
|
||||
// for (const channel in iem) {
|
||||
// console.log(`Joining ${channel.name}`)
|
||||
// await xmpp.send(xml("presence", { to: `${channel.jud}/${channel.name}` }));
|
||||
// }
|
||||
|
@ -463,15 +474,14 @@ xmpp.on("online", async (address) => {
|
|||
*/
|
||||
|
||||
// Request room list
|
||||
// TODO: Automatically find room list
|
||||
//xmpp.send(xml("iq", { type: "get", to: "conference.weather.im", id: "rooms" }, xml("query", { xmlns: "http://jabber.org/protocol/disco#items" })));
|
||||
var curUUID = generateUUID();
|
||||
// Join all channels
|
||||
iem.channels.forEach((channel => {
|
||||
console.log(`${colors.cyan("[INFO]")} Joining ${channel.jid}/${channel.name}/${curUUID}`)
|
||||
//xmpp.send(xml("presence", { to: `${channel.jid}/${channel.jid.split("@")[0]}` }));
|
||||
xmpp.send(xml("presence", { to: `${channel.jid}/${channel.name}/${curUUID}` }, xml("item", { role: "visitor" })));
|
||||
}))
|
||||
// Automatically find room list
|
||||
xmpp.send(xml("iq", { type: "get", to: "conference.weather.im", id: "rooms" }, xml("query", { xmlns: "http://jabber.org/protocol/disco#items" })));
|
||||
// Join all channels (Old method)
|
||||
// iem.forEach((channel => {
|
||||
// console.log(`${colors.cyan("[INFO]")} Joining ${channel.jid}/${channel.name}/${curUUID}`)
|
||||
// //xmpp.send(xml("presence", { to: `${channel.jid}/${channel.jid.split("@")[0]}` }));
|
||||
// xmpp.send(xml("presence", { to: `${channel.jid}/${channel.name}/${curUUID}` }, xml("item", { role: "visitor" })));
|
||||
// }))
|
||||
|
||||
console.log(`${colors.cyan("[INFO]")} Connected to XMPP server as ${address.toString()}`);
|
||||
|
||||
|
@ -760,7 +770,7 @@ discord.on("interactionCreate", async (interaction) => {
|
|||
switch (interaction.commandName) {
|
||||
case "subscribe":
|
||||
room = getWFOroom(interaction.options.getString("room"));
|
||||
if (!iem.channels.find((channel) => channel.jid.split("@")[0] === room)) {
|
||||
if (!iem.find((channel) => channel.jid.split("@")[0] === room)) {
|
||||
interaction.reply({ content: "Invalid room", ephemeral: true });
|
||||
return;
|
||||
}
|
||||
|
@ -777,7 +787,7 @@ discord.on("interactionCreate", async (interaction) => {
|
|||
case "unsubscribe":
|
||||
// Check that the room is valid
|
||||
room = getWFOroom(interaction.options.getString("room"));
|
||||
if (!iem.channels.find((channel) => channel.jid.split("@")[0] === room)) {
|
||||
if (!iem.find((channel) => channel.jid.split("@")[0] === room)) {
|
||||
interaction.reply({ content: "Invalid room", ephemeral: true });
|
||||
return;
|
||||
}
|
||||
|
@ -809,7 +819,7 @@ discord.on("interactionCreate", async (interaction) => {
|
|||
break;
|
||||
case "setmessage":
|
||||
room = getWFOroom(interaction.options.getString("room"));
|
||||
if (!iem.channels.find((channel) => channel.jid.split("@")[0] === room)) {
|
||||
if (!iem.find((channel) => channel.jid.split("@")[0] === room)) {
|
||||
interaction.reply({ content: "Invalid room", ephemeral: true });
|
||||
return;
|
||||
}
|
||||
|
@ -877,7 +887,7 @@ discord.on("interactionCreate", async (interaction) => {
|
|||
case "rooms":
|
||||
// // Send an embed showing all the available rooms
|
||||
// let roomList = "";
|
||||
// iem.channels.forEach((channel) => {
|
||||
// iem.forEach((channel) => {
|
||||
// room = channel.jid.split("@")[0]
|
||||
// console.log(getWFOByRoom(room))
|
||||
// roomList += `\`${room}\`: ${getWFOByRoom(room).location}\n`;
|
||||
|
@ -890,7 +900,7 @@ discord.on("interactionCreate", async (interaction) => {
|
|||
// interaction.reply({ embeds: [roomEmbed], ephemeral: true });
|
||||
// Do the above, but paginate like the product text
|
||||
let roomList = "";
|
||||
iem.channels.forEach((channel) => {
|
||||
iem.forEach((channel) => {
|
||||
room = channel.jid.split("@")[0]
|
||||
roomList += `\`${room}\`: ${getWFOByRoom(room).location || "Unknown"}\n`;
|
||||
});
|
||||
|
@ -911,9 +921,9 @@ discord.on("interactionCreate", async (interaction) => {
|
|||
// Create channels for all rooms
|
||||
const chunks = [];
|
||||
const chunkSize = 50;
|
||||
const totalRooms = iem.channels.length;
|
||||
const totalRooms = iem.length;
|
||||
for (let i = 0; i < totalRooms; i += chunkSize) {
|
||||
chunks.push(iem.channels.slice(i, i + chunkSize));
|
||||
chunks.push(iem.slice(i, i + chunkSize));
|
||||
}
|
||||
|
||||
chunks.forEach((chunk, index) => {
|
||||
|
@ -1035,7 +1045,7 @@ discord.on("interactionCreate", async (interaction) => {
|
|||
|
||||
case "usersubscribe":
|
||||
room = getWFOroom(interaction.options.getString("room"));
|
||||
if (!iem.channels.find((channel) => channel.jid.split("@")[0] === room)) {
|
||||
if (!iem.find((channel) => channel.jid.split("@")[0] === room)) {
|
||||
interaction.reply({ content: "Invalid room", ephemeral: true });
|
||||
return;
|
||||
}
|
||||
|
@ -1053,7 +1063,7 @@ discord.on("interactionCreate", async (interaction) => {
|
|||
break;
|
||||
case "userunsubscribe":
|
||||
room = getWFOroom(interaction.options.getString("room"));
|
||||
if (!iem.channels.find((channel) => channel.jid.split("@")[0] === room)) {
|
||||
if (!iem.find((channel) => channel.jid.split("@")[0] === room)) {
|
||||
interaction.reply({ content: "Invalid room", ephemeral: true });
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue