From 3d7f6c992406bc168c107398beb14730e549e3b0 Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 4 Oct 2019 15:20:38 +0100 Subject: [PATCH] only allow !to against users bitbot has seen before closes #111 --- modules/to.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/to.py b/modules/to.py index 4fd44cbd..91c9fa72 100644 --- a/modules/to.py +++ b/modules/to.py @@ -22,6 +22,10 @@ class Module(ModuleManager.BaseModule): channel :usage: """ + 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", [])