Skip to content

Commit

Permalink
Add link to user to blame
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-daniels committed Dec 7, 2015
1 parent 76f1ceb commit c193d67
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions chatcommunicate.py
Expand Up @@ -56,8 +56,9 @@ def watcher(ev, wrap2):
message_parts = content_source.split(" ")

ev_user_name = ev.data["user_name"].encode('utf-8')
ev_user_link = "//chat." + wrap2.host + "/users/" + ev.message.data["owner_user_id"]
if ev_user_name != "SmokeDetector":
GlobalVars.tavern_users_chatting.append(ev_user_name)
GlobalVars.tavern_users_chatting.append((ev_user_name, ev_user_link))

shortcut_messages = []
if message_parts[0].lower() == "sd":
Expand Down Expand Up @@ -394,7 +395,7 @@ def handle_commands(content_lower, message_parts, ev_room, ev_room_name, ev_user
if content_lower.startswith("!!/blame") and (ev_room == GlobalVars.meta_tavern_room_id or ev_room == GlobalVars.socvr_room_id):
GlobalVars.tavern_users_chatting = list(set(GlobalVars.tavern_users_chatting)) # Make unique
user_to_blame = random.choice(GlobalVars.tavern_users_chatting)
return "It's " + user_to_blame + "'s fault."
return "It's [{}]({})'s fault.".format(user_to_blame[0], user_to_blame[1])
if "smokedetector" in content_lower and "fault" in content_lower and ("xkcdbot" in ev_user_name.lower() or "bjb568" in ev_user_name.lower()):
return "Liar"
if content_lower.startswith("!!/coffee"):
Expand Down

0 comments on commit c193d67

Please sign in to comment.