Skip to content

Commit

Permalink
announce: fix invalid access to bot.isupport for TARGMAX
Browse files Browse the repository at this point in the history
  • Loading branch information
Exirel committed Apr 9, 2021
1 parent dfb2868 commit d50145b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sopel/modules/announce.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ def announce(bot, trigger):
bot.reply('Announce what? I need a message to say.')
return

size = bot.isupport.get('TARGMAX', {}).get('PRIVMSG', 1)
size = 1
try:
size = bot.isupport.TARGMAX.get('PRIVMSG', size)
except AttributeError:
pass

channels = _chunks(bot.channels.keys(), size)
for cgroup in channels:
bot.say(trigger.group(2), ','.join(cgroup))

bot.reply('Announce complete.')

0 comments on commit d50145b

Please sign in to comment.