Skip to content

Commit

Permalink
Replace deprecated calls to msg() with say()
Browse files Browse the repository at this point in the history
The proverbial `bot.msg()` has been deprecated since Sopel 6. It's time
we modernized how this plugin talks.
  • Loading branch information
dgw committed Feb 20, 2020
1 parent 95d54d4 commit fccd7b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions sopel_modules/github/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def configure_repo_messages(bot, trigger):
'''
allowed = bot.privileges[trigger.sender].get(trigger.nick, 0) >= OP
if not allowed and not trigger.admin:
return bot.msg(trigger.sender, 'You must be a channel operator to use this command!')
return bot.say('You must be a channel operator to use this command!')

if not trigger.group(2):
return bot.say(configure_repo_messages.__doc__.strip())
Expand Down Expand Up @@ -396,7 +396,7 @@ def configure_repo_colors(bot, trigger):
'''
allowed = bot.privileges[trigger.sender].get(trigger.nick, 0) >= OP
if not allowed and not trigger.admin:
return bot.msg(trigger.sender, 'You must be a channel operator to use this command!')
return bot.say('You must be a channel operator to use this command!')

if not trigger.group(2):
return bot.say(configure_repo_colors.__doc__.strip())
Expand Down
6 changes: 3 additions & 3 deletions sopel_modules/github/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,17 @@ def get_targets(repo):
def process_payload(payload, targets):
if payload['event'] == 'ping':
for row in targets:
sopel_instance.msg(row[0], '[{}] {}: {} (Your webhook is now enabled)'.format(
sopel_instance.say('[{}] {}: {} (Your webhook is now enabled)'.format(
fmt_repo(payload['repository']['name'], row),
fmt_name(payload['sender']['login'], row),
payload['zen']))
payload['zen']), row[0])
return

for row in targets:
messages = get_formatted_response(payload, row)
# Write the formatted message(s) to the channel
for message in messages:
sopel_instance.msg(row[0], message)
sopel_instance.say(message, row[0])


@bottle.get("/webhook")
Expand Down

0 comments on commit fccd7b0

Please sign in to comment.