Follow better python formatting guidelines.

master
josiah 5 years ago
parent 5094afba60
commit b27189bc88

@ -4,13 +4,13 @@ import slack
EXAMPLE_COMMAND = "do"
MENTION_REGEX = "^<@(|[WU].+)>(.*)"
bot_channel = "bots-like-gaston"
BOT_CHANNEL = "bots-like-gaston"
def parse_direct_mention(message_text):
"""
Finds a direct mention (a mention that is at the beginning) in message text
and returns the user ID which was mentioned. If there is no direct mention, returns None
Finds a direct mention (a mention that is at the beginning) in message text
and returns the user ID which was mentioned. If there is no direct mention, returns None
"""
matches = re.search(MENTION_REGEX, message_text)
# the first group contains the username, the second group contains the remaining message
@ -18,7 +18,8 @@ def parse_direct_mention(message_text):
def reactable_string(text):
"""Return regex objects matching interesting strings
"""
Return regex objects matching interesting strings
"""
reactable_array = []
if re.search(r"\bai\b", text.lower()) is not None:
@ -91,10 +92,7 @@ def handle_messages(**payload):
)
if __name__ == '__main__':
slack_token = os.environ["SLACK_API_TOKEN"]
client = slack.WebClient(token=os.environ['SLACK_API_TOKEN'])
rtm_client = slack.RTMClient(token=slack_token)
rtm_client.start()
SLACK_TOKEN = os.environ["SLACK_API_TOKEN"]
CLIENT = slack.WebClient(token=os.environ['SLACK_API_TOKEN'])
RTM_CLIENT = slack.RTMClient(token=SLACK_TOKEN)
RTM_CLIENT.start()

Loading…
Cancel
Save