aboutsummaryrefslogtreecommitdiffstats
path: root/hackchatcustom.py
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2020-04-20 00:25:07 +0200
committerNao Pross <naopross@thearcway.org>2020-04-20 00:25:07 +0200
commit92401488df871b15e747515472a797bececcc728 (patch)
tree61d4721d1750eb8e52f65dcc3c9d414b98e297aa /hackchatcustom.py
parentHC: added emote and invite, TG: switched to HTML (diff)
downloadhchat-tg-bridge-92401488df871b15e747515472a797bececcc728.tar.gz
hchat-tg-bridge-92401488df871b15e747515472a797bececcc728.zip
Add custom server ip, and custom bridge command
Diffstat (limited to 'hackchatcustom.py')
-rw-r--r--hackchatcustom.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/hackchatcustom.py b/hackchatcustom.py
index 67de077..e6ac476 100644
--- a/hackchatcustom.py
+++ b/hackchatcustom.py
@@ -18,7 +18,7 @@ class HackChat:
third for the nickname of the sender of the message.
"""
- def __init__(self, nick, channel="programming"):
+ def __init__(self, nick, wsurl="wss://hack.chat/chat-ws", channel="programming"):
"""Connects to a channel on https://hack.chat.
Keyword arguments:
nick -- <str>; the nickname to use upon joining the channel
@@ -26,6 +26,7 @@ class HackChat:
"""
self.nick = nick
self.channel = channel
+ self.wsurl = wsurl
self.online_users = []
self.on_message = []
self.on_join = []
@@ -58,7 +59,7 @@ class HackChat:
if self.stopped:
raise ValueError("Can't run a stopped bot.")
- self.ws = websocket.create_connection("wss://hack.chat/chat-ws")
+ self.ws = websocket.create_connection(self.wsurl)
self._send_packet({"cmd": "join", "channel": self.channel, "nick": self.nick})
self._recv_thread.start()
self._ka_thread.start()