Voice et bot modif

This commit is contained in:
pi 2026-06-16 17:09:34 +00:00
parent 189d56026b
commit 7333a22bcd
10774 changed files with 634644 additions and 933308 deletions

View file

@ -88,7 +88,7 @@ if TYPE_CHECKING:
from .abc import Messageable, PrivateChannel, Snowflake, SnowflakeTime
from .app_commands import Command, ContextMenu
from .automod import AutoModAction, AutoModRule
from .channel import DMChannel, GroupChannel
from .channel import DMChannel, GroupChannel, VoiceChannelEffect
from .ext.commands import AutoShardedBot, Bot, Context, CommandError
from .guild import GuildChannel
from .integrations import Integration
@ -340,6 +340,10 @@ class Client:
VoiceClient.warn_nacl = False
_log.warning('PyNaCl is not installed, voice will NOT be supported')
if VoiceClient.warn_dave:
VoiceClient.warn_dave = False
_log.warning('davey is not installed, voice will NOT be supported')
async def __aenter__(self) -> Self:
await self._async_setup_hook()
return self
@ -1753,6 +1757,38 @@ class Client:
timeout: Optional[float] = ...,
) -> Tuple[ScheduledEvent, User]: ...
@overload
async def wait_for(
self,
event: Literal['scheduled_event_update'],
/,
*,
check: Optional[Callable[[ScheduledEvent, ScheduledEvent], bool]] = ...,
timeout: Optional[float] = ...,
) -> Tuple[ScheduledEvent, ScheduledEvent]: ...
# Soundboard
@overload
async def wait_for(
self,
event: Literal['soundboard_sound_create', 'soundboard_sound_delete'],
/,
*,
check: Optional[Callable[[SoundboardSound], bool]] = ...,
timeout: Optional[float] = ...,
) -> SoundboardSound: ...
@overload
async def wait_for(
self,
event: Literal['soundboard_sound_update'],
/,
*,
check: Optional[Callable[[SoundboardSound, SoundboardSound], bool]] = ...,
timeout: Optional[float] = ...,
) -> Tuple[SoundboardSound, SoundboardSound]: ...
# Stages
@overload
@ -1859,6 +1895,16 @@ class Client:
timeout: Optional[float] = ...,
) -> Tuple[Member, VoiceState, VoiceState]: ...
@overload
async def wait_for(
self,
event: Literal['voice_channel_effect'],
/,
*,
check: Optional[Callable[[VoiceChannelEffect], bool]] = ...,
timeout: Optional[float] = ...,
) -> VoiceChannelEffect: ...
# Polls
@overload
@ -2511,7 +2557,7 @@ class Client:
)
return Invite.from_incomplete(state=self._connection, data=data)
async def delete_invite(self, invite: Union[Invite, str], /) -> Invite:
async def delete_invite(self, invite: Union[Invite, str], /, *, reason: Optional[str] = None) -> Invite:
"""|coro|
Revokes an :class:`.Invite`, URL, or ID to an invite.
@ -2527,6 +2573,8 @@ class Client:
----------
invite: Union[:class:`.Invite`, :class:`str`]
The invite to revoke.
reason: Optional[:class:`str`]
The reason for deleting the invite. Shows up on the audit log.
Raises
-------
@ -2539,7 +2587,7 @@ class Client:
"""
resolved = utils.resolve_invite(invite)
data = await self.http.delete_invite(resolved.code)
data = await self.http.delete_invite(resolved.code, reason=reason)
return Invite.from_incomplete(state=self._connection, data=data)
# Miscellaneous stuff