Skip to content

Commit

Permalink
Fix Context.reply attribute error
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfies committed Sep 10, 2023
1 parent e4576f0 commit eaec0ce
Showing 1 changed file with 86 additions and 0 deletions.
86 changes: 86 additions & 0 deletions discord/ext/commands/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@
Generic,
List,
Optional,
Sequence,
TypeVar,
Union,
overload,
)

import discord.abc
Expand All @@ -49,9 +51,13 @@

from discord.abc import MessageableChannel
from discord.commands import MessageCommand
from discord.file import _FileBase
from discord.guild import Guild
from discord.member import Member
from discord.mentions import AllowedMentions
from discord.message import MessageReference, PartialMessage
from discord.state import ConnectionState
from discord.sticker import GuildSticker, StickerItem
from discord.user import ClientUser, User
from discord.voice_client import VoiceProtocol

Expand Down Expand Up @@ -430,6 +436,86 @@ async def send_help(self, *args: Any) -> Any:
except CommandError as e:
await cmd.on_help_command_error(self, e)

@overload
async def reply(
self,
content: Optional[str] = ...,
*,
tts: bool = ...,
file: _FileBase = ...,
stickers: Sequence[Union[GuildSticker, StickerItem]] = ...,
delete_after: float = ...,
nonce: Union[str, int] = ...,
allowed_mentions: AllowedMentions = ...,
reference: Union[Message, MessageReference, PartialMessage] = ...,
mention_author: bool = ...,
suppress_embeds: bool = ...,
ephemeral: bool = ...,
silent: bool = ...,
) -> Message:
...

@overload
async def reply(
self,
content: Optional[str] = ...,
*,
tts: bool = ...,
files: Sequence[_FileBase] = ...,
stickers: Sequence[Union[GuildSticker, StickerItem]] = ...,
delete_after: float = ...,
nonce: Union[str, int] = ...,
allowed_mentions: AllowedMentions = ...,
reference: Union[Message, MessageReference, PartialMessage] = ...,
mention_author: bool = ...,
suppress_embeds: bool = ...,
ephemeral: bool = ...,
silent: bool = ...,
) -> Message:
...

@overload
async def reply(
self,
content: Optional[str] = ...,
*,
tts: bool = ...,
file: _FileBase = ...,
stickers: Sequence[Union[GuildSticker, StickerItem]] = ...,
delete_after: float = ...,
nonce: Union[str, int] = ...,
allowed_mentions: AllowedMentions = ...,
reference: Union[Message, MessageReference, PartialMessage] = ...,
mention_author: bool = ...,
suppress_embeds: bool = ...,
ephemeral: bool = ...,
silent: bool = ...,
) -> Message:
...

@overload
async def reply(
self,
content: Optional[str] = ...,
*,
tts: bool = ...,
files: Sequence[_FileBase] = ...,
stickers: Sequence[Union[GuildSticker, StickerItem]] = ...,
delete_after: float = ...,
nonce: Union[str, int] = ...,
allowed_mentions: AllowedMentions = ...,
reference: Union[Message, MessageReference, PartialMessage] = ...,
mention_author: bool = ...,
suppress_embeds: bool = ...,
ephemeral: bool = ...,
silent: bool = ...,
) -> Message:
...

@discord.utils.copy_doc(Message.reply)
async def reply(self, content: Optional[str] = None, **kwargs: Any) -> Message:
return await self.message.reply(content, **kwargs)

@discord.utils.copy_doc(Message.message_commands)
def message_commands(
self,
Expand Down

0 comments on commit eaec0ce

Please sign in to comment.