only allow !to against users bitbot has seen before

closes #111
This commit is contained in:
jesopo 2019-10-04 15:20:38 +01:00
parent 70aceab622
commit 3d7f6c9924

View file

@ -22,6 +22,10 @@ class Module(ModuleManager.BaseModule):
channel
:usage: <nickname> <message>
"""
target_name = event["args_split"][0]
if not event["server"].has_user_id(target_name):
raise utils.EventError("I've never seen %s before" % target_name)
target_user = event["server"].get_user(event["args_split"][0])
messages = event["target"].get_user_setting(target_user.get_id(),
"to", [])