From 92401488df871b15e747515472a797bececcc728 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Mon, 20 Apr 2020 00:25:07 +0200 Subject: Add custom server ip, and custom bridge command --- hackchatcustom.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'hackchatcustom.py') 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 -- ; 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() -- cgit v1.2.1