Skip to content
This repository was archived by the owner on Mar 8, 2022. It is now read-only.

Commit ae509c7

Browse files
committed
Merge branch 'main' of https://github.com/discord-py-ui/discord-ui into main
2 parents fd89bf9 + 50998f1 commit ae509c7

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,6 @@ dmypy.json
130130

131131
# visual studio
132132
.vscode/
133-
.vs/
133+
.vs/
134+
135+
internal/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ async def command(ctx, cool=True):
7272
# you can use docstrings for the slash command description too
7373
await ctx.respond("You said this libary is " + str(cool))
7474

75-
await client.run("your_token")
75+
client.run("your_token")
7676
```
7777

7878
Example for creating a user-context command

discord_ui/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@
4444

4545

4646
__title__ = "discord-ui"
47-
__version__ = "4.2.2"
47+
__version__ = "4.2.4"

discord_ui/override.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,13 @@ def override_dpy():
3939

4040
#region message override
4141
async def send(self: discord.TextChannel, content=None, **kwargs) -> Message:
42-
4342
channel_id = self.id if not isinstance(self, commands.Context) else self.channel.id
43+
44+
if isinstance(self, discord.Member) or isinstance(self, discord.User):
45+
if self.dm_channel == None:
46+
dm_chnl = await self.create_dm()
47+
channel_id = dm_chnl.id
48+
4449
route = BetterRoute("POST", f"/channels/{channel_id}/messages")
4550

4651
r = None

0 commit comments

Comments
 (0)