Skip to content

Commit c74c2a9

Browse files
committed
Update migrate_to_109.rst
1 parent df308da commit c74c2a9

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

docs/migrate_to_109.rst

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@ This page will show how to deal with those changes.
99
SlashContext
1010
************
1111

12-
.send()
13-
-------
12+
.send() / .delete() / .edit()
13+
-----------------------------
1414

1515
Before:
1616

1717
.. code-block:: python
1818
1919
# Case 1
2020
await ctx.send(4, content="Hello, World! This is initial message.")
21+
await ctx.edit(content="Or nevermind.")
2122
await ctx.delete()
2223
await ctx.send(content="This is followup message.")
2324
@@ -31,9 +32,31 @@ After:
3132
# Case 1
3233
await ctx.respond()
3334
msg = await ctx.send("Hello, World! This is initial message.")
35+
await msg.edit(content="Or nevermind.")
3436
await msg.delete()
3537
await ctx.send("This is followup message.")
3638
3739
# Case 2
3840
await ctx.respond(eat=True)
3941
await ctx.send("This is secret message.", hidden=True)
42+
43+
Objects of the command invoke
44+
-----------------------------
45+
46+
Before:
47+
48+
.. code-block:: python
49+
50+
author_id = ctx.author.id if isinstance(ctx.author, discord.Member) else ctx.author
51+
channel_id = ctx.channel.id if isinstance(ctx.channel, discord.TextChannel) else ctx.channel
52+
guild_id = ctx.guild.id if isinstance(ctx.guild, discord.Guild) else ctx.guild
53+
...
54+
55+
After:
56+
57+
.. code-block:: python
58+
59+
author_id = ctx.author_id
60+
channel_id = ctx.channel_id
61+
guild_id = ctx.guild_id
62+
...

0 commit comments

Comments
 (0)