Total Complexity | 4 |
Total Lines | 14 |
Duplicated Lines | 0 % |
1 | import config |
||
6 | class StatsCommand(BotCommand): |
||
7 | command = '/stats' |
||
8 | |||
9 | @classmethod |
||
10 | def match(cls, message): |
||
11 | if message.from_user.id not in config.administrators: |
||
12 | return False |
||
13 | return super(StatsCommand, cls).match(message) |
||
14 | |||
15 | def default(self, message): |
||
16 | msg = '' |
||
17 | for key, value in self.bot.db.root.stats.items(): |
||
18 | msg += '{}: {}\n'.format(key.replace('_', ' ').capitalize(), value) |
||
19 | self.bot.say(message, msg) |
||
20 |