Skip to content
This repository has been archived by the owner on Nov 10, 2020. It is now read-only.

Commit

Permalink
Merge pull request #78 from jbnance/fix-slap-admins
Browse files Browse the repository at this point in the history
Fix slap's reference to "admins" config section
  • Loading branch information
dgw committed Mar 25, 2019
2 parents 64dc71f + d692aa4 commit 61ce0f4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions slap.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


@commands('slap', 'slaps')
def slap(sopel, trigger):
def slap(bot, trigger):
""".slap <target> - Slaps <target>"""
text = trigger.group().split()
if len(text) < 2:
Expand All @@ -23,18 +23,18 @@ def slap(sopel, trigger):
if text[1] == 'me' or text[1] == 'myself':
text[1] = trigger.nick
try:
if Identifier(text[1]) not in sopel.privileges[trigger.sender.lower()]:
sopel.say("You can't slap someone who isn't here!")
if Identifier(text[1]) not in bot.privileges[trigger.sender.lower()]:
bot.say("You can't slap someone who isn't here!")
return
except KeyError:
pass
if text[1] == sopel.nick:
if text[1] == bot.nick:
if (not trigger.admin):
text[1] = trigger.nick
else:
text[1] = 'itself'
if text[1] in sopel.config.core.admins:
if text[1] in bot.config.core.admins:
if (not trigger.admin):
text[1] = trigger.nick
verb = random.choice(('slaps', 'kicks', 'destroys', 'annihilates', 'punches', 'roundhouse kicks', 'pwns', 'owns'))
sopel.write(['PRIVMSG', trigger.sender, ' :\x01ACTION', verb, text[1], '\x01'])
bot.write(['PRIVMSG', trigger.sender, ' :\x01ACTION', verb, text[1], '\x01'])

0 comments on commit 61ce0f4

Please sign in to comment.