| 9 | |
| 10 | class MyContext(commands.Context): |
| 11 | async def tick(self, value): |
| 12 | # reacts to the message with an emoji |
| 13 | # depending on whether value is True or False |
| 14 | # if its True, it'll add a green check mark |
| 15 | # otherwise, it'll add a red cross mark |
| 16 | emoji = '\N{WHITE HEAVY CHECK MARK}' if value else '\N{CROSS MARK}' |
| 17 | try: |
| 18 | # this will react to the command author's message |
| 19 | await self.message.add_reaction(emoji) |
| 20 | except discord.HTTPException: |
| 21 | # sometimes errors occur during this, for example |
| 22 | # maybe you don't have permission to do that |
| 23 | # we don't mind, so we can just ignore them |
| 24 | pass |
| 25 | |
| 26 | |
| 27 | class MyBot(commands.Bot): |