Made channel id stuff more verbose

This commit is contained in:
Jacob Henry 2018-09-12 23:33:42 -04:00
parent 50e6b11ce0
commit fd8008aae2
1 changed files with 9 additions and 2 deletions

View File

@ -4,7 +4,7 @@ import shelve
DB_NAME = "channel_priveleges" DB_NAME = "channel_priveleges"
# Define our patterns # Define our patterns
channel_check_pattern = r"channel id" channel_check_pattern = r"channel id\s*(.*)"
# channel_check_pattern = r"channel id <#(.*)>" # channel_check_pattern = r"channel id <#(.*)>"
# identify_other_pattern = r"<@(.*)>\s+has scroll\s+(.*)" # identify_other_pattern = r"<@(.*)>\s+has scroll\s+(.*)"
@ -13,5 +13,12 @@ def channel_check_callback(slack, msg, match):
# Sets the users scroll # Sets the users scroll
# with shelve.open(DB_NAME) as db: # with shelve.open(DB_NAME) as db:
rest_of_msg = match.group(1).strip()
rest_of_msg = rest_of_msg.replace("<", "lcaret")
rest_of_msg = rest_of_msg.replace(">", "rcaret")
# Respond # Respond
slack_util.reply(slack, msg, msg["channel"]) response = ""
response += "Channel id: {}\n".format(msg["channel"])
response += "Escaped message: {}\n".format(rest_of_msg)
slack_util.reply(slack, msg, response)