Compare commits

..

3 Commits

Author SHA1 Message Date
0eb571efa2 update data store 2019-11-05 08:08:42 -05:00
13815e4264 add help message 2019-11-05 08:08:23 -05:00
86933f1954 add ssl support 2019-11-05 08:08:04 -05:00
5 changed files with 15 additions and 6 deletions

View File

@ -6,7 +6,7 @@ All static data came from https://github.com/WFCD/warframe-worldstate-data
## Requirements ## Requirements
Python 3.6+ Python 3.6+
Python packages: `twisted service_identity requests` Python packages: `twisted pyOpenSSL service_identity requests`
## Config ## Config
`server` - Server address. `server` - Server address.

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"MT_EXCAVATE": {"value": "Excavation"}, "MT_SABOTAGE": {"value": "Sabotage"}, "MT_MOBILE_DEFENSE": {"value": "Mobile Defense"}, "MT_ASSASSINATION": {"value": "Assassination"}, "MT_EXTERMINATION": {"value": "Extermination"}, "MT_HIVE": {"value": "Hive"}, "MT_DEFENSE": {"value": "Defense"}, "MT_TERRITORY": {"value": "Interception"}, "MT_ARENA": {"value": "Rathuum"}, "MT_PVP": {"value": "Conclave"}, "MT_RESCUE": {"value": "Rescue"}, "MT_INTEL": {"value": "Spy"}, "MT_SURVIVAL": {"value": "Survival"}, "MT_CAPTURE": {"value": "Capture"}, "MT_SECTOR": {"value": "Dark Sector"}, "MT_RETRIEVAL": {"value": "Hijack"}, "MT_ASSAULT": {"value": "Assault"}, "MT_EVACUATION": {"value": "Defection"}, "MT_LANDSCAPE": {"value": "Free Roam"}} {"MT_ARENA": {"value": "Rathuum"}, "MT_ARTIFACT": {"value": "Disruption"}, "MT_ASSAULT": {"value": "Assault"}, "MT_ASSASSINATION": {"value": "Assassination"}, "MT_CAPTURE": {"value": "Capture"}, "MT_DEFENSE": {"value": "Defense"}, "MT_DISRUPTION": {"value": "Disruption"}, "MT_EVACUATION": {"value": "Defection"}, "MT_EXCAVATE": {"value": "Excavation"}, "MT_EXTERMINATION": {"value": "Extermination"}, "MT_HIVE": {"value": "Hive"}, "MT_INTEL": {"value": "Spy"}, "MT_LANDSCAPE": {"value": "Free Roam"}, "MT_MOBILE_DEFENSE": {"value": "Mobile Defense"}, "MT_PVP": {"value": "Conclave"}, "MT_RESCUE": {"value": "Rescue"}, "MT_RETRIEVAL": {"value": "Hijack"}, "MT_SABOTAGE": {"value": "Sabotage"}, "MT_SECTOR": {"value": "Dark Sector"}, "MT_SURVIVAL": {"value": "Survival"}, "MT_TERRITORY": {"value": "Interception"}}

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,7 @@ import threading
import configparser import configparser
import requests import requests
from twisted.internet import protocol, reactor from twisted.internet import ssl, protocol, reactor
from twisted.words.protocols import irc from twisted.words.protocols import irc
URI = "http://content.warframe.com/dynamic/worldState.php" URI = "http://content.warframe.com/dynamic/worldState.php"
@ -158,6 +158,11 @@ class WarBot(irc.IRCClient):
Called when the bot receives a PRIVMSG, which can come from channels Called when the bot receives a PRIVMSG, which can come from channels
or users alike. or users alike.
""" """
if message == ".help":
cmds = [".help", ".alerts", ".subscribe", ".unsubscribe",
".update_data", ".cetus"]
cmds.sort()
self.msg(channel, ", ".join(cmds))
if message == ".alerts": if message == ".alerts":
self.alert_ids = [] self.alert_ids = []
self.checkNewAlerts(channel) self.checkNewAlerts(channel)
@ -288,6 +293,10 @@ if __name__ == "__main__":
server = config["server"] server = config["server"]
port = config.getint("port") port = config.getint("port")
print("Connecting to:", server) print("Connecting to:", server)
reactor.connectTCP(server, port, WarBotFactory(config)) reactor.connectSSL(
server,
port,
WarBotFactory(config),
ssl.ClientContextFactory())
reactor.addSystemEventTrigger('before','shutdown', stop.set) reactor.addSystemEventTrigger('before','shutdown', stop.set)
reactor.run() reactor.run()