Skip to content

Commit 47e30a7

Browse files
SnoopJbronzeguydgw
committed
tell: avoid errors produced by empty tellee
Co-authored-by: bronzeguy <[email protected]> Co-authored-by: dgw <[email protected]>
1 parent 6a25d17 commit 47e30a7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sopel/builtins/tell.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,14 @@ def f_remind(bot, trigger):
178178
verb = trigger.group(1)
179179

180180
if not trigger.group(3):
181+
tellee = ""
182+
else:
183+
tellee = trigger.group(3).rstrip('.,:;').lstrip('@')
184+
185+
if not tellee:
181186
bot.reply("%s whom?" % verb)
182187
return
183188

184-
tellee = trigger.group(3).rstrip('.,:;')
185-
186189
# all we care about is having at least one non-whitespace
187190
# character after the name
188191
if not trigger.group(4):
@@ -204,9 +207,6 @@ def f_remind(bot, trigger):
204207
bot.reply('That nickname is too long.')
205208
return
206209

207-
if tellee[0] == '@':
208-
tellee = tellee[1:]
209-
210210
if tellee == bot.nick:
211211
bot.reply("I'm here now; you can %s me whatever you want!" % verb)
212212
return

0 commit comments

Comments
 (0)