Skip to content

Commit 0846c09

Browse files
authored
Merge branch 'Pycord-Development:master' into master
2 parents 5d824f7 + 8aa1e90 commit 0846c09

File tree

4 files changed

+43
-11
lines changed

4 files changed

+43
-11
lines changed

discord/embeds.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,22 @@ def set_image(self: E, *, url: MaybeEmpty[Any]) -> E:
424424

425425
return self
426426

427+
def remove_image(self: E) -> E:
428+
"""Removes the embed's image.
429+
430+
This function returns the class instance to allow for fluent-style
431+
chaining.
432+
433+
.. versionadded:: 2.0
434+
"""
435+
try:
436+
del self._image
437+
except AttributeError:
438+
pass
439+
440+
return self
441+
442+
427443
@property
428444
def thumbnail(self) -> _EmbedMediaProxy:
429445
"""Returns an ``EmbedProxy`` denoting the thumbnail contents.
@@ -466,6 +482,21 @@ def set_thumbnail(self: E, *, url: MaybeEmpty[Any]) -> E:
466482

467483
return self
468484

485+
def remove_thumbnail(self: E) -> E:
486+
"""Removes the embed's thumbnail.
487+
488+
This function returns the class instance to allow for fluent-style
489+
chaining.
490+
491+
.. versionadded:: 2.0
492+
"""
493+
try:
494+
del self._thumbnail
495+
except AttributeError:
496+
pass
497+
498+
return self
499+
469500
@property
470501
def video(self) -> _EmbedVideoProxy:
471502
"""Returns an ``EmbedProxy`` denoting the video contents.

discord/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,5 +355,5 @@ class ExtensionNotFound(ExtensionError):
355355
The extension that had the error.
356356
"""
357357
def __init__(self, name: str) -> None:
358-
msg = f'Extension {name!r} could not be loaded.'
358+
msg = f'Extension {name!r} could not be found.'
359359
super().__init__(msg, name=name)

examples/app_commands/slash_basic.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,27 @@
22

33
bot = discord.Bot()
44

5-
# If you use commands.Bot, @bot.slash_command should be used for
6-
# slash commands. You can use @bot.slash_command with discord.Bot aswell
5+
# Note: If you want you can use commands.Bot instead of discord.Bot
6+
# Use discord.Bot if you don't want prefixed message commands
77

8+
# With discord.Bot you can use @bot.command as an alias
9+
# of @bot.slash_command but this is overriden by commands.Bot
810

9-
@bot.command(guild_ids=[...]) # create a slash command for the supplied guilds
11+
12+
@bot.slash_command(guild_ids=[...]) # create a slash command for the supplied guilds
1013
async def hello(ctx):
1114
"""Say hello to the bot""" # the command description can be supplied as the docstring
1215
await ctx.send(f"Hello {ctx.author}!")
1316

1417

15-
@bot.command(
18+
@bot.slash_command(
1619
name="hi"
1720
) # Not passing in guild_ids creates a global slash command (might take an hour to register)
1821
async def global_command(ctx, num: int): # Takes one integer parameter
1922
await ctx.send(f"This is a global command, {num}!")
2023

2124

22-
@bot.command(guild_ids=[...])
25+
@bot.slash_command(guild_ids=[...])
2326
async def joined(
2427
ctx, member: discord.Member = None
2528
): # Passing a default value makes the argument optional

examples/app_commands/slash_options.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33

44
bot = discord.Bot()
55

6-
# If you use commands.Bot, @bot.slash_command should be used for
7-
# slash commands. You can use @bot.slash_command with discord.Bot aswell
8-
9-
10-
@bot.command(guild_ids=[...])
6+
@bot.slash_command(guild_ids=[...])
117
async def hello(
128
ctx,
139
name: Option(str, "Enter your name"),
1410
gender: Option(str, "Choose your gender", choices=["Male", "Female", "Other"]),
1511
age: Option(int, "Enter your age", required=False, default=18),
1612
):
1713
await ctx.send(f"Hello {name}")
14+
15+
bot.run('TOKEN')

0 commit comments

Comments
 (0)