You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guide/docs/popular-topics/reactions.mdx
+28-34Lines changed: 28 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,9 +18,9 @@ In this guide we will be providing an example using the <DocsLink reference="dis
18
18
- Removing reactions that are not owned by the bot requires <DocsLinkreference="disnake.Intents.reactions">Intents.reactions</DocsLink> to be set
19
19
- Therefore <DocsLinkreference="disnake.Intents.messages">Intents.messages</DocsLink> is indirectly required if you want to manipulate reactions
20
20
- A message can have a maximum of 20 unique reactions on it at one time.
21
-
- Reactions are inherently linked to emojis, and your bot will not have access to resend all emojis used by discord users
22
-
- Dealing with reactions result in a fair amount of extra api-calls, meaning it can have rate-limit implications on deployment scale.
23
-
- Using Reactions as a UX interface was never a inteded behavior, and is ultimatly inferior to the newer component style interface
21
+
- Reactions are inherently linked to emojis, and your bot will not have access to resend all emojis used by Discord users.
22
+
- Dealing with reactions results in a fair amount of extra API calls, meaning it can have rate-limit implications on deployment scale.
23
+
- Using Reactions as a UX interface was never a intended behavior, and is ultimately inferior to the newer component style interface.
24
24
:::
25
25
26
26
<DiscordMessages>
@@ -61,27 +61,25 @@ PartialEmoji: are most often custom emojis too, but will usually represent custo
61
61
Strings: are normally returned when Unicode CodePoints are used. These are the standard emojis most are familiar with (✅🎮💛💫)
62
62
but these can also come as a PartialEmoji
63
63
64
-
There is also a small write up about this [`here`](//faq/general.mdx#how-can-i-add-a-reaction-to-a-message)
64
+
There is also a small write up about this [here](../faq/general.mdx#how-can-i-add-a-reaction-to-a-message).
65
65
66
66
:::note
67
-
The examples are only meant to demonstrate how disnake interacts with Reactions, and should probably not be copied verbatim.
68
-
These examples are not intended for cogs, but can easily be adapted to run inside one. See: [**Creating cogs/extensions**](//getting-started/using-cogs.mdx)
69
-
Some examples are also available in the [`DisnakeDev`](https://github.com/DisnakeDev/disnake/tree/master/examples) github repository
67
+
The examples are only meant to demonstrate how disnake interacts with reactions, and should probably not be copied verbatim.
68
+
These examples are not intended for [cogs](../getting-started/using-cogs.mdx), but can easily be adapted to run inside them.
69
+
Some examples are also available in the [GitHub repository](https://github.com/DisnakeDev/disnake/tree/master/examples).
70
70
:::
71
71
72
72
### Example using on_reaction events
73
73
74
74
There are a few reaction related events we can listen/subscribe to:
- <DocsLinkreference="disnake.on_raw_reaction_clear">on_raw_reaction_clear</DocsLink> Called when a message has all reactions
79
-
removed
80
-
- <DocsLinkreference="disnake.on_raw_reaction_clear_emoji">on_raw_reaction_clear_emoji</DocsLink> Called when a specific
81
-
reaction is removed from a message{''}
76
+
- <DocsLinkreference="disnake.on_raw_reaction_add">on_raw_reaction_add</DocsLink>, called when a user adds a reaction
77
+
- <DocsLinkreference="disnake.on_raw_reaction_remove">on_raw_reaction_remove</DocsLink>, called when a user's reaction is removed
78
+
- <DocsLinkreference="disnake.on_raw_reaction_clear">on_raw_reaction_clear</DocsLink>, called when a message has all reactions removed
79
+
- <DocsLinkreference="disnake.on_raw_reaction_clear_emoji">on_raw_reaction_clear_emoji</DocsLink>, called when all reactions with a specific emoji are removed from a message
82
80
83
-
There are non-raw equivilants, but they rely on the cache. If the message is not found in the internal cache, then the event is not called.
84
-
For this reason raw events are preffered, and you are only giving up on an included User/Member object that you can easily fetch if you need it.
81
+
There are non-raw equivalents, but they rely on the cache. If the message is not found in the internal cache, then the event is not called.
82
+
For this reason raw events are preferred, and you are only giving up on an included User/Member object that you can easily fetch if you need it.
85
83
86
84
- More information about events can be found in the docs, [`here`](https://docs.disnake.dev/en/stable/api.html#event-reference)
87
85
@@ -90,9 +88,6 @@ This is generally not an issue since it contains everything we need, but its som
90
88
Raw reaction events come a <DocsLinkreference="disnake.RawReactionActionEvent">RawReactionActionEvent</DocsLink> which is called `payload` in the examples.
We can only use custom emojis from servers the bot has joined, but we can use them interchangably on those servers.
161
-
Bots can make <DocsLinkreference="disnake.ui.Button">buttons</DocsLink> using emojis from outside servers they occupy, this may or may not be intended behaviour from Discord and should not be relied on.
158
+
Bots can make <DocsLinkreference="disnake.ui.Button">buttons</DocsLink> using emojis from servers they're not members of, this may or may not be intended behaviour by Discord and should not be relied on.
162
159
:::
163
160
164
161
Here's a few ways you could filter on reactions to do various things
0 commit comments