From 50f77439fb9acdcfbdad15ac45576329544089ee Mon Sep 17 00:00:00 2001 From: jacob1 Date: Mon, 13 Nov 2017 00:22:33 -0500 Subject: [PATCH] fix dead vengeful ghost being unable to use any commands --- src/handler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/handler.py b/src/handler.py index 04a780a..79487ce 100644 --- a/src/handler.py +++ b/src/handler.py @@ -70,6 +70,8 @@ def on_privmsg(cli, rawnick, chan, msg, *, notice=False, force_role=None): phase = var.PHASE if user in get_participants(): roles = get_all_roles(user) + # A user can be a participant but not have a role, for example, dead vengeful ghost + has_roles = len(roles) != 0 if force_role is not None: roles &= {force_role} # only fire off role commands for the forced role @@ -93,7 +95,7 @@ def on_privmsg(cli, rawnick, chan, msg, *, notice=False, force_role=None): # allow things like "wolf pstats" because that just doesn't make sense. return - if not common_roles: + if has_roles and not common_roles: # getting here means that at least one of the role_cmds is disjoint # from the others. For example, augur see vs seer see when a bare see # is executed. In this event, display a helpful error message instructing