MCPcopy
hub / github.com/Rapptz/discord.py / tick

Method tick

examples/custom_context.py:11–24  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

9
10class 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
27class MyBot(commands.Bot):

Callers 1

guessFunction · 0.45

Calls 1

add_reactionMethod · 0.45

Tested by

no test coverage detected