|
|
|
@ -51,6 +51,19 @@ def reactable_string(text):
|
|
|
|
|
return reactable_array
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
def react_to_message(reaction, payload, channel_id, thread_ts):
|
|
|
|
|
payload['web_client'].reactions_add(
|
|
|
|
|
channel=channel_id,
|
|
|
|
|
name=reaction,
|
|
|
|
|
timestamp=thread_ts
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
=======
|
|
|
|
|
>>>>>>> eef1cb68f5cc4f6b799fa5919ad1420590e74b96
|
|
|
|
|
@slack.RTMClient.run_on(event='message')
|
|
|
|
|
def handle_messages(**payload):
|
|
|
|
|
"""
|
|
|
|
@ -65,6 +78,8 @@ def handle_messages(**payload):
|
|
|
|
|
if reactable_string(data['text']):
|
|
|
|
|
reactions_needed = reactable_string(data['text'])
|
|
|
|
|
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
=======
|
|
|
|
|
def react_to_message(reaction):
|
|
|
|
|
payload['web_client'].reactions_add(
|
|
|
|
|
channel=channel_id,
|
|
|
|
@ -72,14 +87,15 @@ def handle_messages(**payload):
|
|
|
|
|
timestamp=thread_ts
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
>>>>>>> eef1cb68f5cc4f6b799fa5919ad1420590e74b96
|
|
|
|
|
if 'ai' in reactions_needed:
|
|
|
|
|
react_to_message("robot_face")
|
|
|
|
|
react_to_message("robot_face", payload, channel_id, thread_ts)
|
|
|
|
|
if 'furry' in reactions_needed:
|
|
|
|
|
react_to_message("eggplant")
|
|
|
|
|
react_to_message("sweat_drops")
|
|
|
|
|
react_to_message("eggplant", payload, channel_id, thread_ts)
|
|
|
|
|
react_to_message("sweat_drops", payload, channel_id, thread_ts)
|
|
|
|
|
if 'flavortown' in reactions_needed:
|
|
|
|
|
react_to_message("dark_sunglasses")
|
|
|
|
|
react_to_message("guyfieri")
|
|
|
|
|
react_to_message("dark_sunglasses", payload, channel_id, thread_ts)
|
|
|
|
|
react_to_message("guyfieri", payload, channel_id, thread_ts)
|
|
|
|
|
|
|
|
|
|
is_command = parse_direct_mention(data['text'])
|
|
|
|
|
|
|
|
|
|