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: docs/src/Guides/05 Components.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -136,7 +136,7 @@ These have the downside that, for example, they won't work anymore after restart
136
136
137
137
Otherwise, you are looking for a persistent callback. For that, you want to define `custom_id` in your component creation.
138
138
139
-
When responding to a component you need to satisfy discord either by responding to the context with `ctx.send()` or by editing the component with `ctx.edit_origin()`. You get access to the context with `component.context`.
139
+
When responding to a component you need to satisfy discord either by responding to the context with `ctx.send()` or by editing the component with `ctx.edit_origin()`. You get access to the context with `component.ctx`.
140
140
141
141
=== ":one:`bot.wait_for_component()`"
142
142
As with discord.py, this supports checks and timeouts.
@@ -154,7 +154,7 @@ When responding to a component you need to satisfy discord either by responding
154
154
155
155
# define the check
156
156
def check(component: Button) -> bool:
157
-
return component.context.author.startswith("a")
157
+
return component.ctx.author.startswith("a")
158
158
159
159
try:
160
160
# you need to pass the component you want to listen for here
@@ -168,7 +168,7 @@ When responding to a component you need to satisfy discord either by responding
168
168
await message.edit(components=components)
169
169
170
170
else:
171
-
await used_component.context.send("Your name starts with 'a'")
171
+
await used_component.ctx.send("Your name starts with 'a'")
172
172
```
173
173
174
174
You can also use this to check for a normal message instead of a component interaction.
@@ -191,7 +191,7 @@ When responding to a component you need to satisfy discord either by responding
0 commit comments