Strip prefix_symbols from PRIVMSG target, for e.g. 'PRIVMSG +#chan :hi'

(line_handler.py)
This commit is contained in:
jesopo 2019-01-27 22:38:19 +00:00
parent 0bb2491399
commit 1301e80621

View file

@ -410,6 +410,11 @@ class Module(ModuleManager.BaseModule):
message_split = message.split(" ") message_split = message.split(" ")
target = event["args"][0] target = event["args"][0]
# strip prefix_symbols from the start of target, for when people use
# e.g. 'PRIVMSG +#channel :hi' which would send a message to only
# voiced-or-above users
target = target.lstrip(list(event["server"].prefix_symbols.keys()))
channel = None channel = None
if target[0] in event["server"].channel_types: if target[0] in event["server"].channel_types:
channel = event["server"].channels.get(event["args"][0]) channel = event["server"].channels.get(event["args"][0])