aboutsummaryrefslogtreecommitdiffstats
path: root/hackchatcustom.py
diff options
context:
space:
mode:
authorTim Schmidt <tim.schmidt@ewe.net>2018-12-15 12:30:48 +0100
committerTim Schmidt <tim.schmidt@ewe.net>2018-12-15 12:30:48 +0100
commitd2b83008c9e6ec9226bac71ca79bfa2f3c999d46 (patch)
treee26289c7ece76ef98aa523bac0459e2d048f4bcc /hackchatcustom.py
parentdisabled debug logging (diff)
downloadhchat-tg-bridge-d2b83008c9e6ec9226bac71ca79bfa2f3c999d46.tar.gz
hchat-tg-bridge-d2b83008c9e6ec9226bac71ca79bfa2f3c999d46.zip
HC: added emote and invite, TG: switched to HTML
Diffstat (limited to 'hackchatcustom.py')
-rw-r--r--hackchatcustom.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/hackchatcustom.py b/hackchatcustom.py
index 1c10adc..67de077 100644
--- a/hackchatcustom.py
+++ b/hackchatcustom.py
@@ -30,6 +30,8 @@ class HackChat:
self.on_message = []
self.on_join = []
self.on_leave = []
+ self.on_emote = []
+ self.on_invite = []
self.stopped = False
@@ -107,6 +109,13 @@ class HackChat:
elif result["cmd"] == "onlineSet":
for nick in result["nicks"]:
self.online_users.append(nick)
+ elif result["cmd"] == "info":
+ if result["type"] == "emote":
+ for handler in list(self.on_emote):
+ handler(self, result)
+ elif result["type"] == "invite":
+ for handler in list(self.on_invite):
+ handler(self, result)
def stop(self):
"""Gracefully stops all bot threads and closes WebSocket connection."""