Skip to content

Commit 115f800

Browse files
committed
ChannelStats: Fix bug when conf.supybot.databases.plugins.channelSpecific is true (KeyError in channels list).
1 parent 70a169a commit 115f800

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugins/ChannelStats/plugin.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,9 @@ def channelstats(self, irc, msg, args, channel):
362362
irc.error(format('You must be in %s to use this command.', channel))
363363
return
364364
try:
365-
stats = self.db.getChannelStats(channel)
365+
channeldb = conf.supybot.databases.plugins.channelSpecific. \
366+
getChannelLink(channel)
367+
stats = self.db.getChannelStats(channeldb)
366368
curUsers = len(irc.state.channels[channel].users)
367369
s = format(_('On %s there %h been %i messages, containing %i '
368370
'characters, %n, %n, and %n; '
@@ -387,7 +389,7 @@ def channelstats(self, irc, msg, args, channel):
387389
irc.reply(s)
388390
except KeyError:
389391
irc.error(format(_('I\'ve never been on %s.'), channel))
390-
channelstats = wrap(channelstats, ['channeldb'])
392+
channelstats = wrap(channelstats, ['channel'])
391393

392394

393395
Class = ChannelStats

0 commit comments

Comments
 (0)