Fix idiotic error with threading

- if you thread, an event is generated that wraps the message event in
  a dict

- but only after the event already comes through.

- don't make threads and life gets so much fucking easier.
master
jowj 5 years ago
parent e11906fa48
commit 562926f33c

@ -33,14 +33,6 @@ def reactable_string(text):
return reactable_array
# def react_to_message(reaction):
# payload['web_client'].reactions_add(
# channel = channel_id,
# name = reaction,
# thread_ts = thread_ts
# )
@slack.RTMClient.run_on(event='message')
def handle_messages(**payload):
"""
@ -51,6 +43,9 @@ def handle_messages(**payload):
data = payload['data']
channel_id = data['channel']
thread_ts = data['ts']
pdb.set_trace()
if reactable_string(data['text']):
reactions_needed = reactable_string(data['text'])
def react_to_message(reaction):
@ -90,7 +85,7 @@ def handle_messages(**payload):
webclient.chat_postMessage(
channel=channel_id,
text=response,
thread_ts=thread_ts
timestamp=thread_ts
)

Loading…
Cancel
Save