diff --git a/channel_util.py b/channel_util.py index 0fd38f6..af8373f 100644 --- a/channel_util.py +++ b/channel_util.py @@ -4,7 +4,7 @@ import shelve DB_NAME = "channel_priveleges" # Define our patterns -channel_check_pattern = r"channel id" +channel_check_pattern = r"channel id\s*(.*)" # channel_check_pattern = r"channel id <#(.*)>" # identify_other_pattern = r"<@(.*)>\s+has scroll\s+(.*)" @@ -13,5 +13,12 @@ def channel_check_callback(slack, msg, match): # Sets the users scroll # 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 - slack_util.reply(slack, msg, msg["channel"]) \ No newline at end of file + response = "" + response += "Channel id: {}\n".format(msg["channel"]) + response += "Escaped message: {}\n".format(rest_of_msg) + slack_util.reply(slack, msg, response) \ No newline at end of file