Total Complexity | 3 |
Total Lines | 16 |
Duplicated Lines | 0 % |
1 | from . import CommandError |
||
5 | class RemoveCommand(AddCommand): |
||
6 | command = '/remove' |
||
7 | |||
8 | def remove(self, tab_id, user_id, message_id, date, amount, reason=''): |
||
9 | tab = self.get_tab(tab_id) |
||
10 | tab.remove(message_id, user_id, date, amount, reason) |
||
11 | |||
12 | def process_howmuch(self, message): |
||
13 | try: |
||
14 | amount, reason = self.get_amount(message.text) |
||
15 | except CommandError: |
||
16 | self.bot.say(message, "Nope, I don't get ya") |
||
17 | return |
||
18 | self.remove(message.chat.id, message.from_user.id, message.message_id, |
||
19 | message.date, amount, reason) |
||
20 | self.bot.say(message, 'Removed {}'.format(amount)) |
||
21 |