From d447600921e19ef6a0ab77b9b2ce0e5f0ce26dfd Mon Sep 17 00:00:00 2001 From: dgw Date: Fri, 18 Oct 2024 16:06:30 -0500 Subject: [PATCH] util: don't respond if user not found in CTCP ACTION slap --- sopel_slap/util.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sopel_slap/util.py b/sopel_slap/util.py index 777553e..e402935 100644 --- a/sopel_slap/util.py +++ b/sopel_slap/util.py @@ -36,7 +36,12 @@ def slap(bot: SopelWrapper, trigger: Trigger, target: str): return if target not in bot.channels[trigger.sender].users: - bot.reply("You can't slap someone who isn't here!") + if not trigger.ctcp: + # only reply if a command was used; ignore CTCP ACTIONs + # we don't want the bot to be annoying to people who do "/me slaps" + # without realizing (or remembering) that the bot responds to it + bot.reply("You can't slap someone who isn't here!") + return if target == bot.nick: