aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2023-09-19 09:48:59 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2023-09-19 09:50:54 +0200
commitc303a77c5420f2f97306802953d57a9587ba5fd6 (patch)
tree60c82b973f1ac14d9caee9c6dc842c9bec9d30d8
parent10719274e261df62828e184b360883e541ed57d6 (diff)
downloadwee-slack-c303a77c5420f2f97306802953d57a9587ba5fd6.tar.gz
Include cookie when making the websocket connection
Slack began to require this for xoxc tokens today.
-rw-r--r--wee_slack.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py
index cd890e6..84c437f 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -1777,9 +1777,11 @@ class SlackTeam(object):
# only http proxy is currently supported
proxy = ProxyWrapper()
timeout = config.slack_timeout / 1000
+ cookie = SlackRequest(self.team, "").options()["cookie"]
if proxy.has_proxy:
ws = create_connection(
self.ws_url,
+ cookie=cookie,
timeout=timeout,
sslopt=sslopt_ca_certs,
http_proxy_host=proxy.proxy_address,
@@ -1788,7 +1790,10 @@ class SlackTeam(object):
)
else:
ws = create_connection(
- self.ws_url, timeout=timeout, sslopt=sslopt_ca_certs
+ self.ws_url,
+ cookie=cookie,
+ timeout=timeout,
+ sslopt=sslopt_ca_certs,
)
self.hook = w.hook_fd(