|
|
|
@ -2,6 +2,7 @@ import os
|
|
|
|
|
import re
|
|
|
|
|
import json
|
|
|
|
|
import slack
|
|
|
|
|
import random
|
|
|
|
|
|
|
|
|
|
EXAMPLE_COMMAND = "do"
|
|
|
|
|
MENTION_REGEX = "^<@(|[WU].+)>(.*)"
|
|
|
|
@ -19,6 +20,19 @@ def parse_direct_mention(message_text):
|
|
|
|
|
return (matches.group(1), matches.group(2).strip()) if matches else (None, None)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def zalgo_ify(text):
|
|
|
|
|
''' Takes some normal text and zalgo-ifies it '''
|
|
|
|
|
# "Combining Diacritical Marks" Unicode block.
|
|
|
|
|
combining_chars = [chr(n) for n in range(768, 878)]
|
|
|
|
|
|
|
|
|
|
zalgo_text = ''
|
|
|
|
|
|
|
|
|
|
for char in text:
|
|
|
|
|
combining_char = random.choice(combining_chars)
|
|
|
|
|
zalgo_text += f'{char}{combining_char}'
|
|
|
|
|
|
|
|
|
|
return zalgo_text
|
|
|
|
|
|
|
|
|
|
def reactable_string(text):
|
|
|
|
|
"""
|
|
|
|
|
Return regex objects matching interesting strings
|
|
|
|
@ -81,6 +95,10 @@ def handle_messages(**payload):
|
|
|
|
|
with open("/shared/state.json", "r") as json_File:
|
|
|
|
|
for line in json_File:
|
|
|
|
|
response.append(json.loads(line))
|
|
|
|
|
elif "zalgo" in is_command[1]:
|
|
|
|
|
# remove zalgo
|
|
|
|
|
name_removal = re.sub("^zalgo .*?", "", is_command[1])
|
|
|
|
|
response = zalgo_ify(name_removal)
|
|
|
|
|
elif "pence" in is_command[1]:
|
|
|
|
|
response = "mother wouldn't want me to say that"
|
|
|
|
|
else:
|
|
|
|
|