From 29461ddb5f67936509a462ab0ffa0e9e4ee4d7bd Mon Sep 17 00:00:00 2001 From: Puncher <65789180+Puncher1@users.noreply.github.com> Date: Sat, 25 Feb 2023 08:44:44 +0100 Subject: [PATCH 001/473] Change max values in AutoModTrigger attributes docs --- discord/automod.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/discord/automod.py b/discord/automod.py index c90e80389..cbf3a0012 100644 --- a/discord/automod.py +++ b/discord/automod.py @@ -139,13 +139,13 @@ class AutoModTrigger: The type of trigger. keyword_filter: List[:class:`str`] The list of strings that will trigger the keyword filter. Maximum of 1000. - Keywords can only be up to 30 characters in length. + Keywords can only be up to 60 characters in length. This could be combined with :attr:`regex_patterns`. regex_patterns: List[:class:`str`] The regex pattern that will trigger the filter. The syntax is based off of `Rust's regex syntax `_. - Maximum of 10. Regex strings can only be up to 250 characters in length. + Maximum of 10. Regex strings can only be up to 260 characters in length. This could be combined with :attr:`keyword_filter` and/or :attr:`allow_list` @@ -153,7 +153,8 @@ class AutoModTrigger: presets: :class:`AutoModPresets` The presets used with the preset keyword filter. allow_list: List[:class:`str`] - The list of words that are exempt from the commonly flagged words. + The list of words that are exempt from the commonly flagged words. Maximum of 100. + Keywords can only be up to 60 characters in length. mention_limit: :class:`int` The total number of user and role mentions a message can contain. Has a maximum of 50. From da4651c97c438d9525b5dad4b73a61d407e2ab48 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 25 Feb 2023 03:13:55 -0500 Subject: [PATCH 002/473] Implement Messageable for StageChannel Fix #9248 --- discord/abc.py | 14 +++- discord/channel.py | 205 +++++++++++++++++++++++---------------------- discord/message.py | 3 +- 3 files changed, 119 insertions(+), 103 deletions(-) diff --git a/discord/abc.py b/discord/abc.py index 6e3125f40..65db6d28c 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -83,7 +83,15 @@ if TYPE_CHECKING: from .channel import CategoryChannel from .embeds import Embed from .message import Message, MessageReference, PartialMessage - from .channel import TextChannel, DMChannel, GroupChannel, PartialMessageable, VoiceChannel + from .channel import ( + TextChannel, + DMChannel, + GroupChannel, + PartialMessageable, + VocalGuildChannel, + VoiceChannel, + StageChannel, + ) from .threads import Thread from .enums import InviteTarget from .ui.view import View @@ -97,7 +105,7 @@ if TYPE_CHECKING: SnowflakeList, ) - PartialMessageableChannel = Union[TextChannel, VoiceChannel, Thread, DMChannel, PartialMessageable] + PartialMessageableChannel = Union[TextChannel, VoiceChannel, StageChannel, Thread, DMChannel, PartialMessageable] MessageableChannel = Union[PartialMessageableChannel, GroupChannel] SnowflakeTime = Union["Snowflake", datetime] @@ -118,7 +126,7 @@ async def _single_delete_strategy(messages: Iterable[Message], *, reason: Option async def _purge_helper( - channel: Union[Thread, TextChannel, VoiceChannel], + channel: Union[Thread, TextChannel, VocalGuildChannel], *, limit: Optional[int] = 100, check: Callable[[Message], bool] = MISSING, diff --git a/discord/channel.py b/discord/channel.py index 8aecf7838..4e955a6ae 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -878,7 +878,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): before_timestamp = update_before(threads[-1]) -class VocalGuildChannel(discord.abc.Connectable, discord.abc.GuildChannel, Hashable): +class VocalGuildChannel(discord.abc.Messageable, discord.abc.Connectable, discord.abc.GuildChannel, Hashable): __slots__ = ( 'name', 'id', @@ -901,6 +901,9 @@ class VocalGuildChannel(discord.abc.Connectable, discord.abc.GuildChannel, Hasha self.id: int = int(data['id']) self._update(guild, data) + async def _get_channel(self) -> Self: + return self + def _get_voice_client_key(self) -> Tuple[int, str]: return self.guild.id, 'guild_id' @@ -988,103 +991,6 @@ class VocalGuildChannel(discord.abc.Connectable, discord.abc.GuildChannel, Hasha base.value &= ~denied.value return base - -class VoiceChannel(discord.abc.Messageable, VocalGuildChannel): - """Represents a Discord guild voice channel. - - .. container:: operations - - .. describe:: x == y - - Checks if two channels are equal. - - .. describe:: x != y - - Checks if two channels are not equal. - - .. describe:: hash(x) - - Returns the channel's hash. - - .. describe:: str(x) - - Returns the channel's name. - - Attributes - ----------- - name: :class:`str` - The channel name. - guild: :class:`Guild` - The guild the channel belongs to. - id: :class:`int` - The channel ID. - nsfw: :class:`bool` - If the channel is marked as "not safe for work" or "age restricted". - - .. versionadded:: 2.0 - category_id: Optional[:class:`int`] - The category channel ID this channel belongs to, if applicable. - position: :class:`int` - The position in the channel list. This is a number that starts at 0. e.g. the - top channel is position 0. - bitrate: :class:`int` - The channel's preferred audio bitrate in bits per second. - user_limit: :class:`int` - The channel's limit for number of members that can be in a voice channel. - rtc_region: Optional[:class:`str`] - The region for the voice channel's voice communication. - A value of ``None`` indicates automatic voice region detection. - - .. versionadded:: 1.7 - - .. versionchanged:: 2.0 - The type of this attribute has changed to :class:`str`. - video_quality_mode: :class:`VideoQualityMode` - The camera video quality for the voice channel's participants. - - .. versionadded:: 2.0 - last_message_id: Optional[:class:`int`] - The last message ID of the message sent to this channel. It may - *not* point to an existing or valid message. - - .. versionadded:: 2.0 - slowmode_delay: :class:`int` - The number of seconds a member must wait between sending messages - in this channel. A value of ``0`` denotes that it is disabled. - Bots and users with :attr:`~Permissions.manage_channels` or - :attr:`~Permissions.manage_messages` bypass slowmode. - - .. versionadded:: 2.2 - """ - - __slots__ = () - - def __repr__(self) -> str: - attrs = [ - ('id', self.id), - ('name', self.name), - ('rtc_region', self.rtc_region), - ('position', self.position), - ('bitrate', self.bitrate), - ('video_quality_mode', self.video_quality_mode), - ('user_limit', self.user_limit), - ('category_id', self.category_id), - ] - joined = ' '.join('%s=%r' % t for t in attrs) - return f'<{self.__class__.__name__} {joined}>' - - async def _get_channel(self) -> Self: - return self - - @property - def _scheduled_event_entity_type(self) -> Optional[EntityType]: - return EntityType.voice - - @property - def type(self) -> Literal[ChannelType.voice]: - """:class:`ChannelType`: The channel's Discord type.""" - return ChannelType.voice - @property def last_message(self) -> Optional[Message]: """Retrieves the last message from this channel in cache. @@ -1129,7 +1035,7 @@ class VoiceChannel(discord.abc.Messageable, VocalGuildChannel): from .message import PartialMessage - return PartialMessage(channel=self, id=message_id) + return PartialMessage(channel=self, id=message_id) # type: ignore # VocalGuildChannel is an impl detail async def delete_messages(self, messages: Iterable[Snowflake], *, reason: Optional[str] = None) -> None: """|coro| @@ -1332,6 +1238,100 @@ class VoiceChannel(discord.abc.Messageable, VocalGuildChannel): data = await self._state.http.create_webhook(self.id, name=str(name), avatar=avatar, reason=reason) return Webhook.from_state(data, state=self._state) + +class VoiceChannel(VocalGuildChannel): + """Represents a Discord guild voice channel. + + .. container:: operations + + .. describe:: x == y + + Checks if two channels are equal. + + .. describe:: x != y + + Checks if two channels are not equal. + + .. describe:: hash(x) + + Returns the channel's hash. + + .. describe:: str(x) + + Returns the channel's name. + + Attributes + ----------- + name: :class:`str` + The channel name. + guild: :class:`Guild` + The guild the channel belongs to. + id: :class:`int` + The channel ID. + nsfw: :class:`bool` + If the channel is marked as "not safe for work" or "age restricted". + + .. versionadded:: 2.0 + category_id: Optional[:class:`int`] + The category channel ID this channel belongs to, if applicable. + position: :class:`int` + The position in the channel list. This is a number that starts at 0. e.g. the + top channel is position 0. + bitrate: :class:`int` + The channel's preferred audio bitrate in bits per second. + user_limit: :class:`int` + The channel's limit for number of members that can be in a voice channel. + rtc_region: Optional[:class:`str`] + The region for the voice channel's voice communication. + A value of ``None`` indicates automatic voice region detection. + + .. versionadded:: 1.7 + + .. versionchanged:: 2.0 + The type of this attribute has changed to :class:`str`. + video_quality_mode: :class:`VideoQualityMode` + The camera video quality for the voice channel's participants. + + .. versionadded:: 2.0 + last_message_id: Optional[:class:`int`] + The last message ID of the message sent to this channel. It may + *not* point to an existing or valid message. + + .. versionadded:: 2.0 + slowmode_delay: :class:`int` + The number of seconds a member must wait between sending messages + in this channel. A value of ``0`` denotes that it is disabled. + Bots and users with :attr:`~Permissions.manage_channels` or + :attr:`~Permissions.manage_messages` bypass slowmode. + + .. versionadded:: 2.2 + """ + + __slots__ = () + + def __repr__(self) -> str: + attrs = [ + ('id', self.id), + ('name', self.name), + ('rtc_region', self.rtc_region), + ('position', self.position), + ('bitrate', self.bitrate), + ('video_quality_mode', self.video_quality_mode), + ('user_limit', self.user_limit), + ('category_id', self.category_id), + ] + joined = ' '.join('%s=%r' % t for t in attrs) + return f'<{self.__class__.__name__} {joined}>' + + @property + def _scheduled_event_entity_type(self) -> Optional[EntityType]: + return EntityType.voice + + @property + def type(self) -> Literal[ChannelType.voice]: + """:class:`ChannelType`: The channel's Discord type.""" + return ChannelType.voice + @utils.copy_doc(discord.abc.GuildChannel.clone) async def clone(self, *, name: Optional[str] = None, reason: Optional[str] = None) -> VoiceChannel: return await self._clone_impl({'bitrate': self.bitrate, 'user_limit': self.user_limit}, name=name, reason=reason) @@ -1358,6 +1358,7 @@ class VoiceChannel(discord.abc.Messageable, VocalGuildChannel): overwrites: Mapping[OverwriteKeyT, PermissionOverwrite] = ..., rtc_region: Optional[str] = ..., video_quality_mode: VideoQualityMode = ..., + slowmode_delay: int = ..., reason: Optional[str] = ..., ) -> VoiceChannel: ... @@ -1492,6 +1493,11 @@ class StageChannel(VocalGuildChannel): The camera video quality for the stage channel's participants. .. versionadded:: 2.0 + last_message_id: Optional[:class:`int`] + The last message ID of the message sent to this channel. It may + *not* point to an existing or valid message. + + .. versionadded:: 2.2 slowmode_delay: :class:`int` The number of seconds a member must wait between sending messages in this channel. A value of ``0`` denotes that it is disabled. @@ -1665,6 +1671,7 @@ class StageChannel(VocalGuildChannel): overwrites: Mapping[OverwriteKeyT, PermissionOverwrite] = ..., rtc_region: Optional[str] = ..., video_quality_mode: VideoQualityMode = ..., + slowmode_delay: int = ..., reason: Optional[str] = ..., ) -> StageChannel: ... diff --git a/discord/message.py b/discord/message.py index 06cd9e3af..a73e882d3 100644 --- a/discord/message.py +++ b/discord/message.py @@ -737,6 +737,7 @@ class PartialMessage(Hashable): if not isinstance(channel, PartialMessageable) and channel.type not in ( ChannelType.text, ChannelType.voice, + ChannelType.stage_voice, ChannelType.news, ChannelType.private, ChannelType.news_thread, @@ -744,7 +745,7 @@ class PartialMessage(Hashable): ChannelType.private_thread, ): raise TypeError( - f'expected PartialMessageable, TextChannel, VoiceChannel, DMChannel or Thread not {type(channel)!r}' + f'expected PartialMessageable, TextChannel, StageChannel, VoiceChannel, DMChannel or Thread not {type(channel)!r}' ) self.channel: MessageableChannel = channel From fd9f3e9eff86ea9130b83eb3ff568cc20fdda59e Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 25 Feb 2023 03:27:04 -0500 Subject: [PATCH 003/473] Update docs with references to text in stage --- discord/abc.py | 1 + discord/message.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/discord/abc.py b/discord/abc.py index 65db6d28c..c6b63920f 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -1292,6 +1292,7 @@ class Messageable: - :class:`~discord.TextChannel` - :class:`~discord.VoiceChannel` + - :class:`~discord.StageChannel` - :class:`~discord.DMChannel` - :class:`~discord.GroupChannel` - :class:`~discord.PartialMessageable` diff --git a/discord/message.py b/discord/message.py index a73e882d3..2acc50278 100644 --- a/discord/message.py +++ b/discord/message.py @@ -700,6 +700,7 @@ class PartialMessage(Hashable): - :meth:`TextChannel.get_partial_message` - :meth:`VoiceChannel.get_partial_message` + - :meth:`StageChannel.get_partial_message` - :meth:`Thread.get_partial_message` - :meth:`DMChannel.get_partial_message` @@ -723,7 +724,7 @@ class PartialMessage(Hashable): Attributes ----------- - channel: Union[:class:`PartialMessageable`, :class:`TextChannel`, :class:`VoiceChannel`, :class:`Thread`, :class:`DMChannel`] + channel: Union[:class:`PartialMessageable`, :class:`TextChannel`, :class:`StageChannel`, :class:`VoiceChannel`, :class:`Thread`, :class:`DMChannel`] The channel associated with this partial message. id: :class:`int` The message ID. @@ -1358,7 +1359,7 @@ class Message(PartialMessage, Hashable): A list of embeds the message has. If :attr:`Intents.message_content` is not enabled this will always be an empty list unless the bot is mentioned or the message is a direct message. - channel: Union[:class:`TextChannel`, :class:`VoiceChannel`, :class:`Thread`, :class:`DMChannel`, :class:`GroupChannel`, :class:`PartialMessageable`] + channel: Union[:class:`TextChannel`, :class:`StageChannel`, :class:`VoiceChannel`, :class:`Thread`, :class:`DMChannel`, :class:`GroupChannel`, :class:`PartialMessageable`] The :class:`TextChannel` or :class:`Thread` that the message was sent from. Could be a :class:`DMChannel` or :class:`GroupChannel` if it's a private message. reference: Optional[:class:`~discord.MessageReference`] From 517d7ae4fe352b795c9c7e3717f5e6fca1230a5c Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 25 Feb 2023 06:05:16 -0500 Subject: [PATCH 004/473] Avoid converting target_id if it's None --- discord/audit_logs.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/discord/audit_logs.py b/discord/audit_logs.py index 72cf8f854..fe51b6106 100644 --- a/discord/audit_logs.py +++ b/discord/audit_logs.py @@ -723,11 +723,12 @@ class AuditLogEntry(Hashable): if self.action.target_type is None: return None + if self._target_id is None: + return None + try: converter = getattr(self, '_convert_target_' + self.action.target_type) except AttributeError: - if self._target_id is None: - return None return Object(id=self._target_id) else: return converter(self._target_id) From 90d50bef1fa7ce63191d0e0a8b64038738d3b929 Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 26 Feb 2023 18:26:26 +1000 Subject: [PATCH 005/473] Add custom_message to automod block_message aciton --- discord/automod.py | 28 +++++++++++++++++++++------- discord/types/automod.py | 6 +++++- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/discord/automod.py b/discord/automod.py index cbf3a0012..b34bec000 100644 --- a/discord/automod.py +++ b/discord/automod.py @@ -27,7 +27,6 @@ import datetime from typing import TYPE_CHECKING, Any, Dict, Optional, List, Sequence, Set, Union, Sequence - from .enums import AutoModRuleTriggerType, AutoModRuleActionType, AutoModRuleEventType, try_enum from .flags import AutoModPresets from . import utils @@ -73,15 +72,28 @@ class AutoModRuleAction: The duration of the timeout to apply, if any. Has a maximum of 28 days. Passing this sets :attr:`type` to :attr:`~AutoModRuleActionType.timeout`. + custom_message: Optional[:class:`str`] + A custom message which will be shown to a user when their message is blocked. + Passing this sets :attr:`type` to :attr:`~AutoModRuleActionType.block_message`. + + .. versionadded:: 2.2 """ - __slots__ = ('type', 'channel_id', 'duration') + __slots__ = ('type', 'channel_id', 'duration', 'custom_message') - def __init__(self, *, channel_id: Optional[int] = None, duration: Optional[datetime.timedelta] = None) -> None: + def __init__( + self, + *, + channel_id: Optional[int] = None, + duration: Optional[datetime.timedelta] = None, + custom_message: Optional[str] = None, + ) -> None: self.channel_id: Optional[int] = channel_id self.duration: Optional[datetime.timedelta] = duration - if channel_id and duration: - raise ValueError('Please provide only one of ``channel`` or ``duration``') + self.custom_message: Optional[str] = custom_message + + if sum(v is None for v in (channel_id, duration, custom_message)) < 2: + raise ValueError('Only one of channel_id, duration, or custom_message can be passed.') if channel_id: self.type = AutoModRuleActionType.send_alert_message @@ -102,11 +114,13 @@ class AutoModRuleAction: elif data['type'] == AutoModRuleActionType.send_alert_message.value: channel_id = int(data['metadata']['channel_id']) return cls(channel_id=channel_id) - return cls() + return cls(custom_message=data.get('metadata', {}).get('custom_message')) def to_dict(self) -> Dict[str, Any]: ret = {'type': self.type.value, 'metadata': {}} - if self.type is AutoModRuleActionType.timeout: + if self.type is AutoModRuleActionType.block_message and self.custom_message is not None: + ret['metadata'] = {'custom_message': self.custom_message} + elif self.type is AutoModRuleActionType.timeout: ret['metadata'] = {'duration_seconds': int(self.duration.total_seconds())} # type: ignore # duration cannot be None here elif self.type is AutoModRuleActionType.send_alert_message: ret['metadata'] = {'channel_id': str(self.channel_id)} diff --git a/discord/types/automod.py b/discord/types/automod.py index 250d1e41e..9b0b13692 100644 --- a/discord/types/automod.py +++ b/discord/types/automod.py @@ -45,9 +45,13 @@ class _AutoModerationActionMetadataTimeout(TypedDict): duration_seconds: int +class _AutoModerationActionMetadataCustomMessage(TypedDict): + custom_message: str + + class _AutoModerationActionBlockMessage(TypedDict): type: Literal[1] - metadata: NotRequired[Empty] + metadata: NotRequired[_AutoModerationActionMetadataCustomMessage] class _AutoModerationActionAlert(TypedDict): From 6af6f824110e93a9f096df20c1fbdb6485b40348 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 27 Feb 2023 21:15:28 +1000 Subject: [PATCH 006/473] Fix audit log pagination logic --- discord/guild.py | 15 ++++++--------- discord/http.py | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/discord/guild.py b/discord/guild.py index 078a7b8be..96bd1801b 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -3630,7 +3630,7 @@ class Guild(Hashable): if limit is not None: limit -= len(entries) - after = Object(id=int(entries[0]['id'])) + after = Object(id=int(entries[-1]['id'])) return data, entries, after, limit @@ -3647,20 +3647,19 @@ class Guild(Hashable): if isinstance(after, datetime.datetime): after = Object(id=utils.time_snowflake(after, high=True)) - if oldest_first is MISSING: - reverse = after is not MISSING - else: - reverse = oldest_first + if oldest_first: + if after is MISSING: + after = OLDEST_OBJECT predicate = None - if reverse: + if oldest_first: strategy, state = _after_strategy, after if before: predicate = lambda m: int(m['id']) < before.id else: strategy, state = _before_strategy, before - if after and after != OLDEST_OBJECT: + if after: predicate = lambda m: int(m['id']) > after.id # avoid circular import @@ -3673,8 +3672,6 @@ class Guild(Hashable): data, raw_entries, state, limit = await strategy(retrieve, state, limit) - if reverse: - raw_entries = reversed(raw_entries) if predicate: raw_entries = filter(predicate, raw_entries) diff --git a/discord/http.py b/discord/http.py index 5913f4911..3fa622967 100644 --- a/discord/http.py +++ b/discord/http.py @@ -1717,7 +1717,7 @@ class HTTPClient: params: Dict[str, Any] = {'limit': limit} if before: params['before'] = before - if after: + if after is not None: params['after'] = after if user_id: params['user_id'] = user_id From 8f86170767bdce8eb9ddce8c9fbe89c96bb548d6 Mon Sep 17 00:00:00 2001 From: z03h <7235242+z03h@users.noreply.github.com> Date: Mon, 27 Feb 2023 03:18:13 -0800 Subject: [PATCH 007/473] Don't require some args for ScheduledEvent.edit --- discord/scheduled_event.py | 109 ++++++++++++++++++++++++++++++++++--- 1 file changed, 101 insertions(+), 8 deletions(-) diff --git a/discord/scheduled_event.py b/discord/scheduled_event.py index 9f8bd9920..810ea2b2a 100644 --- a/discord/scheduled_event.py +++ b/discord/scheduled_event.py @@ -25,7 +25,7 @@ DEALINGS IN THE SOFTWARE. from __future__ import annotations from datetime import datetime -from typing import TYPE_CHECKING, AsyncIterator, Dict, Optional, Union +from typing import TYPE_CHECKING, AsyncIterator, Dict, Optional, Union, overload, Literal from .asset import Asset from .enums import EventStatus, EntityType, PrivacyLevel, try_enum @@ -298,6 +298,87 @@ class ScheduledEvent(Hashable): return await self.__modify_status(EventStatus.cancelled, reason) + @overload + async def edit( + self, + *, + name: str = ..., + description: str = ..., + start_time: datetime = ..., + end_time: Optional[datetime] = ..., + privacy_level: PrivacyLevel = ..., + status: EventStatus = ..., + image: bytes = ..., + reason: Optional[str] = ..., + ) -> ScheduledEvent: + ... + + @overload + async def edit( + self, + *, + name: str = ..., + description: str = ..., + channel: Snowflake, + start_time: datetime = ..., + end_time: Optional[datetime] = ..., + privacy_level: PrivacyLevel = ..., + entity_type: Literal[EntityType.voice, EntityType.stage_instance], + status: EventStatus = ..., + image: bytes = ..., + reason: Optional[str] = ..., + ) -> ScheduledEvent: + ... + + @overload + async def edit( + self, + *, + name: str = ..., + description: str = ..., + start_time: datetime = ..., + end_time: datetime = ..., + privacy_level: PrivacyLevel = ..., + entity_type: Literal[EntityType.external], + status: EventStatus = ..., + image: bytes = ..., + location: str, + reason: Optional[str] = ..., + ) -> ScheduledEvent: + ... + + @overload + async def edit( + self, + *, + name: str = ..., + description: str = ..., + channel: Union[VoiceChannel, StageChannel], + start_time: datetime = ..., + end_time: Optional[datetime] = ..., + privacy_level: PrivacyLevel = ..., + status: EventStatus = ..., + image: bytes = ..., + reason: Optional[str] = ..., + ) -> ScheduledEvent: + ... + + @overload + async def edit( + self, + *, + name: str = ..., + description: str = ..., + start_time: datetime = ..., + end_time: datetime = ..., + privacy_level: PrivacyLevel = ..., + status: EventStatus = ..., + image: bytes = ..., + location: str, + reason: Optional[str] = ..., + ) -> ScheduledEvent: + ... + async def edit( self, *, @@ -414,6 +495,15 @@ class ScheduledEvent(Hashable): payload['image'] = image_as_str entity_type = entity_type or getattr(channel, '_scheduled_event_entity_type', MISSING) + if entity_type is MISSING: + if channel and isinstance(channel, Object): + if channel.type is VoiceChannel: + entity_type = EntityType.voice + elif channel.type is StageChannel: + entity_type = EntityType.stage_instance + elif location not in (MISSING, None): + entity_type = EntityType.external + if entity_type is None: raise TypeError( f'invalid GuildChannel type passed, must be VoiceChannel or StageChannel not {channel.__class__.__name__}' @@ -426,12 +516,14 @@ class ScheduledEvent(Hashable): payload['entity_type'] = entity_type.value _entity_type = entity_type or self.entity_type + _entity_type_changed = _entity_type is not self.entity_type if _entity_type in (EntityType.stage_instance, EntityType.voice): if channel is MISSING or channel is None: - raise TypeError('channel must be set when entity_type is voice or stage_instance') - - payload['channel_id'] = channel.id + if _entity_type_changed: + raise TypeError('channel must be set when entity_type is voice or stage_instance') + else: + payload['channel_id'] = channel.id if location not in (MISSING, None): raise TypeError('location cannot be set when entity_type is voice or stage_instance') @@ -442,11 +534,12 @@ class ScheduledEvent(Hashable): payload['channel_id'] = None if location is MISSING or location is None: - raise TypeError('location must be set when entity_type is external') - - metadata['location'] = location + if _entity_type_changed: + raise TypeError('location must be set when entity_type is external') + else: + metadata['location'] = location - if end_time is MISSING or end_time is None: + if not self.end_time and (end_time is MISSING or end_time is None): raise TypeError('end_time must be set when entity_type is external') if end_time is not MISSING: From ef4240dcd70f532ca8477de294394883fb9dfbe1 Mon Sep 17 00:00:00 2001 From: Willy <19799671+Willy-C@users.noreply.github.com> Date: Mon, 27 Feb 2023 06:19:17 -0500 Subject: [PATCH 008/473] [commands] Add missing command decorator to example --- docs/ext/commands/commands.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/ext/commands/commands.rst b/docs/ext/commands/commands.rst index e479c4b08..02a9ae670 100644 --- a/docs/ext/commands/commands.rst +++ b/docs/ext/commands/commands.rst @@ -1147,6 +1147,7 @@ If you want a more robust error system, you can derive from the exception and ra return True return commands.check(predicate) + @bot.command() @guild_only() async def test(ctx): await ctx.send('Hey this is not a DM! Nice.') From bd6bbdab007e0ac8b21fbdae9c91f2d1e981eaa2 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 27 Feb 2023 09:17:40 -0500 Subject: [PATCH 009/473] Add support for stage message types --- discord/enums.py | 10 +++++----- discord/message.py | 15 +++++++++++++++ docs/api.rst | 25 +++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/discord/enums.py b/discord/enums.py index 43ae5b4f7..21a38caf8 100644 --- a/discord/enums.py +++ b/discord/enums.py @@ -234,11 +234,11 @@ class MessageType(Enum): auto_moderation_action = 24 role_subscription_purchase = 25 interaction_premium_upsell = 26 - # stage_start = 27 - # stage_end = 28 - # stage_speaker = 29 - # stage_raise_hand = 30 - # stage_topic = 31 + stage_start = 27 + stage_end = 28 + stage_speaker = 29 + stage_raise_hand = 30 + stage_topic = 31 guild_application_premium_subscription = 32 diff --git a/discord/message.py b/discord/message.py index 2acc50278..719cb9697 100644 --- a/discord/message.py +++ b/discord/message.py @@ -2017,6 +2017,21 @@ class Message(PartialMessage, Hashable): months = '1 month' if total_months == 1 else f'{total_months} months' return f'{self.author.name} joined {self.role_subscription.tier_name} and has been a subscriber of {self.guild} for {months}!' + if self.type is MessageType.stage_start: + return f'{self.author.name} started **{self.content}**.' + + if self.type is MessageType.stage_end: + return f'{self.author.name} ended **{self.content}**.' + + if self.type is MessageType.stage_speaker: + return f'{self.author.name} is now a speaker.' + + if self.type is MessageType.stage_raise_hand: + return f'{self.author.name} requested to speak.' + + if self.type is MessageType.stage_topic: + return f'{self.author.name} changed Stage topic: **{self.content}**.' + # Fallback for unknown message types return '' diff --git a/docs/api.rst b/docs/api.rst index 32e393ef2..d40974d67 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -1653,6 +1653,31 @@ of :class:`enum.Enum`. The system message sent when a user is given an advertisement to purchase a premium tier for an application during an interaction. + .. versionadded:: 2.2 + .. attribute:: stage_start + + The system message sent when the stage starts. + + .. versionadded:: 2.2 + .. attribute:: stage_end + + The system message sent when the stage ends. + + .. versionadded:: 2.2 + .. attribute:: stage_speaker + + The system message sent when the stage speaker changes. + + .. versionadded:: 2.2 + .. attribute:: stage_raise_hand + + The system message sent when a user is requesting to speak by raising their hands. + + .. versionadded:: 2.2 + .. attribute:: stage_topic + + The system message sent when the stage topic changes. + .. versionadded:: 2.2 .. attribute:: guild_application_premium_subscription From 1e9d04bbca21d6d38f8b610b861ae9c0c746ad48 Mon Sep 17 00:00:00 2001 From: Puncher <65789180+Puncher1@users.noreply.github.com> Date: Tue, 28 Feb 2023 08:18:59 +0100 Subject: [PATCH 010/473] Add missing and fix wrong docstrings --- discord/ext/commands/hybrid.py | 3 +++ discord/guild.py | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/discord/ext/commands/hybrid.py b/discord/ext/commands/hybrid.py index fb6d39b31..d3f3c91b5 100644 --- a/discord/ext/commands/hybrid.py +++ b/discord/ext/commands/hybrid.py @@ -908,6 +908,9 @@ def hybrid_group( Parameters ----------- + name: Union[:class:`str`, :class:`~discord.app_commands.locale_str`] + The name to create the group with. By default this uses the + function name unchanged. with_app_command: :class:`bool` Whether to register the command also as an application command. diff --git a/discord/guild.py b/discord/guild.py index 96bd1801b..cf6ddd4c3 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1593,6 +1593,10 @@ class Guild(Hashable): ----------- name: :class:`str` The channel's name. + overwrites: Dict[Union[:class:`Role`, :class:`Member`], :class:`PermissionOverwrite`] + A :class:`dict` of target (either a role or a member) to + :class:`PermissionOverwrite` to apply upon creation of a channel. + Useful for creating secret channels. topic: :class:`str` The channel's topic. category: Optional[:class:`CategoryChannel`] @@ -2782,7 +2786,7 @@ class Guild(Hashable): Parameters ------------ - id: :class:`int` + scheduled_event_id: :class:`int` The scheduled event ID. with_counts: :class:`bool` Whether to include the number of users that are subscribed to the event. @@ -2846,6 +2850,8 @@ class Guild(Hashable): datetime object. Consider using :func:`utils.utcnow`. Required if the entity type is :attr:`EntityType.external`. + privacy_level: :class:`PrivacyLevel` + The privacy level of the scheduled event. entity_type: :class:`EntityType` The entity type of the scheduled event. If the channel is a :class:`StageInstance` or :class:`VoiceChannel` then this is From a5a93a85bc9eebb3b7db65b9523af11be489a23c Mon Sep 17 00:00:00 2001 From: Soheab_ <33902984+Soheab@users.noreply.github.com> Date: Tue, 28 Feb 2023 08:20:00 +0100 Subject: [PATCH 011/473] [commands] Document GroupCog.interaction_check --- discord/ext/commands/cog.py | 13 +++++++++++++ docs/ext/commands/api.rst | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/discord/ext/commands/cog.py b/discord/ext/commands/cog.py index 11f6a0393..02136bce8 100644 --- a/discord/ext/commands/cog.py +++ b/discord/ext/commands/cog.py @@ -50,6 +50,7 @@ from ._types import _BaseCommand, BotT if TYPE_CHECKING: from typing_extensions import Self from discord.abc import Snowflake + from discord._types import ClientT from .bot import BotBase from .context import Context @@ -585,6 +586,18 @@ class Cog(metaclass=CogMeta): """ return True + @_cog_special_method + def interaction_check(self, interaction: discord.Interaction[ClientT], /) -> bool: + """A special method that registers as a :func:`discord.app_commands.check` + for every app command and subcommand in this cog. + + This function **can** be a coroutine and must take a sole parameter, + ``interaction``, to represent the :class:`~discord.Interaction`. + + .. versionadded:: 2.0 + """ + return True + @_cog_special_method async def cog_command_error(self, ctx: Context[BotT], error: Exception) -> None: """|coro| diff --git a/docs/ext/commands/api.rst b/docs/ext/commands/api.rst index 6420d2b0d..9bda24f6e 100644 --- a/docs/ext/commands/api.rst +++ b/docs/ext/commands/api.rst @@ -256,7 +256,7 @@ GroupCog .. attributetable:: discord.ext.commands.GroupCog .. autoclass:: discord.ext.commands.GroupCog - :members: + :members: interaction_check CogMeta From e4667386ea300b0981e0a1d7390e43795f26c8c7 Mon Sep 17 00:00:00 2001 From: owocado <24418520+owocado@users.noreply.github.com> Date: Tue, 28 Feb 2023 19:30:33 +0530 Subject: [PATCH 012/473] Add missing AuditLogDiff attributes for AuditLogAction.guild_update --- docs/api.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/api.rst b/docs/api.rst index d40974d67..c7f1b549f 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -1975,6 +1975,8 @@ of :class:`enum.Enum`. - :attr:`~AuditLogDiff.verification_level` - :attr:`~AuditLogDiff.widget_channel` - :attr:`~AuditLogDiff.widget_enabled` + - :attr:`~AuditLogDiff.premium_progress_bar_enabled` + - :attr:`~AuditLogDiff.system_channel_flags` .. attribute:: channel_create @@ -3937,6 +3939,20 @@ AuditLogDiff :type: List[:class:`abc.GuildChannel`, :class:`Thread`, :class:`Object`] + .. attribute:: premium_progress_bar_enabled + + The guild’s display setting to show boost progress sidebar + + :type: :class:`bool` + + .. attribute:: system_channel_flags + + The guild’s system channel settings. + + See also :attr:`Guild.system_channel_flags` + + :type: :class:`SystemChannelFlags` + .. this is currently missing the following keys: reason and application_id I'm not sure how to port these From 2d6c50dbe13b20ab6dc56a20ecc1057a80f166e9 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 28 Feb 2023 08:46:44 -0500 Subject: [PATCH 013/473] Add note about colour changing --- discord/colour.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/discord/colour.py b/discord/colour.py index 6a9f7b8d5..52dca9cc0 100644 --- a/discord/colour.py +++ b/discord/colour.py @@ -104,6 +104,11 @@ class Colour: Returns the raw colour value. + .. note:: + + The colour values in the classmethods are mostly provided as-is and can change between + versions should the Discord client's representation of that colour also change. + Attributes ------------ value: :class:`int` From f849a549141304270155b0458bb6530d374f5b85 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 28 Feb 2023 08:47:14 -0500 Subject: [PATCH 014/473] Add changelog for v2.2 --- docs/whats_new.rst | 80 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/docs/whats_new.rst b/docs/whats_new.rst index 614312c8a..f0a0f4e8f 100644 --- a/docs/whats_new.rst +++ b/docs/whats_new.rst @@ -11,6 +11,86 @@ Changelog This page keeps a detailed human friendly rendering of what's new and changed in specific versions. +.. _vp2p2p0: + +v2.2.0 +------- + +New Features +~~~~~~~~~~~~ + +- Add support for new :func:`on_audit_log_entry_create` event +- Add support for silent messages via ``silent`` parameter in :meth:`abc.Messageable.send` + - This is queryable via :attr:`MessageFlags.suppress_notifications` + +- Implement :class:`abc.Messageable` for :class:`StageChannel` (:issue:`9248`) +- Add setter for :attr:`discord.ui.ChannelSelect.channel_types` (:issue:`9068`) +- Add support for custom messages in automod via :attr:`AutoModRuleAction.custom_message` (:issue:`9267`) +- Add :meth:`ForumChannel.get_thread` (:issue:`9106`) +- Add :attr:`StageChannel.slowmode_delay` and :attr:`VoiceChannel.slowmode_delay` (:issue:`9111`) +- Add support for editing the slowmode for :class:`StageChannel` and :class:`VoiceChannel` (:issue:`9111`) +- Add :attr:`Locale.indonesian` +- Add ``delete_after`` keyword argument to :meth:`Interaction.edit_message` (:issue:`9415`) +- Add ``delete_after`` keyword argument to :meth:`InteractionMessage.edit` (:issue:`9206`) +- Add support for member flags (:issue:`9204`) + - Accessible via :attr:`Member.flags` and has a type of :class:`MemberFlags` + - Support ``bypass_verification`` within :meth:`Member.edit` + +- Add support for passing a client to :meth:`Webhook.from_url` and :meth:`Webhook.partial` + - This allows them to use views (assuming they are "bot owned" webhooks) + +- Add :meth:`Colour.dark_embed` and :meth:`Colour.light_embed` (:issue:`9219`) +- Add support for many more parameters within :meth:`Guild.create_stage_channel` (:issue:`9245`) +- Add :attr:`AppInfo.role_connections_verification_url` +- Add support for :attr:`ForumChannel.default_layout` +- Add various new :class:`MessageType` values such as ones related to stage channel and role subscriptions +- Add support for role subscription related attributes + - :class:`RoleSubscriptionInfo` within :attr:`Message.role_subscription` + - :attr:`MessageType.role_subscription_purchase` + - :attr:`SystemChannelFlags.role_subscription_purchase_notifications` + - :attr:`SystemChannelFlags.role_subscription_purchase_notification_replies` + - :attr:`RoleTags.subscription_listing_id` + - :meth:`RoleTags.is_available_for_purchase` + +- Add support for checking if a role is a linked role under :meth:`RoleTags.is_guild_connection` +- Add support for GIF sticker type +- Add support for :attr:`Message.application_id` and :attr:`Message.position` +- Add :func:`utils.maybe_coroutine` helper +- Add :attr:`ScheduledEvent.creator_id` attribute +- |commands| Add support for :meth:`~ext.commands.Cog.interaction_check` for :class:`~ext.commands.GroupCog` (:issue:`9189`) + +Bug Fixes +~~~~~~~~~~ + +- Fix views not being removed from message store backing leading to a memory leak when used from an application command context +- Fix async iterators requesting past their bounds when using ``oldest_first`` and ``after`` or ``before`` (:issue:`9093`) +- Fix :meth:`Guild.audit_logs` pagination logic being buggy when using ``after`` (:issue:`9269`) +- Fix :attr:`Message.channel` sometimes being :class:`Object` instead of :class:`PartialMessageable` +- Fix :class:`ui.View` not properly calling ``super().__init_subclass__`` (:issue:`9231`) +- Fix ``available_tags`` and ``default_thread_slowmode_delay`` not being respected in :meth:`Guild.create_forum` +- Fix :class:`AutoModTrigger` ignoring ``allow_list`` with type keyword (:issue:`9107`) +- Fix implicit permission resolution for :class:`Thread` (:issue:`9153`) +- Fix :meth:`AutoModRule.edit` to work with actual snowflake types such as :class:`Object` (:issue:`9159`) +- Fix :meth:`Webhook.send` returning :class:`ForumChannel` for :attr:`WebhookMessage.channel` +- When a lookup for :attr:`AuditLogEntry.target` fails, it will fallback to :class:`Object` with the appropriate :attr:`Object.type` (:issue:`9171`) +- Fix :attr:`AuditLogDiff.type` for integrations returning :class:`ChannelType` instead of :class:`str` (:issue:`9200`) +- Fix :attr:`AuditLogDiff.type` for webhooks returning :class:`ChannelType` instead of :class:`WebhookType` (:issue:`9251`) +- Fix webhooks and interactions not properly closing files after the request has completed +- Fix :exc:`NameError` in audit log target for app commands +- Fix :meth:`ScheduledEvent.edit` requiring some arguments to be passed in when unnecessary (:issue:`9261`, :issue:`9268`) +- |commands| Explicit set a traceback for hybrid command invocations (:issue:`9205`) + +Miscellaneous +~~~~~~~~~~~~~~ + +- Add colour preview for the colours predefined in :class:`Colour` +- Finished views are no longer stored by the library when sending them (:issue:`9235`) +- Force enable colour logging for the default logging handler when run under Docker. +- Add various overloads for :meth:`Client.wait_for` to aid in static analysis (:issue:`9184`) +- :class:`Interaction` can now optionally take a generic parameter, ``ClientT`` to represent the type for :attr:`Interaction.client` +- |commands| Respect :attr:`~ext.commands.Command.ignore_extra` for :class:`~discord.ext.commands.FlagConverter` keyword-only parameters +- |commands| Change :attr:`Paginator.pages ` to not prematurely close (:issue:`9257`) + .. _vp2p1p1: v2.1.1 From 7f1b39b5b3e23b3fbc0acf7060dc1f8451f49817 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 28 Feb 2023 09:10:18 -0500 Subject: [PATCH 015/473] Version bump to v2.2.0 --- discord/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/__init__.py b/discord/__init__.py index 014615354..198efd61f 100644 --- a/discord/__init__.py +++ b/discord/__init__.py @@ -13,7 +13,7 @@ __title__ = 'discord' __author__ = 'Rapptz' __license__ = 'MIT' __copyright__ = 'Copyright 2015-present Rapptz' -__version__ = '2.2.0a' +__version__ = '2.2.0' __path__ = __import__('pkgutil').extend_path(__path__, __name__) @@ -78,7 +78,7 @@ class VersionInfo(NamedTuple): serial: int -version_info: VersionInfo = VersionInfo(major=2, minor=2, micro=0, releaselevel='alpha', serial=0) +version_info: VersionInfo = VersionInfo(major=2, minor=2, micro=0, releaselevel='final', serial=0) logging.getLogger(__name__).addHandler(logging.NullHandler()) From 7a0744c9a90a38570db631d21f2d28d626710b3e Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 28 Feb 2023 09:10:46 -0500 Subject: [PATCH 016/473] Version bump for development --- discord/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/__init__.py b/discord/__init__.py index 198efd61f..39fdb2673 100644 --- a/discord/__init__.py +++ b/discord/__init__.py @@ -13,7 +13,7 @@ __title__ = 'discord' __author__ = 'Rapptz' __license__ = 'MIT' __copyright__ = 'Copyright 2015-present Rapptz' -__version__ = '2.2.0' +__version__ = '2.3.0a' __path__ = __import__('pkgutil').extend_path(__path__, __name__) @@ -78,7 +78,7 @@ class VersionInfo(NamedTuple): serial: int -version_info: VersionInfo = VersionInfo(major=2, minor=2, micro=0, releaselevel='final', serial=0) +version_info: VersionInfo = VersionInfo(major=2, minor=3, micro=0, releaselevel='alpha', serial=0) logging.getLogger(__name__).addHandler(logging.NullHandler()) From 26f49512b530e728cb51125da9b87a326273f85b Mon Sep 17 00:00:00 2001 From: Flame442 <34169552+Flame442@users.noreply.github.com> Date: Tue, 28 Feb 2023 17:25:20 -0500 Subject: [PATCH 017/473] Fix member_prune extras attribute name --- docs/api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api.rst b/docs/api.rst index c7f1b549f..58fa5c989 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -2105,7 +2105,7 @@ of :class:`enum.Enum`. When this is the action, the type of :attr:`~AuditLogEntry.extra` is set to an unspecified proxy object with two attributes: - - ``delete_members_days``: An integer specifying how far the prune was. + - ``delete_member_days``: An integer specifying how far the prune was. - ``members_removed``: An integer specifying how many members were removed. When this is the action, :attr:`~AuditLogEntry.changes` is empty. From 53ce47534d5fe513535569561d11e5a386e2d6c1 Mon Sep 17 00:00:00 2001 From: owocado <24418520+owocado@users.noreply.github.com> Date: Wed, 1 Mar 2023 19:25:16 +0530 Subject: [PATCH 018/473] Add more missing AuditLogDiff attrs --- docs/api.rst | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/docs/api.rst b/docs/api.rst index 58fa5c989..5dd452af0 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -2018,6 +2018,9 @@ of :class:`enum.Enum`. - :attr:`~AuditLogDiff.rtc_region` - :attr:`~AuditLogDiff.video_quality_mode` - :attr:`~AuditLogDiff.default_auto_archive_duration` + - :attr:`~AuditLogDiff.nsfw` + - :attr:`~AuditLogDiff.slowmode_delay` + - :attr:`~AuditLogDiff.user_limit` .. attribute:: channel_delete @@ -2034,6 +2037,9 @@ of :class:`enum.Enum`. - :attr:`~AuditLogDiff.name` - :attr:`~AuditLogDiff.type` - :attr:`~AuditLogDiff.overwrites` + - :attr:`~AuditLogDiff.flags` + - :attr:`~AuditLogDiff.nsfw` + - :attr:`~AuditLogDiff.slowmode_delay` .. attribute:: overwrite_create @@ -3941,7 +3947,7 @@ AuditLogDiff .. attribute:: premium_progress_bar_enabled - The guild’s display setting to show boost progress sidebar + The guild’s display setting to show boost progress bar. :type: :class:`bool` @@ -3953,6 +3959,28 @@ AuditLogDiff :type: :class:`SystemChannelFlags` + .. attribute:: nsfw + + Whether the channel is marked as “not safe for work” or “age restricted”. + + :type: :class:`bool` + + .. attribute:: user_limit + + The channel’s limit for number of members that can be in a voice or stage channel. + + See also :attr:`VoiceChannel.user_limit` and :attr:`StageChannel.user_limit` + + :type: :class:`int` + + .. attribute:: flags + + The channel flags associated with this thread or forum post. + + See also :attr:`ForumChannel.flags` and :attr:`Thread.flags` + + :type: :class:`ChannelFlags` + .. this is currently missing the following keys: reason and application_id I'm not sure how to port these From 6910943703ba21aba6454d07b505a2582d9a49e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Spie=C3=9F?= Date: Thu, 2 Mar 2023 00:11:06 +0100 Subject: [PATCH 019/473] Fix udp discovery not using 74 byte layout --- discord/gateway.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/discord/gateway.py b/discord/gateway.py index a06195307..50b69acf9 100644 --- a/discord/gateway.py +++ b/discord/gateway.py @@ -948,16 +948,16 @@ class DiscordVoiceWebSocket: state.voice_port = data['port'] state.endpoint_ip = data['ip'] - packet = bytearray(70) + packet = bytearray(74) struct.pack_into('>H', packet, 0, 1) # 1 = Send struct.pack_into('>H', packet, 2, 70) # 70 = Length struct.pack_into('>I', packet, 4, state.ssrc) state.socket.sendto(packet, (state.endpoint_ip, state.voice_port)) - recv = await self.loop.sock_recv(state.socket, 70) + recv = await self.loop.sock_recv(state.socket, 74) _log.debug('received packet in initial_connection: %s', recv) - # the ip is ascii starting at the 4th byte and ending at the first null - ip_start = 4 + # the ip is ascii starting at the 8th byte and ending at the first null + ip_start = 8 ip_end = recv.index(0, ip_start) state.ip = recv[ip_start:ip_end].decode('ascii') From 1de3562f3475ee29ddcbfd51351586710ec953db Mon Sep 17 00:00:00 2001 From: Bryan Forbes Date: Wed, 1 Mar 2023 18:14:50 -0600 Subject: [PATCH 020/473] Fix partially uknown typing errors --- discord/client.py | 12 ++++++------ discord/ui/item.py | 2 +- discord/ui/select.py | 14 +++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/discord/client.py b/discord/client.py index c53b0f3f3..9da588f33 100644 --- a/discord/client.py +++ b/discord/client.py @@ -1161,9 +1161,9 @@ class Client: event: Literal['app_command_completion'], /, *, - check: Optional[Callable[[Interaction[Self], Union[Command, ContextMenu]], bool]], + check: Optional[Callable[[Interaction[Self], Union[Command[Any, Any, Any], ContextMenu]], bool]], timeout: Optional[float] = None, - ) -> Tuple[Interaction[Self], Union[Command, ContextMenu]]: + ) -> Tuple[Interaction[Self], Union[Command[Any, Any, Any], ContextMenu]]: ... # AutoMod @@ -1816,9 +1816,9 @@ class Client: event: Literal["command", "command_completion"], /, *, - check: Optional[Callable[[Context], bool]] = None, + check: Optional[Callable[[Context[Any]], bool]] = None, timeout: Optional[float] = None, - ) -> Context: + ) -> Context[Any]: ... @overload @@ -1827,9 +1827,9 @@ class Client: event: Literal["command_error"], /, *, - check: Optional[Callable[[Context, CommandError], bool]] = None, + check: Optional[Callable[[Context[Any], CommandError], bool]] = None, timeout: Optional[float] = None, - ) -> Tuple[Context, CommandError]: + ) -> Tuple[Context[Any], CommandError]: ... @overload diff --git a/discord/ui/item.py b/discord/ui/item.py index 443876c1a..2ef42fb9e 100644 --- a/discord/ui/item.py +++ b/discord/ui/item.py @@ -40,7 +40,7 @@ if TYPE_CHECKING: from .view import View from ..components import Component -I = TypeVar('I', bound='Item') +I = TypeVar('I', bound='Item[Any]') V = TypeVar('V', bound='View', covariant=True) ItemCallbackType = Callable[[V, Interaction[Any], I], Coroutine[Any, Any, Any]] diff --git a/discord/ui/select.py b/discord/ui/select.py index 11555c7f7..bcd7b466d 100644 --- a/discord/ui/select.py +++ b/discord/ui/select.py @@ -22,7 +22,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ from __future__ import annotations -from typing import List, Literal, Optional, TYPE_CHECKING, Tuple, Type, TypeVar, Callable, Union, Dict, overload +from typing import Any, List, Literal, Optional, TYPE_CHECKING, Tuple, Type, TypeVar, Callable, Union, Dict, overload from contextvars import ContextVar import inspect import os @@ -71,12 +71,12 @@ if TYPE_CHECKING: ] V = TypeVar('V', bound='View', covariant=True) -BaseSelectT = TypeVar('BaseSelectT', bound='BaseSelect') -SelectT = TypeVar('SelectT', bound='Select') -UserSelectT = TypeVar('UserSelectT', bound='UserSelect') -RoleSelectT = TypeVar('RoleSelectT', bound='RoleSelect') -ChannelSelectT = TypeVar('ChannelSelectT', bound='ChannelSelect') -MentionableSelectT = TypeVar('MentionableSelectT', bound='MentionableSelect') +BaseSelectT = TypeVar('BaseSelectT', bound='BaseSelect[Any]') +SelectT = TypeVar('SelectT', bound='Select[Any]') +UserSelectT = TypeVar('UserSelectT', bound='UserSelect[Any]') +RoleSelectT = TypeVar('RoleSelectT', bound='RoleSelect[Any]') +ChannelSelectT = TypeVar('ChannelSelectT', bound='ChannelSelect[Any]') +MentionableSelectT = TypeVar('MentionableSelectT', bound='MentionableSelect[Any]') SelectCallbackDecorator: TypeAlias = Callable[[ItemCallbackType[V, BaseSelectT]], BaseSelectT] selected_values: ContextVar[Dict[str, List[PossibleValue]]] = ContextVar('selected_values') From 4d51f6886496099e8ffb9e622e55fd6aa36cbd9a Mon Sep 17 00:00:00 2001 From: Bryan Forbes Date: Wed, 1 Mar 2023 18:37:38 -0600 Subject: [PATCH 021/473] [commands] Fix some more partially uknown typing errors --- discord/ext/commands/hybrid.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/ext/commands/hybrid.py b/discord/ext/commands/hybrid.py index d3f3c91b5..1e26f7830 100644 --- a/discord/ext/commands/hybrid.py +++ b/discord/ext/commands/hybrid.py @@ -72,9 +72,9 @@ __all__ = ( T = TypeVar('T') U = TypeVar('U') CogT = TypeVar('CogT', bound='Cog') -CommandT = TypeVar('CommandT', bound='Command') +CommandT = TypeVar('CommandT', bound='Command[Any, Any, Any]') # CHT = TypeVar('CHT', bound='Check') -GroupT = TypeVar('GroupT', bound='Group') +GroupT = TypeVar('GroupT', bound='Group[Any, Any, Any]') _NoneType = type(None) if TYPE_CHECKING: From 4661fff2a015ee53e415aedaca6b6b130ec4a265 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Wed, 1 Mar 2023 19:43:18 -0500 Subject: [PATCH 022/473] Add changelog for v2.2.1 --- docs/whats_new.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/whats_new.rst b/docs/whats_new.rst index f0a0f4e8f..b7fa32607 100644 --- a/docs/whats_new.rst +++ b/docs/whats_new.rst @@ -11,6 +11,16 @@ Changelog This page keeps a detailed human friendly rendering of what's new and changed in specific versions. +.. _vp2p2p1: + +v2.2.1 +------- + +Bug Fixes +~~~~~~~~~~ + +- Fix UDP discovery in voice not using new 74 byte layout which caused voice to break (:issue:`9277`, :issue:`9278`) + .. _vp2p2p0: v2.2.0 From bbf2cce488b524effa614ec0c8ae347e5fafff95 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Wed, 1 Mar 2023 19:43:49 -0500 Subject: [PATCH 023/473] Version bump to v2.2.1 --- discord/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/__init__.py b/discord/__init__.py index 39fdb2673..0a4d28eb4 100644 --- a/discord/__init__.py +++ b/discord/__init__.py @@ -13,7 +13,7 @@ __title__ = 'discord' __author__ = 'Rapptz' __license__ = 'MIT' __copyright__ = 'Copyright 2015-present Rapptz' -__version__ = '2.3.0a' +__version__ = '2.2.1' __path__ = __import__('pkgutil').extend_path(__path__, __name__) @@ -78,7 +78,7 @@ class VersionInfo(NamedTuple): serial: int -version_info: VersionInfo = VersionInfo(major=2, minor=3, micro=0, releaselevel='alpha', serial=0) +version_info: VersionInfo = VersionInfo(major=2, minor=2, micro=1, releaselevel='final', serial=0) logging.getLogger(__name__).addHandler(logging.NullHandler()) From 82bfb3cf34be05695e969366459c15711b4032d7 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Wed, 1 Mar 2023 19:44:24 -0500 Subject: [PATCH 024/473] Version bump for development --- discord/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/__init__.py b/discord/__init__.py index 0a4d28eb4..39fdb2673 100644 --- a/discord/__init__.py +++ b/discord/__init__.py @@ -13,7 +13,7 @@ __title__ = 'discord' __author__ = 'Rapptz' __license__ = 'MIT' __copyright__ = 'Copyright 2015-present Rapptz' -__version__ = '2.2.1' +__version__ = '2.3.0a' __path__ = __import__('pkgutil').extend_path(__path__, __name__) @@ -78,7 +78,7 @@ class VersionInfo(NamedTuple): serial: int -version_info: VersionInfo = VersionInfo(major=2, minor=2, micro=1, releaselevel='final', serial=0) +version_info: VersionInfo = VersionInfo(major=2, minor=3, micro=0, releaselevel='alpha', serial=0) logging.getLogger(__name__).addHandler(logging.NullHandler()) From 0ea098567c760e47623ec82622fda8acab429fc5 Mon Sep 17 00:00:00 2001 From: Bryan Forbes Date: Wed, 1 Mar 2023 21:47:17 -0600 Subject: [PATCH 025/473] [commands] Use `...` for `Command` and `Group` typing --- discord/client.py | 4 ++-- discord/ext/commands/hybrid.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/discord/client.py b/discord/client.py index 9da588f33..a3b76b32a 100644 --- a/discord/client.py +++ b/discord/client.py @@ -1161,9 +1161,9 @@ class Client: event: Literal['app_command_completion'], /, *, - check: Optional[Callable[[Interaction[Self], Union[Command[Any, Any, Any], ContextMenu]], bool]], + check: Optional[Callable[[Interaction[Self], Union[Command[Any, ..., Any], ContextMenu]], bool]], timeout: Optional[float] = None, - ) -> Tuple[Interaction[Self], Union[Command[Any, Any, Any], ContextMenu]]: + ) -> Tuple[Interaction[Self], Union[Command[Any, ..., Any], ContextMenu]]: ... # AutoMod diff --git a/discord/ext/commands/hybrid.py b/discord/ext/commands/hybrid.py index 1e26f7830..41d9ffd25 100644 --- a/discord/ext/commands/hybrid.py +++ b/discord/ext/commands/hybrid.py @@ -72,9 +72,9 @@ __all__ = ( T = TypeVar('T') U = TypeVar('U') CogT = TypeVar('CogT', bound='Cog') -CommandT = TypeVar('CommandT', bound='Command[Any, Any, Any]') +CommandT = TypeVar('CommandT', bound='Command[Any, ..., Any]') # CHT = TypeVar('CHT', bound='Check') -GroupT = TypeVar('GroupT', bound='Group[Any, Any, Any]') +GroupT = TypeVar('GroupT', bound='Group[Any, ..., Any]') _NoneType = type(None) if TYPE_CHECKING: @@ -297,7 +297,7 @@ def replace_parameters( class HybridAppCommand(discord.app_commands.Command[CogT, P, T]): - def __init__(self, wrapped: Union[HybridCommand[CogT, Any, T], HybridGroup[CogT, Any, T]]) -> None: + def __init__(self, wrapped: Union[HybridCommand[CogT, ..., T], HybridGroup[CogT, ..., T]]) -> None: signature = inspect.signature(wrapped.callback) params = replace_parameters(wrapped.params, wrapped.callback, signature) wrapped.callback.__signature__ = signature.replace(parameters=params) @@ -312,7 +312,7 @@ class HybridAppCommand(discord.app_commands.Command[CogT, P, T]): finally: del wrapped.callback.__signature__ - self.wrapped: Union[HybridCommand[CogT, Any, T], HybridGroup[CogT, Any, T]] = wrapped + self.wrapped: Union[HybridCommand[CogT, ..., T], HybridGroup[CogT, ..., T]] = wrapped self.binding: Optional[CogT] = wrapped.cog # This technically means only one flag converter is supported self.flag_converter: Optional[Tuple[str, Type[FlagConverter]]] = getattr( From 78175ded1b29ff73c1fb1d4bcfc85e42b572fa07 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Wed, 1 Mar 2023 22:48:19 -0500 Subject: [PATCH 026/473] Version bump to v2.2.2 --- discord/__init__.py | 4 ++-- docs/whats_new.rst | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/discord/__init__.py b/discord/__init__.py index 39fdb2673..5afc3fccb 100644 --- a/discord/__init__.py +++ b/discord/__init__.py @@ -13,7 +13,7 @@ __title__ = 'discord' __author__ = 'Rapptz' __license__ = 'MIT' __copyright__ = 'Copyright 2015-present Rapptz' -__version__ = '2.3.0a' +__version__ = '2.2.2' __path__ = __import__('pkgutil').extend_path(__path__, __name__) @@ -78,7 +78,7 @@ class VersionInfo(NamedTuple): serial: int -version_info: VersionInfo = VersionInfo(major=2, minor=3, micro=0, releaselevel='alpha', serial=0) +version_info: VersionInfo = VersionInfo(major=2, minor=2, micro=2, releaselevel='final', serial=0) logging.getLogger(__name__).addHandler(logging.NullHandler()) diff --git a/docs/whats_new.rst b/docs/whats_new.rst index b7fa32607..760be0152 100644 --- a/docs/whats_new.rst +++ b/docs/whats_new.rst @@ -11,9 +11,9 @@ Changelog This page keeps a detailed human friendly rendering of what's new and changed in specific versions. -.. _vp2p2p1: +.. _vp2p2p2: -v2.2.1 +v2.2.2 ------- Bug Fixes From 78099992dd40d984e9cb8f6505a4e5ecd0115e57 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Wed, 1 Mar 2023 22:49:32 -0500 Subject: [PATCH 027/473] Version bump for development --- discord/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/__init__.py b/discord/__init__.py index 5afc3fccb..39fdb2673 100644 --- a/discord/__init__.py +++ b/discord/__init__.py @@ -13,7 +13,7 @@ __title__ = 'discord' __author__ = 'Rapptz' __license__ = 'MIT' __copyright__ = 'Copyright 2015-present Rapptz' -__version__ = '2.2.2' +__version__ = '2.3.0a' __path__ = __import__('pkgutil').extend_path(__path__, __name__) @@ -78,7 +78,7 @@ class VersionInfo(NamedTuple): serial: int -version_info: VersionInfo = VersionInfo(major=2, minor=2, micro=2, releaselevel='final', serial=0) +version_info: VersionInfo = VersionInfo(major=2, minor=3, micro=0, releaselevel='alpha', serial=0) logging.getLogger(__name__).addHandler(logging.NullHandler()) From a938b10e5a680405a99a5d0bb49e8d075fb0fecf Mon Sep 17 00:00:00 2001 From: Soheab_ <33902984+Soheab@users.noreply.github.com> Date: Fri, 3 Mar 2023 15:07:22 +0100 Subject: [PATCH 028/473] [commands] Pass failed argument's value to BadLiteralArgument --- discord/ext/commands/converter.py | 2 +- discord/ext/commands/errors.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py index cc7a3eb9b..e5be9d47f 100644 --- a/discord/ext/commands/converter.py +++ b/discord/ext/commands/converter.py @@ -1330,7 +1330,7 @@ async def run_converters(ctx: Context[BotT], converter: Any, argument: str, para return value # if we're here, then we failed to match all the literals - raise BadLiteralArgument(param, literal_args, errors) + raise BadLiteralArgument(param, literal_args, errors, argument) # This must be the last if-clause in the chain of origin checking # Nearly every type is a generic type within the typing library diff --git a/discord/ext/commands/errors.py b/discord/ext/commands/errors.py index 17dd49830..b25e6ae95 100644 --- a/discord/ext/commands/errors.py +++ b/discord/ext/commands/errors.py @@ -920,12 +920,17 @@ class BadLiteralArgument(UserInputError): A tuple of values compared against in conversion, in order of failure. errors: List[:class:`CommandError`] A list of errors that were caught from failing the conversion. + argument: :class:`str` + The argument's value that failed to be converted. Defaults to an empty string. + + .. versionadded:: 2.3 """ - def __init__(self, param: Parameter, literals: Tuple[Any, ...], errors: List[CommandError]) -> None: + def __init__(self, param: Parameter, literals: Tuple[Any, ...], errors: List[CommandError], argument: str = "") -> None: self.param: Parameter = param self.literals: Tuple[Any, ...] = literals self.errors: List[CommandError] = errors + self.argument: str = argument to_string = [repr(l) for l in literals] if len(to_string) > 2: From 60094b17a9861e1bf94726869d8f1f5c31a50957 Mon Sep 17 00:00:00 2001 From: Puncher <65789180+Puncher1@users.noreply.github.com> Date: Sun, 5 Mar 2023 23:28:50 +0100 Subject: [PATCH 029/473] Fix create_scheduled_event param handling --- discord/guild.py | 114 ++++++++++++++++++++++++++++++------- discord/scheduled_event.py | 11 ++-- 2 files changed, 97 insertions(+), 28 deletions(-) diff --git a/discord/guild.py b/discord/guild.py index cf6ddd4c3..4861333d5 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -2807,6 +2807,68 @@ class Guild(Hashable): data = await self._state.http.get_scheduled_event(self.id, scheduled_event_id, with_counts) return ScheduledEvent(state=self._state, data=data) + @overload + async def create_scheduled_event( + self, + *, + name: str, + start_time: datetime.datetime, + entity_type: Literal[EntityType.external] = ..., + privacy_level: PrivacyLevel = ..., + location: str = ..., + end_time: datetime.datetime = ..., + description: str = ..., + image: bytes = ..., + reason: Optional[str] = ..., + ) -> ScheduledEvent: + ... + + @overload + async def create_scheduled_event( + self, + *, + name: str, + start_time: datetime.datetime, + entity_type: Literal[EntityType.stage_instance, EntityType.voice] = ..., + privacy_level: PrivacyLevel = ..., + channel: Snowflake = ..., + end_time: datetime.datetime = ..., + description: str = ..., + image: bytes = ..., + reason: Optional[str] = ..., + ) -> ScheduledEvent: + ... + + @overload + async def create_scheduled_event( + self, + *, + name: str, + start_time: datetime.datetime, + privacy_level: PrivacyLevel = ..., + location: str = ..., + end_time: datetime.datetime = ..., + description: str = ..., + image: bytes = ..., + reason: Optional[str] = ..., + ) -> ScheduledEvent: + ... + + @overload + async def create_scheduled_event( + self, + *, + name: str, + start_time: datetime.datetime, + privacy_level: PrivacyLevel = ..., + channel: Union[VoiceChannel, StageChannel] = ..., + end_time: datetime.datetime = ..., + description: str = ..., + image: bytes = ..., + reason: Optional[str] = ..., + ) -> ScheduledEvent: + ... + async def create_scheduled_event( self, *, @@ -2899,27 +2961,32 @@ class Guild(Hashable): ) payload['scheduled_start_time'] = start_time.isoformat() + entity_type = entity_type or getattr(channel, '_scheduled_event_entity_type', MISSING) if entity_type is MISSING: - if channel is MISSING: + if channel and isinstance(channel, Object): + if channel.type is VoiceChannel: + entity_type = EntityType.voice + elif channel.type is StageChannel: + entity_type = EntityType.stage_instance + + elif location not in (MISSING, None): entity_type = EntityType.external - else: - _entity_type = getattr(channel, '_scheduled_event_entity_type', MISSING) - if _entity_type is None: - raise TypeError( - 'invalid GuildChannel type passed, must be VoiceChannel or StageChannel ' - f'not {channel.__class__.__name__}' - ) - if _entity_type is MISSING: - raise TypeError('entity_type must be passed in when passing an ambiguous channel type') + else: + if not isinstance(entity_type, EntityType): + raise TypeError('entity_type must be of type EntityType') - entity_type = _entity_type + payload['entity_type'] = entity_type.value - if not isinstance(entity_type, EntityType): - raise TypeError('entity_type must be of type EntityType') + if entity_type is None: + raise TypeError( + 'invalid GuildChannel type passed, must be VoiceChannel or StageChannel ' f'not {channel.__class__.__name__}' + ) - payload['entity_type'] = entity_type.value + if privacy_level is not MISSING: + if not isinstance(privacy_level, PrivacyLevel): + raise TypeError('privacy_level must be of type PrivacyLevel.') - payload['privacy_level'] = PrivacyLevel.guild_only.value + payload['privacy_level'] = privacy_level.value if description is not MISSING: payload['description'] = description @@ -2929,7 +2996,7 @@ class Guild(Hashable): payload['image'] = image_as_str if entity_type in (EntityType.stage_instance, EntityType.voice): - if channel is MISSING or channel is None: + if channel in (MISSING, None): raise TypeError('channel must be set when entity_type is voice or stage_instance') payload['channel_id'] = channel.id @@ -2945,12 +3012,15 @@ class Guild(Hashable): metadata['location'] = location - if end_time is not MISSING: - if end_time.tzinfo is None: - raise ValueError( - 'end_time must be an aware datetime. Consider using discord.utils.utcnow() or datetime.datetime.now().astimezone() for local time.' - ) - payload['scheduled_end_time'] = end_time.isoformat() + if end_time in (MISSING, None): + raise TypeError('end_time must be set when entity_type is external') + + if end_time not in (MISSING, None): + if end_time.tzinfo is None: + raise ValueError( + 'end_time must be an aware datetime. Consider using discord.utils.utcnow() or datetime.datetime.now().astimezone() for local time.' + ) + payload['scheduled_end_time'] = end_time.isoformat() if metadata: payload['entity_metadata'] = metadata diff --git a/discord/scheduled_event.py b/discord/scheduled_event.py index 810ea2b2a..f74ae6706 100644 --- a/discord/scheduled_event.py +++ b/discord/scheduled_event.py @@ -503,18 +503,17 @@ class ScheduledEvent(Hashable): entity_type = EntityType.stage_instance elif location not in (MISSING, None): entity_type = EntityType.external + else: + if not isinstance(entity_type, EntityType): + raise TypeError('entity_type must be of type EntityType') + + payload['entity_type'] = entity_type.value if entity_type is None: raise TypeError( f'invalid GuildChannel type passed, must be VoiceChannel or StageChannel not {channel.__class__.__name__}' ) - if entity_type is not MISSING: - if not isinstance(entity_type, EntityType): - raise TypeError('entity_type must be of type EntityType') - - payload['entity_type'] = entity_type.value - _entity_type = entity_type or self.entity_type _entity_type_changed = _entity_type is not self.entity_type From a1295868a629a1307f5fd9d7dbc79ae5eb9eb991 Mon Sep 17 00:00:00 2001 From: Puncher <65789180+Puncher1@users.noreply.github.com> Date: Sun, 5 Mar 2023 23:30:23 +0100 Subject: [PATCH 030/473] Add support for default_sort_order in ForumChannel --- discord/channel.py | 32 +++++++++++++++++++++++++++++++- discord/enums.py | 6 ++++++ discord/guild.py | 16 ++++++++++++++++ discord/http.py | 2 ++ discord/types/channel.py | 2 ++ docs/api.rst | 15 +++++++++++++++ 6 files changed, 72 insertions(+), 1 deletion(-) diff --git a/discord/channel.py b/discord/channel.py index 4e955a6ae..9636bc229 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -47,7 +47,7 @@ import datetime import discord.abc from .scheduled_event import ScheduledEvent from .permissions import PermissionOverwrite, Permissions -from .enums import ChannelType, ForumLayoutType, PrivacyLevel, try_enum, VideoQualityMode, EntityType +from .enums import ChannelType, ForumLayoutType, ForumOrderType, PrivacyLevel, try_enum, VideoQualityMode, EntityType from .mixins import Hashable from . import utils from .utils import MISSING @@ -2154,6 +2154,10 @@ class ForumChannel(discord.abc.GuildChannel, Hashable): Defaults to :attr:`ForumLayoutType.not_set`. .. versionadded:: 2.2 + default_sort_order: Optional[:class:`ForumOrderType`] + The default sort order for posts in this forum channel. + + .. versionadded:: 2.3 """ __slots__ = ( @@ -2173,6 +2177,7 @@ class ForumChannel(discord.abc.GuildChannel, Hashable): 'default_thread_slowmode_delay', 'default_reaction_emoji', 'default_layout', + 'default_sort_order', '_available_tags', '_flags', ) @@ -2218,6 +2223,11 @@ class ForumChannel(discord.abc.GuildChannel, Hashable): name=default_reaction_emoji.get('emoji_name') or '', ) + self.default_sort_order: Optional[ForumOrderType] = None + default_sort_order = data.get('default_sort_order') + if default_sort_order is not None: + self.default_sort_order = try_enum(ForumOrderType, default_sort_order) + self._flags: int = data.get('flags', 0) self._fill_overwrites(data) @@ -2344,6 +2354,7 @@ class ForumChannel(discord.abc.GuildChannel, Hashable): default_thread_slowmode_delay: int = ..., default_reaction_emoji: Optional[EmojiInputType] = ..., default_layout: ForumLayoutType = ..., + default_sort_order: ForumOrderType = ..., require_tag: bool = ..., ) -> ForumChannel: ... @@ -2402,6 +2413,10 @@ class ForumChannel(discord.abc.GuildChannel, Hashable): The new default layout for posts in this forum. .. versionadded:: 2.2 + default_sort_order: Optional[:class:`ForumOrderType`] + The new default sort order for posts in this forum. + + .. versionadded:: 2.3 require_tag: :class:`bool` Whether to require a tag for threads in this channel or not. @@ -2464,6 +2479,21 @@ class ForumChannel(discord.abc.GuildChannel, Hashable): options['default_forum_layout'] = layout.value + try: + sort_order = options.pop('default_sort_order') + except KeyError: + pass + else: + if sort_order is None: + options['default_sort_order'] = None + else: + if not isinstance(sort_order, ForumOrderType): + raise TypeError( + f'default_sort_order parameter must be a ForumOrderType not {sort_order.__class__.__name__}' + ) + + options['default_sort_order'] = sort_order.value + payload = await self._edit(options, reason=reason) if payload is not None: # the payload will always be the proper channel payload diff --git a/discord/enums.py b/discord/enums.py index 21a38caf8..94ca8c726 100644 --- a/discord/enums.py +++ b/discord/enums.py @@ -67,6 +67,7 @@ __all__ = ( 'AutoModRuleEventType', 'AutoModRuleActionType', 'ForumLayoutType', + 'ForumOrderType', ) if TYPE_CHECKING: @@ -751,6 +752,11 @@ class ForumLayoutType(Enum): gallery_view = 2 +class ForumOrderType(Enum): + latest_activity = 0 + creation_date = 1 + + def create_unknown_value(cls: Type[E], val: Any) -> E: value_cls = cls._enum_value_cls_ # type: ignore # This is narrowed below name = f'unknown_{val}' diff --git a/discord/guild.py b/discord/guild.py index 4861333d5..e1cc7814e 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -73,6 +73,7 @@ from .enums import ( MFALevel, Locale, AutoModRuleEventType, + ForumOrderType, ) from .mixins import Hashable from .user import User @@ -1576,6 +1577,7 @@ class Guild(Hashable): reason: Optional[str] = None, default_auto_archive_duration: int = MISSING, default_thread_slowmode_delay: int = MISSING, + default_sort_order: Optional[ForumOrderType] = None, available_tags: Sequence[ForumTag] = MISSING, ) -> ForumChannel: """|coro| @@ -1620,6 +1622,10 @@ class Guild(Hashable): The default slowmode delay in seconds for threads created in this forum. .. versionadded:: 2.1 + default_sort_order: Optional[:class:`ForumOrderType`] + The default sort order for posts in this forum channel. + + .. versionadded:: 2.3 available_tags: Sequence[:class:`ForumTag`] The available tags for this forum channel. @@ -1659,6 +1665,16 @@ class Guild(Hashable): if default_thread_slowmode_delay is not MISSING: options['default_thread_rate_limit_per_user'] = default_thread_slowmode_delay + if default_sort_order is None: + options['default_sort_order'] = None + else: + if not isinstance(default_sort_order, ForumOrderType): + raise TypeError( + f'default_sort_order parameter must be a ForumOrderType not {default_sort_order.__class__.__name__}' + ) + + options['default_sort_order'] = default_sort_order.value + if available_tags is not MISSING: options['available_tags'] = [t.to_dict() for t in available_tags] diff --git a/discord/http.py b/discord/http.py index 3fa622967..5e8d32dcd 100644 --- a/discord/http.py +++ b/discord/http.py @@ -1148,6 +1148,7 @@ class HTTPClient: 'available_tags', 'applied_tags', 'default_forum_layout', + 'default_sort_order', ) payload = {k: v for k, v in options.items() if k in valid_keys} @@ -1189,6 +1190,7 @@ class HTTPClient: 'video_quality_mode', 'default_auto_archive_duration', 'default_thread_rate_limit_per_user', + 'default_sort_order', 'available_tags', ) payload.update({k: v for k, v in options.items() if k in valid_keys and v is not None}) diff --git a/discord/types/channel.py b/discord/types/channel.py index ad17af689..421232b45 100644 --- a/discord/types/channel.py +++ b/discord/types/channel.py @@ -134,6 +134,7 @@ class ForumTag(TypedDict): emoji_name: Optional[str] +ForumOrderType = Literal[0, 1] ForumLayoutType = Literal[0, 1, 2] @@ -141,6 +142,7 @@ class ForumChannel(_BaseTextChannel): type: Literal[15] available_tags: List[ForumTag] default_reaction_emoji: Optional[DefaultReaction] + default_sort_order: Optional[ForumOrderType] default_forum_layout: NotRequired[ForumLayoutType] flags: NotRequired[int] diff --git a/docs/api.rst b/docs/api.rst index 5dd452af0..316dbda14 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -3310,6 +3310,21 @@ of :class:`enum.Enum`. Displays posts as a collection of tiles. +.. class:: ForumOrderType + + Represents how a forum's posts are sorted in the client. + + .. versionadded:: 2.3 + + .. attribute:: latest_activity + + Sort forum posts by activity. + + .. attribute:: creation_date + + Sort forum posts by creation time (from most recent to oldest). + + .. _discord-api-audit-logs: Audit Log Data From 79c508311fa45a7e41484c181d54a9ea9324953d Mon Sep 17 00:00:00 2001 From: Puncher <65789180+Puncher1@users.noreply.github.com> Date: Sun, 5 Mar 2023 23:31:14 +0100 Subject: [PATCH 031/473] Add support for default_thread_slowmode_delay in TextChannel --- discord/channel.py | 10 ++++++++++ discord/guild.py | 10 +++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/discord/channel.py b/discord/channel.py index 9636bc229..6cd74c71a 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -160,6 +160,10 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): The default auto archive duration in minutes for threads created in this channel. .. versionadded:: 2.0 + default_thread_slowmode_delay: :class:`int` + The default slowmode delay in seconds for threads created in this channel. + + .. versionadded:: 2.3 """ __slots__ = ( @@ -176,6 +180,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): '_type', 'last_message_id', 'default_auto_archive_duration', + 'default_thread_slowmode_delay', ) def __init__(self, *, state: ConnectionState, guild: Guild, data: Union[TextChannelPayload, NewsChannelPayload]): @@ -206,6 +211,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): # Does this need coercion into `int`? No idea yet. self.slowmode_delay: int = data.get('rate_limit_per_user', 0) self.default_auto_archive_duration: ThreadArchiveDuration = data.get('default_auto_archive_duration', 1440) + self.default_thread_slowmode_delay: int = data.get('default_thread_rate_limit_per_user', 0) self._type: Literal[0, 5] = data.get('type', self._type) self.last_message_id: Optional[int] = utils._get_as_snowflake(data, 'last_message_id') self._fill_overwrites(data) @@ -301,6 +307,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): category: Optional[CategoryChannel] = ..., slowmode_delay: int = ..., default_auto_archive_duration: ThreadArchiveDuration = ..., + default_thread_slowmode_delay: int = ..., type: ChannelType = ..., overwrites: Mapping[OverwriteKeyT, PermissionOverwrite] = ..., ) -> TextChannel: @@ -359,7 +366,10 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): Must be one of ``60``, ``1440``, ``4320``, or ``10080``. .. versionadded:: 2.0 + default_thread_slowmode_delay: :class:`int` + The new default slowmode delay in seconds for threads created in this channel. + .. versionadded:: 2.3 Raises ------ ValueError diff --git a/discord/guild.py b/discord/guild.py index e1cc7814e..0a901fbe3 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1200,6 +1200,7 @@ class Guild(Hashable): nsfw: bool = MISSING, overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = MISSING, default_auto_archive_duration: int = MISSING, + default_thread_slowmode_delay: int = MISSING, ) -> TextChannel: """|coro| @@ -1273,6 +1274,10 @@ class Guild(Hashable): Must be one of ``60``, ``1440``, ``4320``, or ``10080``. .. versionadded:: 2.0 + default_thread_slowmode_delay: :class:`int` + The default slowmode delay in seconds for threads created in the text channel. + + .. versionadded:: 2.3 reason: Optional[:class:`str`] The reason for creating this channel. Shows up on the audit log. @@ -1305,7 +1310,10 @@ class Guild(Hashable): options['nsfw'] = nsfw if default_auto_archive_duration is not MISSING: - options["default_auto_archive_duration"] = default_auto_archive_duration + options['default_auto_archive_duration'] = default_auto_archive_duration + + if default_thread_slowmode_delay is not MISSING: + options['default_thread_rate_limit_per_user'] = default_thread_slowmode_delay data = await self._create_channel( name, From 103d75540ca930152b6d39a6c6a503f67c2f2b06 Mon Sep 17 00:00:00 2001 From: Puncher <65789180+Puncher1@users.noreply.github.com> Date: Sun, 5 Mar 2023 23:32:20 +0100 Subject: [PATCH 032/473] Fix MISSING error for enabled param in create_automod_rule --- discord/guild.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/guild.py b/discord/guild.py index 0a901fbe3..f80429173 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -4064,7 +4064,7 @@ class Guild(Hashable): event_type: AutoModRuleEventType, trigger: AutoModTrigger, actions: List[AutoModRuleAction], - enabled: bool = MISSING, + enabled: bool = False, exempt_roles: Sequence[Snowflake] = MISSING, exempt_channels: Sequence[Snowflake] = MISSING, reason: str = MISSING, @@ -4089,7 +4089,7 @@ class Guild(Hashable): The actions that will be taken when the automod rule is triggered. enabled: :class:`bool` Whether the automod rule is enabled. - Discord will default to ``False``. + Defaults to ``False``. exempt_roles: Sequence[:class:`abc.Snowflake`] A list of roles that will be exempt from the automod rule. exempt_channels: Sequence[:class:`abc.Snowflake`] From dc9fb1fd84914df64576264d9cf6c151e768fefb Mon Sep 17 00:00:00 2001 From: Puncher <65789180+Puncher1@users.noreply.github.com> Date: Tue, 7 Mar 2023 02:15:22 +0100 Subject: [PATCH 033/473] Add missing param send_start_notification to create_instance --- discord/channel.py | 14 +++++++++++++- discord/http.py | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/discord/channel.py b/discord/channel.py index 6cd74c71a..3c93832f3 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -1594,7 +1594,12 @@ class StageChannel(VocalGuildChannel): return utils.get(self.guild.stage_instances, channel_id=self.id) async def create_instance( - self, *, topic: str, privacy_level: PrivacyLevel = MISSING, reason: Optional[str] = None + self, + *, + topic: str, + privacy_level: PrivacyLevel = MISSING, + send_start_notification: bool = False, + reason: Optional[str] = None, ) -> StageInstance: """|coro| @@ -1610,6 +1615,11 @@ class StageChannel(VocalGuildChannel): The stage instance's topic. privacy_level: :class:`PrivacyLevel` The stage instance's privacy level. Defaults to :attr:`PrivacyLevel.guild_only`. + send_start_notification: :class:`bool` + Whether to send a start notification. This sends a push notification to @everyone if ``True``. Defaults to ``False``. + You must have :attr:`~Permissions.mention_everyone` to do this. + + .. versionadded:: 2.3 reason: :class:`str` The reason the stage instance was created. Shows up on the audit log. @@ -1636,6 +1646,8 @@ class StageChannel(VocalGuildChannel): payload['privacy_level'] = privacy_level.value + payload['send_start_notification'] = send_start_notification + data = await self._state.http.create_stage_instance(**payload, reason=reason) return StageInstance(guild=self.guild, state=self._state, data=data) diff --git a/discord/http.py b/discord/http.py index 5e8d32dcd..86b871650 100644 --- a/discord/http.py +++ b/discord/http.py @@ -1905,6 +1905,7 @@ class HTTPClient: 'channel_id', 'topic', 'privacy_level', + 'send_start_notification', ) payload = {k: v for k, v in payload.items() if k in valid_keys} From 198425707e4bc61939a37eeab6d40b7ea2e1e949 Mon Sep 17 00:00:00 2001 From: rdrescher909 <51489753+rdrescher909@users.noreply.github.com> Date: Sun, 12 Mar 2023 22:13:08 -0400 Subject: [PATCH 034/473] Add Guild.get_emoji helper --- discord/guild.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/discord/guild.py b/discord/guild.py index f80429173..596c6865c 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -737,6 +737,26 @@ class Guild(Hashable): """ return self._threads.get(thread_id) + def get_emoji(self, emoji_id: int, /) -> Optional[Emoji]: + """Returns an emoji with the given ID. + + .. versionadded:: 2.3 + + Parameters + ---------- + emoji_id: int + The ID to search for. + + Returns + -------- + Optional[:class:`Emoji`] + The returned Emoji or ``None`` if not found. + """ + emoji = self._state.get_emoji(emoji_id) + if emoji and emoji.guild == self: + return emoji + return None + @property def system_channel(self) -> Optional[TextChannel]: """Optional[:class:`TextChannel`]: Returns the guild's channel used for system messages. From 7db197ef250bd397fd20e0a338cf35044a5e2751 Mon Sep 17 00:00:00 2001 From: Puncher <65789180+Puncher1@users.noreply.github.com> Date: Mon, 13 Mar 2023 03:17:48 +0100 Subject: [PATCH 035/473] Add default_reaction_emoji and default_forum_layout to create_forum --- discord/guild.py | 36 ++++++++++++++++++++++++++++++++---- discord/http.py | 2 ++ 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/discord/guild.py b/discord/guild.py index 596c6865c..02a932edc 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -74,6 +74,7 @@ from .enums import ( Locale, AutoModRuleEventType, ForumOrderType, + ForumLayoutType, ) from .mixins import Hashable from .user import User @@ -91,6 +92,7 @@ from .audit_logs import AuditLogEntry from .object import OLDEST_OBJECT, Object from .welcome_screen import WelcomeScreen, WelcomeChannel from .automod import AutoModRule, AutoModTrigger, AutoModRuleAction +from .partial_emoji import _EmojiTag, PartialEmoji __all__ = ( @@ -130,6 +132,7 @@ if TYPE_CHECKING: from .types.integration import IntegrationType from .types.snowflake import SnowflakeList from .types.widget import EditWidgetSettings + from .message import EmojiInputType VocalGuildChannel = Union[VoiceChannel, StageChannel] GuildChannel = Union[VocalGuildChannel, ForumChannel, TextChannel, CategoryChannel] @@ -1605,7 +1608,9 @@ class Guild(Hashable): reason: Optional[str] = None, default_auto_archive_duration: int = MISSING, default_thread_slowmode_delay: int = MISSING, - default_sort_order: Optional[ForumOrderType] = None, + default_sort_order: Optional[ForumOrderType] = MISSING, + default_reaction_emoji: Optional[EmojiInputType] = MISSING, + default_layout: Optional[ForumLayoutType] = MISSING, available_tags: Sequence[ForumTag] = MISSING, ) -> ForumChannel: """|coro| @@ -1653,6 +1658,15 @@ class Guild(Hashable): default_sort_order: Optional[:class:`ForumOrderType`] The default sort order for posts in this forum channel. + .. versionadded:: 2.3 + default_reaction_emoji: Optional[Union[:class:`Emoji`, :class:`PartialEmoji`, :class:`str`]] + The default reaction emoji for threads created in this forum to show in the + add reaction button. + + .. versionadded:: 2.3 + default_layout: Optional[:class:`ForumLayoutType`] + The default layout for posts in this forum. + .. versionadded:: 2.3 available_tags: Sequence[:class:`ForumTag`] The available tags for this forum channel. @@ -1693,9 +1707,7 @@ class Guild(Hashable): if default_thread_slowmode_delay is not MISSING: options['default_thread_rate_limit_per_user'] = default_thread_slowmode_delay - if default_sort_order is None: - options['default_sort_order'] = None - else: + if default_sort_order not in (MISSING, None): if not isinstance(default_sort_order, ForumOrderType): raise TypeError( f'default_sort_order parameter must be a ForumOrderType not {default_sort_order.__class__.__name__}' @@ -1703,6 +1715,22 @@ class Guild(Hashable): options['default_sort_order'] = default_sort_order.value + if default_reaction_emoji not in (MISSING, None): + if isinstance(default_reaction_emoji, _EmojiTag): + options['default_reaction_emoji'] = default_reaction_emoji._to_partial()._to_forum_tag_payload() + elif isinstance(default_reaction_emoji, str): + options['default_reaction_emoji'] = PartialEmoji.from_str(default_reaction_emoji)._to_forum_tag_payload() + else: + raise ValueError(f'default_reaction_emoji parameter must be either Emoji, PartialEmoji, or str') + + if default_layout not in (MISSING, None): + if not isinstance(default_layout, ForumLayoutType): + raise TypeError( + f'default_layout parameter must be a ForumLayoutType not {default_layout.__class__.__name__}' + ) + + options['default_forum_layout'] = default_layout.value + if available_tags is not MISSING: options['available_tags'] = [t.to_dict() for t in available_tags] diff --git a/discord/http.py b/discord/http.py index 86b871650..64f04912a 100644 --- a/discord/http.py +++ b/discord/http.py @@ -1191,6 +1191,8 @@ class HTTPClient: 'default_auto_archive_duration', 'default_thread_rate_limit_per_user', 'default_sort_order', + 'default_reaction_emoji', + 'default_forum_layout', 'available_tags', ) payload.update({k: v for k, v in options.items() if k in valid_keys and v is not None}) From c495762aa67624f1c4e2809f98443fb56f787217 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 12 Mar 2023 22:20:50 -0400 Subject: [PATCH 036/473] Fix Widget.members type docstring --- discord/widget.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/widget.py b/discord/widget.py index 2c46d49ba..2a7c17a21 100644 --- a/discord/widget.py +++ b/discord/widget.py @@ -226,7 +226,7 @@ class Widget: The guild's name. channels: List[:class:`WidgetChannel`] The accessible voice channels in the guild. - members: List[:class:`Member`] + members: List[:class:`WidgetMember`] The online members in the guild. Offline members do not appear in the widget. From 08d668f21b606abe46a9f8c43012441fa5ca8749 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 12 Mar 2023 22:22:42 -0400 Subject: [PATCH 037/473] Fix improper usages of Optional MISSING in create_forum --- discord/guild.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/discord/guild.py b/discord/guild.py index 02a932edc..ac145d679 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1608,9 +1608,9 @@ class Guild(Hashable): reason: Optional[str] = None, default_auto_archive_duration: int = MISSING, default_thread_slowmode_delay: int = MISSING, - default_sort_order: Optional[ForumOrderType] = MISSING, - default_reaction_emoji: Optional[EmojiInputType] = MISSING, - default_layout: Optional[ForumLayoutType] = MISSING, + default_sort_order: ForumOrderType = MISSING, + default_reaction_emoji: EmojiInputType = MISSING, + default_layout: ForumLayoutType = MISSING, available_tags: Sequence[ForumTag] = MISSING, ) -> ForumChannel: """|coro| @@ -1655,16 +1655,16 @@ class Guild(Hashable): The default slowmode delay in seconds for threads created in this forum. .. versionadded:: 2.1 - default_sort_order: Optional[:class:`ForumOrderType`] + default_sort_order: :class:`ForumOrderType` The default sort order for posts in this forum channel. .. versionadded:: 2.3 - default_reaction_emoji: Optional[Union[:class:`Emoji`, :class:`PartialEmoji`, :class:`str`]] + default_reaction_emoji: Union[:class:`Emoji`, :class:`PartialEmoji`, :class:`str`] The default reaction emoji for threads created in this forum to show in the add reaction button. .. versionadded:: 2.3 - default_layout: Optional[:class:`ForumLayoutType`] + default_layout: :class:`ForumLayoutType` The default layout for posts in this forum. .. versionadded:: 2.3 @@ -1707,7 +1707,7 @@ class Guild(Hashable): if default_thread_slowmode_delay is not MISSING: options['default_thread_rate_limit_per_user'] = default_thread_slowmode_delay - if default_sort_order not in (MISSING, None): + if default_sort_order is not MISSING: if not isinstance(default_sort_order, ForumOrderType): raise TypeError( f'default_sort_order parameter must be a ForumOrderType not {default_sort_order.__class__.__name__}' @@ -1715,7 +1715,7 @@ class Guild(Hashable): options['default_sort_order'] = default_sort_order.value - if default_reaction_emoji not in (MISSING, None): + if default_reaction_emoji is not MISSING: if isinstance(default_reaction_emoji, _EmojiTag): options['default_reaction_emoji'] = default_reaction_emoji._to_partial()._to_forum_tag_payload() elif isinstance(default_reaction_emoji, str): @@ -1723,7 +1723,7 @@ class Guild(Hashable): else: raise ValueError(f'default_reaction_emoji parameter must be either Emoji, PartialEmoji, or str') - if default_layout not in (MISSING, None): + if default_layout is not MISSING: if not isinstance(default_layout, ForumLayoutType): raise TypeError( f'default_layout parameter must be a ForumLayoutType not {default_layout.__class__.__name__}' From 8ba830eeb86a52e54c727e71436bfe0e9ea51526 Mon Sep 17 00:00:00 2001 From: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Date: Tue, 14 Mar 2023 07:18:23 +0000 Subject: [PATCH 038/473] Include ssrc parameter when sending a SPEAKING payload As it is a required parameter. Don't unnecessarily send a second SPEAKING payload after connecting to voice We do need to send a SPEAKING payload in order to set our SSRC value after connecting to voice, yet that can be with a `state` of 0 (SpeakingState.none). There is no reason to send 2 packets; one marking ourselves as speaking, and then not speaking. --- discord/gateway.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/discord/gateway.py b/discord/gateway.py index 50b69acf9..162217576 100644 --- a/discord/gateway.py +++ b/discord/gateway.py @@ -915,6 +915,7 @@ class DiscordVoiceWebSocket: 'd': { 'speaking': int(state), 'delay': 0, + 'ssrc': self._connection.ssrc, }, } @@ -990,7 +991,11 @@ class DiscordVoiceWebSocket: async def load_secret_key(self, data: Dict[str, Any]) -> None: _log.debug('received secret key for voice connection') self.secret_key = self._connection.secret_key = data['secret_key'] - await self.speak() + + # Send a speak command with the "not speaking" state. + # This also tells Discord our SSRC value, which Discord requires + # before sending any voice data (and is the real reason why we + # call this here). await self.speak(SpeakingState.none) async def poll_event(self) -> None: From 879c8b9340f882b961db00de95977f3cf47c2305 Mon Sep 17 00:00:00 2001 From: Puncher <65789180+Puncher1@users.noreply.github.com> Date: Tue, 14 Mar 2023 12:34:43 +0100 Subject: [PATCH 039/473] Add overloads for AutoModRuleAction.__init__ --- discord/automod.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/discord/automod.py b/discord/automod.py index b34bec000..84a00c87e 100644 --- a/discord/automod.py +++ b/discord/automod.py @@ -25,7 +25,7 @@ DEALINGS IN THE SOFTWARE. from __future__ import annotations import datetime -from typing import TYPE_CHECKING, Any, Dict, Optional, List, Sequence, Set, Union, Sequence +from typing import TYPE_CHECKING, Any, Dict, Optional, List, Set, Union, Sequence, overload from .enums import AutoModRuleTriggerType, AutoModRuleActionType, AutoModRuleEventType, try_enum from .flags import AutoModPresets @@ -58,6 +58,9 @@ __all__ = ( class AutoModRuleAction: """Represents an auto moderation's rule action. + .. note:: + Only one of ``channel_id``, ``duration``, or ``custom_message`` can be used. + .. versionadded:: 2.0 Attributes @@ -81,6 +84,18 @@ class AutoModRuleAction: __slots__ = ('type', 'channel_id', 'duration', 'custom_message') + @overload + def __init__(self, *, channel_id: Optional[int] = ...) -> None: + ... + + @overload + def __init__(self, *, duration: Optional[datetime.timedelta] = ...) -> None: + ... + + @overload + def __init__(self, *, custom_message: Optional[str] = ...) -> None: + ... + def __init__( self, *, @@ -95,19 +110,17 @@ class AutoModRuleAction: if sum(v is None for v in (channel_id, duration, custom_message)) < 2: raise ValueError('Only one of channel_id, duration, or custom_message can be passed.') + self.type: AutoModRuleActionType = AutoModRuleActionType.block_message if channel_id: self.type = AutoModRuleActionType.send_alert_message elif duration: self.type = AutoModRuleActionType.timeout - else: - self.type = AutoModRuleActionType.block_message def __repr__(self) -> str: return f'' @classmethod def from_data(cls, data: AutoModerationActionPayload) -> Self: - type_ = try_enum(AutoModRuleActionType, data['type']) if data['type'] == AutoModRuleActionType.timeout.value: duration_seconds = data['metadata']['duration_seconds'] return cls(duration=datetime.timedelta(seconds=duration_seconds)) From 7af70ac988addef82ff45422219851493121d2dd Mon Sep 17 00:00:00 2001 From: Puncher <65789180+Puncher1@users.noreply.github.com> Date: Thu, 16 Mar 2023 03:53:31 +0100 Subject: [PATCH 040/473] Add widget_channel and widget_enabled parameters in Guild.edit --- discord/guild.py | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/discord/guild.py b/discord/guild.py index ac145d679..454b5eeb7 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -293,6 +293,7 @@ class Guild(Hashable): 'mfa_level', 'vanity_url_code', 'widget_enabled', + '_widget_channel_id', '_members', '_channels', '_icon', @@ -481,6 +482,7 @@ class Guild(Hashable): self.premium_subscription_count: int = guild.get('premium_subscription_count') or 0 self.vanity_url_code: Optional[str] = guild.get('vanity_url_code') self.widget_enabled: bool = guild.get('widget_enabled', False) + self._widget_channel_id: Optional[int] = utils._get_as_snowflake(guild, 'widget_channel_id') self._system_channel_flags: int = guild.get('system_channel_flags', 0) self.preferred_locale: Locale = try_enum(Locale, guild.get('preferred_locale', 'en-US')) self._discovery_splash: Optional[str] = guild.get('discovery_splash') @@ -799,6 +801,18 @@ class Guild(Hashable): channel_id = self._public_updates_channel_id return channel_id and self._channels.get(channel_id) # type: ignore + @property + def widget_channel(self) -> Optional[Union[TextChannel, ForumChannel, VoiceChannel, StageChannel]]: + """Optional[Union[:class:`TextChannel`, :class:`ForumChannel`, :class:`VoiceChannel`, :class:`StageChannel`]]: Returns + the widget channel of the guild. + + If no channel is set, then this returns ``None``. + + .. versionadded:: 2.3 + """ + channel_id = self._widget_channel_id + return channel_id and self._channels.get(channel_id) # type: ignore + @property def emoji_limit(self) -> int: """:class:`int`: The maximum number of emoji slots this guild has.""" @@ -1803,6 +1817,8 @@ class Guild(Hashable): premium_progress_bar_enabled: bool = MISSING, discoverable: bool = MISSING, invites_disabled: bool = MISSING, + widget_enabled: bool = MISSING, + widget_channel: Optional[Snowflake] = MISSING, ) -> Guild: r"""|coro| @@ -1835,6 +1851,9 @@ class Guild(Hashable): .. versionchanged:: 2.1 The ``discoverable`` and ``invites_disabled`` keyword parameters were added. + .. versionchanged:: 2.3 + The ``widget_enabled`` and ``widget_channel`` keyword parameters were added. + Parameters ---------- name: :class:`str` @@ -1898,6 +1917,10 @@ class Guild(Hashable): Whether server discovery is enabled for this guild. invites_disabled: :class:`bool` Whether joining via invites should be disabled for the guild. + widget_enabled: :class:`bool` + Whether to enable the widget for the guild. + widget_channel: Optional[:class:`abc.Snowflake`] + The new widget channel. ``None`` removes the widget channel. reason: Optional[:class:`str`] The reason for editing this guild. Shows up on the audit log. @@ -2049,6 +2072,15 @@ class Guild(Hashable): if premium_progress_bar_enabled is not MISSING: fields['premium_progress_bar_enabled'] = premium_progress_bar_enabled + widget_payload: EditWidgetSettings = {} + if widget_channel is not MISSING: + widget_payload['channel_id'] = None if widget_channel is None else widget_channel.id + if widget_enabled is not MISSING: + widget_payload['enabled'] = widget_enabled + + if widget_payload: + await self._state.http.edit_widget(self.id, payload=widget_payload, reason=reason) + data = await http.edit_guild(self.id, reason=reason, **fields) return Guild(data=data, state=self._state) @@ -3892,7 +3924,7 @@ class Guild(Hashable): ) -> None: """|coro| - Edits the widget of the guild. + Edits the widget of the guild. This can also be done with :attr:`~Guild.edit`. You must have :attr:`~Permissions.manage_guild` to do this. @@ -3920,7 +3952,8 @@ class Guild(Hashable): if enabled is not MISSING: payload['enabled'] = enabled - await self._state.http.edit_widget(self.id, payload=payload, reason=reason) + if payload: + await self._state.http.edit_widget(self.id, payload=payload, reason=reason) async def chunk(self, *, cache: bool = True) -> List[Member]: """|coro| From 2ca1a3a9a48c3cc0da10c7ad2214370903c99970 Mon Sep 17 00:00:00 2001 From: Puncher <65789180+Puncher1@users.noreply.github.com> Date: Thu, 16 Mar 2023 12:15:12 +0100 Subject: [PATCH 041/473] Add mfa_level parameter to Guild.edit --- discord/guild.py | 14 ++++++++++++-- discord/http.py | 6 ++++++ discord/types/guild.py | 4 ++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/discord/guild.py b/discord/guild.py index 454b5eeb7..a8fce7644 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1819,6 +1819,7 @@ class Guild(Hashable): invites_disabled: bool = MISSING, widget_enabled: bool = MISSING, widget_channel: Optional[Snowflake] = MISSING, + mfa_level: MFALevel = MISSING, ) -> Guild: r"""|coro| @@ -1852,7 +1853,7 @@ class Guild(Hashable): The ``discoverable`` and ``invites_disabled`` keyword parameters were added. .. versionchanged:: 2.3 - The ``widget_enabled`` and ``widget_channel`` keyword parameters were added. + The ``widget_enabled``, ``widget_channel``, and ``mfa_level`` keyword parameters were added. Parameters ---------- @@ -1923,6 +1924,9 @@ class Guild(Hashable): The new widget channel. ``None`` removes the widget channel. reason: Optional[:class:`str`] The reason for editing this guild. Shows up on the audit log. + mfa_level: :class:`MFALevel` + The new guild’s Multi-Factor Authentication requirement level. + Note that you must be owner of the guild to do this. Raises ------- @@ -1936,7 +1940,7 @@ class Guild(Hashable): guild and request an ownership transfer. TypeError The type passed to the ``default_notifications``, ``verification_level``, - ``explicit_content_filter``, or ``system_channel_flags`` parameter was + ``explicit_content_filter``, ``system_channel_flags``, or ``mfa_level`` parameter was of the incorrect type. Returns @@ -2081,6 +2085,12 @@ class Guild(Hashable): if widget_payload: await self._state.http.edit_widget(self.id, payload=widget_payload, reason=reason) + if mfa_level is not MISSING: + if not isinstance(mfa_level, MFALevel): + raise TypeError(f'mfa_level must be of type MFALevel not {mfa_level.__class__.__name__}') + + await http.edit_guild_mfa_level(self.id, mfa_level=mfa_level.value) + data = await http.edit_guild(self.id, reason=reason, **fields) return Guild(data=data, state=self._state) diff --git a/discord/http.py b/discord/http.py index 64f04912a..22336b323 100644 --- a/discord/http.py +++ b/discord/http.py @@ -1432,6 +1432,12 @@ class HTTPClient: return self.request(Route('PATCH', '/guilds/{guild_id}', guild_id=guild_id), json=payload, reason=reason) + def edit_guild_mfa_level( + self, guild_id: Snowflake, *, mfa_level: int, reason: Optional[str] = None + ) -> Response[guild.GuildMFALevel]: + payload = {'level': mfa_level} + return self.request(Route('POST', '/guilds/{guild_id}/mfa', guild_id=guild_id), json=payload, reason=reason) + def get_template(self, code: str) -> Response[template.Template]: return self.request(Route('GET', '/guilds/templates/{code}', code=code)) diff --git a/discord/types/guild.py b/discord/types/guild.py index b6c2a1365..1ff2854aa 100644 --- a/discord/types/guild.py +++ b/discord/types/guild.py @@ -161,6 +161,10 @@ class GuildPrune(TypedDict): pruned: Optional[int] +class GuildMFALevel(TypedDict): + level: MFALevel + + class ChannelPositionUpdate(TypedDict): id: Snowflake position: Optional[int] From 064cbd11254e0862e4637093b969cf6cdb020608 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Fri, 17 Mar 2023 18:02:02 -0400 Subject: [PATCH 042/473] Clean up Guild.edit documentation --- discord/guild.py | 48 +++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/discord/guild.py b/discord/guild.py index a8fce7644..0f91eebe1 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1827,12 +1827,6 @@ class Guild(Hashable): You must have :attr:`~Permissions.manage_guild` to edit the guild. - .. versionchanged:: 1.4 - The ``rules_channel`` and ``public_updates_channel`` keyword parameters were added. - - .. versionchanged:: 2.0 - The ``discovery_splash`` and ``community`` keyword parameters were added. - .. versionchanged:: 2.0 The newly updated guild is returned. @@ -1843,18 +1837,6 @@ class Guild(Hashable): This function will now raise :exc:`TypeError` or :exc:`ValueError` instead of ``InvalidArgument``. - .. versionchanged:: 2.0 - The ``preferred_locale`` keyword parameter now accepts an enum instead of :class:`str`. - - .. versionchanged:: 2.0 - The ``premium_progress_bar_enabled`` keyword parameter was added. - - .. versionchanged:: 2.1 - The ``discoverable`` and ``invites_disabled`` keyword parameters were added. - - .. versionchanged:: 2.3 - The ``widget_enabled``, ``widget_channel``, and ``mfa_level`` keyword parameters were added. - Parameters ---------- name: :class:`str` @@ -1880,9 +1862,13 @@ class Guild(Hashable): Only PNG/JPEG supported. Could be ``None`` to denote removing the splash. This is only available to guilds that contain ``DISCOVERABLE`` in :attr:`Guild.features`. + + .. versionadded:: 2.0 community: :class:`bool` Whether the guild should be a Community guild. If set to ``True``\, both ``rules_channel`` and ``public_updates_channel`` parameters are required. + + .. versionadded:: 2.0 afk_channel: Optional[:class:`VoiceChannel`] The new channel that is the AFK channel. Could be ``None`` for no AFK channel. afk_timeout: :class:`int` @@ -1904,30 +1890,50 @@ class Guild(Hashable): The new system channel settings to use with the new system channel. preferred_locale: :class:`Locale` The new preferred locale for the guild. Used as the primary language in the guild. + + .. versionchanged:: 2.0 + + Now accepts an enum instead of :class:`str`. rules_channel: Optional[:class:`TextChannel`] The new channel that is used for rules. This is only available to guilds that contain ``COMMUNITY`` in :attr:`Guild.features`. Could be ``None`` for no rules channel. + + .. versionadded:: 1.4 public_updates_channel: Optional[:class:`TextChannel`] The new channel that is used for public updates from Discord. This is only available to guilds that contain ``COMMUNITY`` in :attr:`Guild.features`. Could be ``None`` for no public updates channel. + + .. versionadded:: 1.4 premium_progress_bar_enabled: :class:`bool` Whether the premium AKA server boost level progress bar should be enabled for the guild. + + .. versionadded:: 2.0 discoverable: :class:`bool` Whether server discovery is enabled for this guild. + + .. versionadded:: 2.1 invites_disabled: :class:`bool` Whether joining via invites should be disabled for the guild. + + .. versionadded:: 2.1 widget_enabled: :class:`bool` Whether to enable the widget for the guild. + + .. versionadded:: 2.3 widget_channel: Optional[:class:`abc.Snowflake`] The new widget channel. ``None`` removes the widget channel. - reason: Optional[:class:`str`] - The reason for editing this guild. Shows up on the audit log. + + .. versionadded:: 2.3 mfa_level: :class:`MFALevel` - The new guild’s Multi-Factor Authentication requirement level. + The new guild's Multi-Factor Authentication requirement level. Note that you must be owner of the guild to do this. + .. versionadded:: 2.3 + reason: Optional[:class:`str`] + The reason for editing this guild. Shows up on the audit log. + Raises ------- Forbidden From bb7668f8a58ba4b8161edeb77f8936ff807d6537 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Fri, 24 Mar 2023 04:12:47 -0400 Subject: [PATCH 043/473] Upgrade Message.guild references if None in Interaction --- discord/interactions.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/discord/interactions.py b/discord/interactions.py index d2b900d3d..f9ed7976d 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -195,6 +195,11 @@ class Interaction(Generic[ClientT]): if self.guild_id: guild = self._state._get_or_create_unavailable_guild(self.guild_id) + + # Upgrade Message.guild in case it's missing with partial guild data + if self.message is not None and self.message.guild is None: + self.message.guild = guild + try: member = data['member'] # type: ignore # The key is optional and handled except KeyError: From ebc1bc3cbb2bccc66d9cb7fd97944507b4105303 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 28 Mar 2023 04:10:59 -0400 Subject: [PATCH 044/473] Fix crash from Discord sending null channel_id for automod audit logs --- discord/audit_logs.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/discord/audit_logs.py b/discord/audit_logs.py index fe51b6106..47f397a8a 100644 --- a/discord/audit_logs.py +++ b/discord/audit_logs.py @@ -521,7 +521,7 @@ class _AuditLogProxyMessageBulkDelete(_AuditLogProxy): class _AuditLogProxyAutoModAction(_AuditLogProxy): automod_rule_name: str automod_rule_trigger_type: str - channel: Union[abc.GuildChannel, Thread] + channel: Optional[Union[abc.GuildChannel, Thread]] class AuditLogEntry(Hashable): @@ -644,13 +644,17 @@ class AuditLogEntry(Hashable): or self.action is enums.AuditLogAction.automod_flag_message or self.action is enums.AuditLogAction.automod_timeout_member ): - channel_id = int(extra['channel_id']) + channel_id = utils._get_as_snowflake(extra, 'channel_id') + channel = None + if channel_id is not None: + channel = self.guild.get_channel_or_thread(channel_id) or Object(id=channel_id) + self.extra = _AuditLogProxyAutoModAction( automod_rule_name=extra['auto_moderation_rule_name'], automod_rule_trigger_type=enums.try_enum( enums.AutoModRuleTriggerType, extra['auto_moderation_rule_trigger_type'] ), - channel=self.guild.get_channel_or_thread(channel_id) or Object(id=channel_id), + channel=channel, ) elif self.action.name.startswith('overwrite_'): From e3e0d93dd976e43774cde6309529121752eb9933 Mon Sep 17 00:00:00 2001 From: Andrin S <65789180+Puncher1@users.noreply.github.com> Date: Wed, 29 Mar 2023 03:52:11 +0200 Subject: [PATCH 045/473] Add new use_soundboard and manage_guild_expressions permissions --- discord/permissions.py | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/discord/permissions.py b/discord/permissions.py index 74c7173e4..cb92041f0 100644 --- a/discord/permissions.py +++ b/discord/permissions.py @@ -177,7 +177,7 @@ class Permissions(BaseFlags): """A factory method that creates a :class:`Permissions` with all permissions set to ``True``. """ - return cls(0b11111111111111111111111111111111111111111) + return cls(0b1111111111111111111111111111111111111111111) @classmethod def _timeout_mask(cls) -> int: @@ -204,7 +204,7 @@ class Permissions(BaseFlags): ``True`` and the guild-specific ones set to ``False``. The guild-specific permissions are currently: - - :attr:`manage_emojis` + - :attr:`manage_guild_expressions` - :attr:`view_audit_log` - :attr:`view_guild_insights` - :attr:`manage_guild` @@ -221,8 +221,11 @@ class Permissions(BaseFlags): Added :attr:`create_public_threads`, :attr:`create_private_threads`, :attr:`manage_threads`, :attr:`use_external_stickers`, :attr:`send_messages_in_threads` and :attr:`request_to_speak` permissions. + + .. versionchanged:: 2.3 + Added :attr:`use_soundboard` """ - return cls(0b111110110110011111101111111111101010001) + return cls(0b1000111110110110011111101111111111101010001) @classmethod def general(cls) -> Self: @@ -265,7 +268,7 @@ class Permissions(BaseFlags): def voice(cls) -> Self: """A factory method that creates a :class:`Permissions` with all "Voice" permissions from the official Discord UI set to ``True``.""" - return cls(0b1000000000000011111100000000001100000000) + return cls(0b1001000000000000011111100000000001100000000) @classmethod def stage(cls) -> Self: @@ -305,7 +308,7 @@ class Permissions(BaseFlags): - :attr:`manage_messages` - :attr:`manage_roles` - :attr:`manage_webhooks` - - :attr:`manage_emojis_and_stickers` + - :attr:`manage_guild_expressions` - :attr:`manage_threads` - :attr:`moderate_members` @@ -544,13 +547,21 @@ class Permissions(BaseFlags): return 1 << 29 @flag_value + def manage_guild_expressions(self) -> int: + """:class:`bool`: Returns ``True`` if a user can create, edit, or delete emojis, stickers, and soundboard sounds. + + .. versionadded:: 2.3 + """ + return 1 << 30 + + @make_permission_alias('manage_guild_expressions') def manage_emojis(self) -> int: - """:class:`bool`: Returns ``True`` if a user can create, edit, or delete emojis.""" + """:class:`bool`: An alias for :attr:`manage_guild_expressions`.""" return 1 << 30 - @make_permission_alias('manage_emojis') + @make_permission_alias('manage_guild_expressions') def manage_emojis_and_stickers(self) -> int: - """:class:`bool`: An alias for :attr:`manage_emojis`. + """:class:`bool`: An alias for :attr:`manage_guild_expressions`. .. versionadded:: 2.0 """ @@ -644,6 +655,14 @@ class Permissions(BaseFlags): """ return 1 << 40 + @flag_value + def use_soundboard(self) -> int: + """:class:`bool`: Returns ``True`` if a user can use the soundboard. + + .. versionadded:: 2.3 + """ + return 1 << 42 + def _augment_from_permissions(cls): cls.VALID_NAMES = set(Permissions.VALID_FLAGS) @@ -745,6 +764,7 @@ class PermissionOverwrite: manage_roles: Optional[bool] manage_permissions: Optional[bool] manage_webhooks: Optional[bool] + manage_guild_expressions: Optional[bool] manage_emojis: Optional[bool] manage_emojis_and_stickers: Optional[bool] use_application_commands: Optional[bool] @@ -758,6 +778,7 @@ class PermissionOverwrite: use_external_stickers: Optional[bool] use_embedded_activities: Optional[bool] moderate_members: Optional[bool] + use_soundboard: Optional[bool] def __init__(self, **kwargs: Optional[bool]): self._values: Dict[str, Optional[bool]] = {} From 53de3f9cbb9a2a5ee748a17829403e24a3c00b2b Mon Sep 17 00:00:00 2001 From: scruz Date: Thu, 30 Mar 2023 15:35:53 +0300 Subject: [PATCH 046/473] Fix return types in sync.py docstring --- discord/webhook/sync.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/discord/webhook/sync.py b/discord/webhook/sync.py index 3128246f2..71564a58d 100644 --- a/discord/webhook/sync.py +++ b/discord/webhook/sync.py @@ -636,9 +636,9 @@ class SyncWebhook(BaseWebhook): Returns -------- - :class:`Webhook` - A partial :class:`Webhook`. - A partial webhook is just a webhook object with an ID and a token. + :class:`SyncWebhook` + A partial :class:`SyncWebhook`. + A partial :class:`SyncWebhook` is just a :class:`SyncWebhook` object with an ID and a token. """ data: WebhookPayload = { 'id': id, @@ -678,9 +678,9 @@ class SyncWebhook(BaseWebhook): Returns -------- - :class:`Webhook` - A partial :class:`Webhook`. - A partial webhook is just a webhook object with an ID and a token. + :class:`SyncWebhook` + A partial :class:`SyncWebhook`. + A partial :class:`SyncWebhook` is just a :class:`SyncWebhook` object with an ID and a token. """ m = re.search(r'discord(?:app)?\.com/api/webhooks/(?P[0-9]{17,20})/(?P[A-Za-z0-9\.\-\_]{60,68})', url) if m is None: From 2ddb9d22baeb762f5c050b434c7e3da629206fbb Mon Sep 17 00:00:00 2001 From: Andrin S <65789180+Puncher1@users.noreply.github.com> Date: Thu, 30 Mar 2023 14:36:33 +0200 Subject: [PATCH 047/473] Add overloads to reply and send --- discord/ext/commands/context.py | 170 +++++++++++++++++++++++++++++++- discord/message.py | 82 ++++++++++++++- 2 files changed, 250 insertions(+), 2 deletions(-) diff --git a/discord/ext/commands/context.py b/discord/ext/commands/context.py index 8c1f7212d..92a1a6b51 100644 --- a/discord/ext/commands/context.py +++ b/discord/ext/commands/context.py @@ -24,7 +24,7 @@ DEALINGS IN THE SOFTWARE. from __future__ import annotations import re -from typing import TYPE_CHECKING, Any, Dict, Generator, Generic, List, Optional, TypeVar, Union, Sequence, Type +from typing import TYPE_CHECKING, Any, Dict, Generator, Generic, List, Optional, TypeVar, Union, Sequence, Type, overload import discord.abc import discord.utils @@ -615,6 +615,90 @@ class Context(discord.abc.Messageable, Generic[BotT]): except CommandError as e: await cmd.on_help_command_error(self, e) + @overload + async def reply( + self, + content: Optional[str] = ..., + *, + tts: bool = ..., + embed: Embed = ..., + file: File = ..., + stickers: Sequence[Union[GuildSticker, StickerItem]] = ..., + delete_after: float = ..., + nonce: Union[str, int] = ..., + allowed_mentions: AllowedMentions = ..., + reference: Union[Message, MessageReference, PartialMessage] = ..., + mention_author: bool = ..., + view: View = ..., + suppress_embeds: bool = ..., + ephemeral: bool = ..., + silent: bool = ..., + ) -> Message: + ... + + @overload + async def reply( + self, + content: Optional[str] = ..., + *, + tts: bool = ..., + embed: Embed = ..., + files: Sequence[File] = ..., + stickers: Sequence[Union[GuildSticker, StickerItem]] = ..., + delete_after: float = ..., + nonce: Union[str, int] = ..., + allowed_mentions: AllowedMentions = ..., + reference: Union[Message, MessageReference, PartialMessage] = ..., + mention_author: bool = ..., + view: View = ..., + suppress_embeds: bool = ..., + ephemeral: bool = ..., + silent: bool = ..., + ) -> Message: + ... + + @overload + async def reply( + self, + content: Optional[str] = ..., + *, + tts: bool = ..., + embeds: Sequence[Embed] = ..., + file: File = ..., + stickers: Sequence[Union[GuildSticker, StickerItem]] = ..., + delete_after: float = ..., + nonce: Union[str, int] = ..., + allowed_mentions: AllowedMentions = ..., + reference: Union[Message, MessageReference, PartialMessage] = ..., + mention_author: bool = ..., + view: View = ..., + suppress_embeds: bool = ..., + ephemeral: bool = ..., + silent: bool = ..., + ) -> Message: + ... + + @overload + async def reply( + self, + content: Optional[str] = ..., + *, + tts: bool = ..., + embeds: Sequence[Embed] = ..., + files: Sequence[File] = ..., + stickers: Sequence[Union[GuildSticker, StickerItem]] = ..., + delete_after: float = ..., + nonce: Union[str, int] = ..., + allowed_mentions: AllowedMentions = ..., + reference: Union[Message, MessageReference, PartialMessage] = ..., + mention_author: bool = ..., + view: View = ..., + suppress_embeds: bool = ..., + ephemeral: bool = ..., + silent: bool = ..., + ) -> Message: + ... + async def reply(self, content: Optional[str] = None, **kwargs: Any) -> Message: """|coro| @@ -716,6 +800,90 @@ class Context(discord.abc.Messageable, Generic[BotT]): if self.interaction: await self.interaction.response.defer(ephemeral=ephemeral) + @overload + async def send( + self, + content: Optional[str] = ..., + *, + tts: bool = ..., + embed: Embed = ..., + file: File = ..., + stickers: Sequence[Union[GuildSticker, StickerItem]] = ..., + delete_after: float = ..., + nonce: Union[str, int] = ..., + allowed_mentions: AllowedMentions = ..., + reference: Union[Message, MessageReference, PartialMessage] = ..., + mention_author: bool = ..., + view: View = ..., + suppress_embeds: bool = ..., + ephemeral: bool = ..., + silent: bool = ..., + ) -> Message: + ... + + @overload + async def send( + self, + content: Optional[str] = ..., + *, + tts: bool = ..., + embed: Embed = ..., + files: Sequence[File] = ..., + stickers: Sequence[Union[GuildSticker, StickerItem]] = ..., + delete_after: float = ..., + nonce: Union[str, int] = ..., + allowed_mentions: AllowedMentions = ..., + reference: Union[Message, MessageReference, PartialMessage] = ..., + mention_author: bool = ..., + view: View = ..., + suppress_embeds: bool = ..., + ephemeral: bool = ..., + silent: bool = ..., + ) -> Message: + ... + + @overload + async def send( + self, + content: Optional[str] = ..., + *, + tts: bool = ..., + embeds: Sequence[Embed] = ..., + file: File = ..., + stickers: Sequence[Union[GuildSticker, StickerItem]] = ..., + delete_after: float = ..., + nonce: Union[str, int] = ..., + allowed_mentions: AllowedMentions = ..., + reference: Union[Message, MessageReference, PartialMessage] = ..., + mention_author: bool = ..., + view: View = ..., + suppress_embeds: bool = ..., + ephemeral: bool = ..., + silent: bool = ..., + ) -> Message: + ... + + @overload + async def send( + self, + content: Optional[str] = ..., + *, + tts: bool = ..., + embeds: Sequence[Embed] = ..., + files: Sequence[File] = ..., + stickers: Sequence[Union[GuildSticker, StickerItem]] = ..., + delete_after: float = ..., + nonce: Union[str, int] = ..., + allowed_mentions: AllowedMentions = ..., + reference: Union[Message, MessageReference, PartialMessage] = ..., + mention_author: bool = ..., + view: View = ..., + suppress_embeds: bool = ..., + ephemeral: bool = ..., + silent: bool = ..., + ) -> Message: + ... + async def send( self, content: Optional[str] = None, diff --git a/discord/message.py b/discord/message.py index 719cb9697..8c9b732f5 100644 --- a/discord/message.py +++ b/discord/message.py @@ -60,7 +60,7 @@ from .utils import escape_mentions, MISSING from .http import handle_message_parameters from .guild import Guild from .mixins import Hashable -from .sticker import StickerItem +from .sticker import StickerItem, GuildSticker from .threads import Thread from .channel import PartialMessageable @@ -1254,6 +1254,86 @@ class PartialMessage(Hashable): ) return Thread(guild=self.guild, state=self._state, data=data) + @overload + async def reply( + self, + content: Optional[str] = ..., + *, + tts: bool = ..., + embed: Embed = ..., + file: File = ..., + stickers: Sequence[Union[GuildSticker, StickerItem]] = ..., + delete_after: float = ..., + nonce: Union[str, int] = ..., + allowed_mentions: AllowedMentions = ..., + reference: Union[Message, MessageReference, PartialMessage] = ..., + mention_author: bool = ..., + view: View = ..., + suppress_embeds: bool = ..., + silent: bool = ..., + ) -> Message: + ... + + @overload + async def reply( + self, + content: Optional[str] = ..., + *, + tts: bool = ..., + embed: Embed = ..., + files: Sequence[File] = ..., + stickers: Sequence[Union[GuildSticker, StickerItem]] = ..., + delete_after: float = ..., + nonce: Union[str, int] = ..., + allowed_mentions: AllowedMentions = ..., + reference: Union[Message, MessageReference, PartialMessage] = ..., + mention_author: bool = ..., + view: View = ..., + suppress_embeds: bool = ..., + silent: bool = ..., + ) -> Message: + ... + + @overload + async def reply( + self, + content: Optional[str] = ..., + *, + tts: bool = ..., + embeds: Sequence[Embed] = ..., + file: File = ..., + stickers: Sequence[Union[GuildSticker, StickerItem]] = ..., + delete_after: float = ..., + nonce: Union[str, int] = ..., + allowed_mentions: AllowedMentions = ..., + reference: Union[Message, MessageReference, PartialMessage] = ..., + mention_author: bool = ..., + view: View = ..., + suppress_embeds: bool = ..., + silent: bool = ..., + ) -> Message: + ... + + @overload + async def reply( + self, + content: Optional[str] = ..., + *, + tts: bool = ..., + embeds: Sequence[Embed] = ..., + files: Sequence[File] = ..., + stickers: Sequence[Union[GuildSticker, StickerItem]] = ..., + delete_after: float = ..., + nonce: Union[str, int] = ..., + allowed_mentions: AllowedMentions = ..., + reference: Union[Message, MessageReference, PartialMessage] = ..., + mention_author: bool = ..., + view: View = ..., + suppress_embeds: bool = ..., + silent: bool = ..., + ) -> Message: + ... + async def reply(self, content: Optional[str] = None, **kwargs: Any) -> Message: """|coro| From 4828355f9ea4be18abad7067217236a90d0e22ba Mon Sep 17 00:00:00 2001 From: Andrin S <65789180+Puncher1@users.noreply.github.com> Date: Thu, 30 Mar 2023 14:37:34 +0200 Subject: [PATCH 048/473] Change and add params in AppInfo and PartialAppInfo --- discord/appinfo.py | 42 +++++++++++++++++++++++++++++++++++++++- discord/client.py | 2 -- discord/types/appinfo.py | 17 ++++++++-------- 3 files changed, 50 insertions(+), 11 deletions(-) diff --git a/discord/appinfo.py b/discord/appinfo.py index 18c97228b..129e543cb 100644 --- a/discord/appinfo.py +++ b/discord/appinfo.py @@ -166,7 +166,7 @@ class AppInfo: self.name: str = data['name'] self.description: str = data['description'] self._icon: Optional[str] = data['icon'] - self.rpc_origins: List[str] = data['rpc_origins'] + self.rpc_origins: Optional[List[str]] = data.get('rpc_origins') self.bot_public: bool = data['bot_public'] self.bot_require_code_grant: bool = data['bot_require_code_grant'] self.owner: User = state.create_user(data['owner']) @@ -255,6 +255,24 @@ class PartialAppInfo: The application's terms of service URL, if set. privacy_policy_url: Optional[:class:`str`] The application's privacy policy URL, if set. + approximate_guild_count: :class:`int` + The approximate count of the guilds the bot was added to. + + .. versionadded:: 2.3 + redirect_uris: List[:class:`str`] + A list of authentication redirect URIs. + + .. versionadded:: 2.3 + interactions_endpoint_url: Optional[:class:`str`] + The interactions endpoint url of the application to receive interactions over this endpoint rather than + over the gateway, if configured. + + .. versionadded:: 2.3 + role_connections_verification_url: Optional[:class:`str`] + The application's connection verification URL which will render the application as + a verification method in the guild's role verification configuration. + + .. versionadded:: 2.3 """ __slots__ = ( @@ -268,6 +286,11 @@ class PartialAppInfo: 'privacy_policy_url', '_icon', '_flags', + '_cover_image', + 'approximate_guild_count', + 'redirect_uris', + 'interactions_endpoint_url', + 'role_connections_verification_url', ) def __init__(self, *, state: ConnectionState, data: PartialAppInfoPayload): @@ -276,11 +299,16 @@ class PartialAppInfo: self.name: str = data['name'] self._icon: Optional[str] = data.get('icon') self._flags: int = data.get('flags', 0) + self._cover_image: Optional[str] = data.get('cover_image') self.description: str = data['description'] self.rpc_origins: Optional[List[str]] = data.get('rpc_origins') self.verify_key: str = data['verify_key'] self.terms_of_service_url: Optional[str] = data.get('terms_of_service_url') self.privacy_policy_url: Optional[str] = data.get('privacy_policy_url') + self.approximate_guild_count: int = data.get('approximate_guild_count', 0) + self.redirect_uris: List[str] = data.get('redirect_uris', []) + self.interactions_endpoint_url: Optional[str] = data.get('interactions_endpoint_url') + self.role_connections_verification_url: Optional[str] = data.get('role_connections_verification_url') def __repr__(self) -> str: return f'<{self.__class__.__name__} id={self.id} name={self.name!r} description={self.description!r}>' @@ -292,6 +320,18 @@ class PartialAppInfo: return None return Asset._from_icon(self._state, self.id, self._icon, path='app') + @property + def cover_image(self) -> Optional[Asset]: + """Optional[:class:`.Asset`]: Retrieves the cover image of the application's default rich presence. + + This is only available if the application is a game sold on Discord. + + .. versionadded:: 2.3 + """ + if self._cover_image is None: + return None + return Asset._from_cover_image(self._state, self.id, self._cover_image) + @property def flags(self) -> ApplicationFlags: """:class:`ApplicationFlags`: The application's flags. diff --git a/discord/client.py b/discord/client.py index a3b76b32a..298959b21 100644 --- a/discord/client.py +++ b/discord/client.py @@ -2486,8 +2486,6 @@ class Client: The bot's application information. """ data = await self.http.application_info() - if 'rpc_origins' not in data: - data['rpc_origins'] = None return AppInfo(self._connection, data) async def fetch_user(self, user_id: int, /) -> User: diff --git a/discord/types/appinfo.py b/discord/types/appinfo.py index 640fe1be7..87bafc6d2 100644 --- a/discord/types/appinfo.py +++ b/discord/types/appinfo.py @@ -44,10 +44,14 @@ class BaseAppInfo(TypedDict): icon: Optional[str] summary: str description: str + flags: int + cover_image: NotRequired[str] + terms_of_service_url: NotRequired[str] + privacy_policy_url: NotRequired[str] + rpc_origins: NotRequired[List[str]] class AppInfo(BaseAppInfo): - rpc_origins: List[str] owner: User bot_public: bool bot_require_code_grant: bool @@ -55,8 +59,6 @@ class AppInfo(BaseAppInfo): guild_id: NotRequired[Snowflake] primary_sku_id: NotRequired[Snowflake] slug: NotRequired[str] - terms_of_service_url: NotRequired[str] - privacy_policy_url: NotRequired[str] hook: NotRequired[bool] max_participants: NotRequired[int] tags: NotRequired[List[str]] @@ -66,13 +68,12 @@ class AppInfo(BaseAppInfo): class PartialAppInfo(BaseAppInfo, total=False): - rpc_origins: List[str] - cover_image: str hook: bool - terms_of_service_url: str - privacy_policy_url: str max_participants: int - flags: int + approximate_guild_count: int + redirect_uris: List[str] + interactions_endpoint_url: Optional[str] + role_connections_verification_url: Optional[str] class GatewayAppInfo(TypedDict): From ee9e54983619bf711e52fb48b46694f8c78c4ef7 Mon Sep 17 00:00:00 2001 From: Andrin S <65789180+Puncher1@users.noreply.github.com> Date: Sat, 1 Apr 2023 03:03:47 +0200 Subject: [PATCH 049/473] Add use_external_sounds permission --- discord/permissions.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/discord/permissions.py b/discord/permissions.py index cb92041f0..9716f07c6 100644 --- a/discord/permissions.py +++ b/discord/permissions.py @@ -177,7 +177,7 @@ class Permissions(BaseFlags): """A factory method that creates a :class:`Permissions` with all permissions set to ``True``. """ - return cls(0b1111111111111111111111111111111111111111111) + return cls(0b1111111111111111111111111111111111111111111111) @classmethod def _timeout_mask(cls) -> int: @@ -268,7 +268,7 @@ class Permissions(BaseFlags): def voice(cls) -> Self: """A factory method that creates a :class:`Permissions` with all "Voice" permissions from the official Discord UI set to ``True``.""" - return cls(0b1001000000000000011111100000000001100000000) + return cls(0b1001001000000000000011111100000000001100000000) @classmethod def stage(cls) -> Self: @@ -663,6 +663,14 @@ class Permissions(BaseFlags): """ return 1 << 42 + @flag_value + def use_external_sounds(self) -> int: + """:class:`bool`: Returns ``True`` if a user can use sounds from other guilds. + + .. versionadded:: 2.3 + """ + return 1 << 45 + def _augment_from_permissions(cls): cls.VALID_NAMES = set(Permissions.VALID_FLAGS) @@ -779,6 +787,7 @@ class PermissionOverwrite: use_embedded_activities: Optional[bool] moderate_members: Optional[bool] use_soundboard: Optional[bool] + use_external_sounds: Optional[bool] def __init__(self, **kwargs: Optional[bool]): self._values: Dict[str, Optional[bool]] = {} From ab287e71b8961cbe245e60ad220b7d0be9fd0b8a Mon Sep 17 00:00:00 2001 From: Vish M Date: Sat, 1 Apr 2023 09:57:00 +0100 Subject: [PATCH 050/473] Fix 'available' KeyError for GuildSticker Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com> --- discord/sticker.py | 2 +- discord/types/sticker.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/sticker.py b/discord/sticker.py index 2872f3663..225e7648a 100644 --- a/discord/sticker.py +++ b/discord/sticker.py @@ -414,7 +414,7 @@ class GuildSticker(Sticker): def _from_data(self, data: GuildStickerPayload) -> None: super()._from_data(data) - self.available: bool = data['available'] + self.available: bool = data.get('available', True) self.guild_id: int = int(data['guild_id']) user = data.get('user') self.user: Optional[User] = self._state.store_user(user) if user else None diff --git a/discord/types/sticker.py b/discord/types/sticker.py index 7dcd0ccba..15fd034a7 100644 --- a/discord/types/sticker.py +++ b/discord/types/sticker.py @@ -55,7 +55,7 @@ class StandardSticker(BaseSticker): class GuildSticker(BaseSticker): type: Literal[2] - available: bool + available: NotRequired[bool] guild_id: Snowflake user: NotRequired[User] From fdf03d4bca0f4a2347e14c224179e6ada8d07748 Mon Sep 17 00:00:00 2001 From: James Hilton-Balfe Date: Tue, 18 Apr 2023 05:11:39 +0100 Subject: [PATCH 051/473] [commands] Use get_role where appropriate in role decorators --- discord/ext/commands/core.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index f3850a224..8140dca00 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -2036,7 +2036,7 @@ def has_role(item: Union[int, str], /) -> Check[Any]: # ctx.guild is None doesn't narrow ctx.author to Member if isinstance(item, int): - role = discord.utils.get(ctx.author.roles, id=item) # type: ignore + role = ctx.author.get_role(item) # type: ignore else: role = discord.utils.get(ctx.author.roles, name=item) # type: ignore if role is None: @@ -2083,8 +2083,12 @@ def has_any_role(*items: Union[int, str]) -> Callable[[T], T]: raise NoPrivateMessage() # ctx.guild is None doesn't narrow ctx.author to Member - getter = functools.partial(discord.utils.get, ctx.author.roles) - if any(getter(id=item) is not None if isinstance(item, int) else getter(name=item) is not None for item in items): + if any( + ctx.author.get_role(item) is not None + if isinstance(item, int) + else discord.utils.get(ctx.author.roles, name=item) is not None + for item in items + ): return True raise MissingAnyRole(list(items)) @@ -2113,11 +2117,10 @@ def bot_has_role(item: int, /) -> Callable[[T], T]: if ctx.guild is None: raise NoPrivateMessage() - me = ctx.me if isinstance(item, int): - role = discord.utils.get(me.roles, id=item) + role = ctx.me.get_role(item) else: - role = discord.utils.get(me.roles, name=item) + role = discord.utils.get(ctx.me.roles, name=item) if role is None: raise BotMissingRole(item) return True @@ -2144,8 +2147,10 @@ def bot_has_any_role(*items: int) -> Callable[[T], T]: raise NoPrivateMessage() me = ctx.me - getter = functools.partial(discord.utils.get, me.roles) - if any(getter(id=item) is not None if isinstance(item, int) else getter(name=item) is not None for item in items): + if any( + me.get_role(item) is not None if isinstance(item, int) else discord.utils.get(me.roles, name=item) is not None + for item in items + ): return True raise BotMissingAnyRole(list(items)) From 2247ffd9b5f4f65e1ee1936781fe1ac84631ccad Mon Sep 17 00:00:00 2001 From: z03h <7235242+z03h@users.noreply.github.com> Date: Mon, 17 Apr 2023 21:36:53 -0700 Subject: [PATCH 052/473] Convert Webhook targets in AuditlogEntry --- discord/audit_logs.py | 12 ++++++++++++ discord/guild.py | 5 +++++ discord/state.py | 1 + 3 files changed, 18 insertions(+) diff --git a/discord/audit_logs.py b/discord/audit_logs.py index 47f397a8a..489e064b7 100644 --- a/discord/audit_logs.py +++ b/discord/audit_logs.py @@ -74,6 +74,7 @@ if TYPE_CHECKING: from .types.automod import AutoModerationTriggerMetadata, AutoModerationAction from .user import User from .app_commands import AppCommand + from .webhook import Webhook TargetType = Union[ Guild, @@ -89,6 +90,9 @@ if TYPE_CHECKING: Object, PartialIntegration, AutoModRule, + ScheduledEvent, + Webhook, + AppCommand, None, ] @@ -580,6 +584,7 @@ class AuditLogEntry(Hashable): integrations: Mapping[int, PartialIntegration], app_commands: Mapping[int, AppCommand], automod_rules: Mapping[int, AutoModRule], + webhooks: Mapping[int, Webhook], data: AuditLogEntryPayload, guild: Guild, ): @@ -589,6 +594,7 @@ class AuditLogEntry(Hashable): self._integrations: Mapping[int, PartialIntegration] = integrations self._app_commands: Mapping[int, AppCommand] = app_commands self._automod_rules: Mapping[int, AutoModRule] = automod_rules + self._webhooks: Mapping[int, Webhook] = webhooks self._from_data(data) def _from_data(self, data: AuditLogEntryPayload) -> None: @@ -845,3 +851,9 @@ class AuditLogEntry(Hashable): def _convert_target_auto_moderation(self, target_id: int) -> Union[AutoModRule, Object]: return self._automod_rules.get(target_id) or Object(target_id, type=AutoModRule) + + def _convert_target_webhook(self, target_id: int) -> Union[Webhook, Object]: + # circular import + from .webhook import Webhook + + return self._webhooks.get(target_id) or Object(target_id, type=Webhook) diff --git a/discord/guild.py b/discord/guild.py index 0f91eebe1..fdf30d6f8 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -3860,6 +3860,7 @@ class Guild(Hashable): # avoid circular import from .app_commands import AppCommand + from .webhook import Webhook while True: retrieve = 100 if limit is None else min(limit, 100) @@ -3886,6 +3887,9 @@ class Guild(Hashable): ) automod_rule_map = {rule.id: rule for rule in automod_rules} + webhooks = (Webhook.from_state(data=raw_webhook, state=self._state) for raw_webhook in data.get('webhooks', [])) + webhook_map = {webhook.id: webhook for webhook in webhooks} + count = 0 for count, raw_entry in enumerate(raw_entries, 1): @@ -3899,6 +3903,7 @@ class Guild(Hashable): integrations=integration_map, app_commands=app_command_map, automod_rules=automod_rule_map, + webhooks=webhook_map, guild=self, ) diff --git a/discord/state.py b/discord/state.py index 8b556f28c..f2f2a0a83 100644 --- a/discord/state.py +++ b/discord/state.py @@ -1108,6 +1108,7 @@ class ConnectionState(Generic[ClientT]): integrations={}, app_commands={}, automod_rules={}, + webhooks={}, data=data, guild=guild, ) From 7f578fde22a93af08e686ec846ae95ab84f034e2 Mon Sep 17 00:00:00 2001 From: Vioshim <63890837+Vioshim@users.noreply.github.com> Date: Mon, 17 Apr 2023 23:53:43 -0500 Subject: [PATCH 053/473] Update base file size limit --- discord/guild.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/discord/guild.py b/discord/guild.py index fdf30d6f8..e86d121ba 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -318,9 +318,9 @@ class Guild(Hashable): ) _PREMIUM_GUILD_LIMITS: ClassVar[Dict[Optional[int], _GuildLimit]] = { - None: _GuildLimit(emoji=50, stickers=5, bitrate=96e3, filesize=8388608), - 0: _GuildLimit(emoji=50, stickers=5, bitrate=96e3, filesize=8388608), - 1: _GuildLimit(emoji=100, stickers=15, bitrate=128e3, filesize=8388608), + None: _GuildLimit(emoji=50, stickers=5, bitrate=96e3, filesize=26214400), + 0: _GuildLimit(emoji=50, stickers=5, bitrate=96e3, filesize=26214400), + 1: _GuildLimit(emoji=100, stickers=15, bitrate=128e3, filesize=26214400), 2: _GuildLimit(emoji=150, stickers=30, bitrate=256e3, filesize=52428800), 3: _GuildLimit(emoji=250, stickers=60, bitrate=384e3, filesize=104857600), } From 9845eb2f9c4ab453eb09363c8ac7191d00f9a127 Mon Sep 17 00:00:00 2001 From: Andrin S <65789180+Puncher1@users.noreply.github.com> Date: Tue, 18 Apr 2023 06:58:07 +0200 Subject: [PATCH 054/473] Update docs on creating bot user --- docs/discord.rst | 7 +------ docs/images/discord_create_bot_user.png | Bin 12522 -> 0 bytes 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 docs/images/discord_create_bot_user.png diff --git a/docs/discord.rst b/docs/discord.rst index ac12417f0..63485138e 100644 --- a/docs/discord.rst +++ b/docs/discord.rst @@ -21,12 +21,7 @@ Creating a Bot account is a pretty straightforward process. .. image:: /images/discord_create_app_form.png :alt: The new application form filled in. -5. Create a Bot User by navigating to the "Bot" tab and clicking "Add Bot". - - - Click "Yes, do it!" to continue. - - .. image:: /images/discord_create_bot_user.png - :alt: The Add Bot button. +5. Navigate to the "Bot" tab to configure it. 6. Make sure that **Public Bot** is ticked if you want others to invite your bot. - You should also make sure that **Require OAuth2 Code Grant** is unchecked unless you diff --git a/docs/images/discord_create_bot_user.png b/docs/images/discord_create_bot_user.png deleted file mode 100644 index b66e64c75eb0dcb1a0701b8e65c21441e7a82763..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12522 zcmd6Nc{~){`>3U;*V>|zqUB9x&tS5XBFU1HEMt_c8HBNoL8-K$?Aez>_GK9B%#at^ z%QAyurm~JPCd(LR40rH$e|_)0fBrt7-<{6~$DDJX?L6Cgp7YAg#6aM$<9~5*a0nP) zziQ6Gv1gb)?%T)1{(WA`{U-Ylr;oY86^_#06D0OOdz^KRbvZaH-tukS-^>1gzt?pu z9}W(|mhB(TcF#`_IXDzT4X^6n39zG#N5$P4O5a)}W-b+hhp-FNy1<6T{U^osk2%Jl zey8x4KEJT8j?O9JmOWml)c+2Ty!>;Iq?2OwiVbOy#G5%5G<1B@Z)3-m0qJ2wuO=+&GV!^5?FBsTk|ER7GcN!$K7=rwI~ z!v4fR2@}{IUEt;v+Z~zlaH;H$viSG7?~Zgt_iamn{RvYPF6Z1GI-auU-W_%7{Eq>A z#pCWj=6^lNJjj%T3 z)g|uLnHY~)2)FfuUZq1aEwB-*Mf5Am)~xhKYs&8O7j{^ngIasrn)p$3!&$9 ze4u@l5g&o84+twqK5RrbNX7K1!Q#{DFTD z^iI@cpoL!Owko|=gB>QQd08!3&nRYV=2T|5|zS_Mmr9w_f2 zo;F2qya1LQKM8NQ0UL7KsKqbK34r`;3DB)XoKS+VYraT%Nw9v4TFs}X5!joD_**q4 z`C736XRTO&gUkd%R2_4W64VB1zoVc!2pPe`eHns1f|_+TFprF!jD%zj#$xJjy^g{vU*&n}s zEFrn=BJJQetB6S`sJmmr+kk;e*7KZIUs?bZE#<$p*P8s^4fFnqzBb~j*fmt?NS-KN z5%tLrku6E4*Iqrm13k+vk}T>jE2MQ!KK@dg(!cGC|wDN6UQR7FLEK7|J z{&f&L*dj0%6zyS@Fyf ztJicyFf&$Q*jvc-Iv=n5W8|h9R0wF9I5zUgRj(idFqwY(Xfyxt6-Q+LrMam8qA9dV zg?vkt7F&q>h=cX*8+NMB>-$^!w7n7d%pAr)#X1>1iFh9-OY;i|#+J!^#wPr!8oug-984Yug z3t4nGSFZ%&JvXIS37HTN^j?uar*X~KRB8<%H`0B5?}H#ww;vHFKXxu16@}tU@S7Vh z)BCg0I*^guONmES(C5#K4+5ralfgJOz6AeMG=*mXPi<+Gkk%>ujewMkJL>RB6ELIc z`NH5r1~%KG#_(7~nCu!cS%?@j!@FU6ApLJ?AxxaW=M{_)QA-Zrs8bRj)>HQ=v(eYQ z?~2iu|FmYH>-SoJB7%La)2}k}?Y`^@ec?ztADp2fM?`4R4fnclZuNFXXYKGWmS)X1yc z$k=Y{b42{`8UMqN*Bws-lB%zFF)W@4%Zma#y7zQC*GSAR*M-)#lTZLv0qX>nVs$*VJclmDERm@)RzvVx}W`8S$|{pI}p z+7$D8G;5ttl}S3fgnjikvM;>tV0rrGi%XlHS}{y|@EL9O#pK}cSdr?;FgC7U(KL4`rOmmRGj$7|zA&M^A*&Ge>bFo0 zD?jIWSEJYJf;Xl`=~Tc{yQy}PCG5&T)uwRsReqkL2!EH^RjNG^+R-V4v>%?5^LG%wXVyd(P z^fP?QK5!w02pe}YV2c2GCFWWmNw}wOd015y#z;FsUccwz!MbWPJ5}hJ5u;AklBL)8 zX<=b4l=Z6%<0fpsqr)}lcqN^t6~zs9{PB{QUEw(9Xg-foWeWD4(NGJ5O>?7HPu@cb=&}oxhoGxwY)*v-R?XxM)1Y z2S63M?-4OCF&FPdMm$F7iodp*88aCnB2KgF4HIkpzr>QVU3=rESAW>1R5o;V<0#|U*YX@aq%1^HTMSX*emg;&k43ZmlnM0bH=u_DX(BMfF#5;(cbWnuHu*D;|cGkB`OepD}m-vX@GlhEX2~4rA+|_)-&{TvLW*dZg7H zslU8}%>WS8y!d>K#Xw}Aupv3Ho7*C^=}2iP>j04`DX>X;lf7)=+r%b>mUQg6!HEo9>;jV9|obxg$eH$FwfM@P`C1wpAKi z1j(%6z}X>Mt6?P_wCn>l^R0@PSayNTJCILx6R(*bYUbZgo8Pl-O7vn$9w?83vF1Vw znE{_e%h@i5^X@$*r%ga>FqIg1hF%_?De~9wnC~V6|5|W(Ve<~*XpIN;poO$O)7EZ$ zViR7$>%Pf(I6P}H=3dhg6|BUfh(tN)o-$B4TDUshk%s#l^e!Z5@xovqZMkA4JjlOW zZMf#N@W%4Ed3d`B7t+PzK)LF`7=7tWmOEO<`3*OR*QN5$ITig8Vri`95gnaG@4JN9 zzNuEq0x@WR0go+7c%j!|<<$q0PB)A(JF_&_yArJ4*C}Bd@wBSSzG<~$W$OnYwg0xj zVj~k>=N+uANueu$XOf-!bIT;yaS&6QbPja3zoFm~E2zSqVk>Wad)mkdmo;w<%7n>l zZfzjttdt)iWn8H-D7~|aUk4G_!qQL>{m zE^%Jbg7sPu2nsr74m8F3t#&n)+k}9Viqk(#T{l(l>LE+BZxPB}g}r{snIY*?;BY0+ zxkMC*ye#+py@GQtJ|m=T-nxxa9~rMZZHXmGJKE5*=5dbx?Y4sK3r8@m3{L>cL`3j9)})5k z`AZt3lEh3ataNS zpeM$Vh-X{+@#7P#t%D(%qu8;=5hQMNhT$SNXqa@nYlh;ixAZmfQ&%?I9GU}{-YS#& zxZ6#E5Jq(kk;zQJ6F}J$_Hkqfd}1E%q;h7RI2inx){jq4C4fVpGwMPXwn8q<4gX{; zBbzs}a=vSc)WJI`o<-^i{0GX|EUmpZWNI!~y#`!xM=TfYjLV0Y;_(^XzIChqaLI*yOBwFeObPaNeSrY9p%BsIsO$eYPG=0Ak+jgE%^&logPC2G=>gQA#dzZ^QQ z{F91*TVwR6Fj+<|=tkfNOy5t&oqy17SkD4@X)SeWJv|6XYCRdk&7qJ{T<+p-?i|fp z45N)i^lwccU22{^zd)4eXbD{#Yw%s+hIh`eoi@%SBtvtem{R9c*JqL$XGz@9P_$nL zzh*3Um`*t-17;RBQyT-!XZ)8pJ>68>6|=`Fq05~G%Z=K{HR4K7+#Q!Zy%+{*Vug8( zeAI3lf4jAyjFx!ENa{H~qJDWYF=f-dJ}TSdsE5WY`?&Z>(>P_B5oYtPD8_Wh=*SxC$Dd=QuiJjOWj5bY7ytcp_AQwQhD%VAp-jfmVfFH_} zU7kBNMPN!f#I`kW{#k`+i16d??%}P#9(#Jx0#>J;#GeL zAiYfY_>tnIDN@#%QV8k^3?n8?ukOmJBWc}zHW)?}9FD#^oc8 zKp4;A4N%nlSfwHk1H#KC52Zm&Wql-942KL0g+N-Z0X&f%UJlzrxOeQnSHMDuLkaR%GLCZIDd+COx;+%*M6KHNLU0wH3oipKNT#d-7K3w zM|k6yFBY7?+T8ufzj&G9JQmy*T9@Li8Y}VuFm3X`2k`!Mts{j62aj)_{KEo)xGY1tVDCdFcnd&B~o3MLbGwplwN8W zg99Il_s;8qku^fTZoW%y|zD4xJ&*i+UJt=b;ma%T*!c z1n`i5$(OOWdb}4F41Sc#62@z9^d%=jB-;~ z&ru@Mn$VJMwDdY=)C4@9+luwiI{BefOpiBOx*ieUw*hZHUsh`FXhN&lX#N0vcd}z; zXala)C^5}eu&2xin-%&v3AK>9)jd3wd?BY~( zpkg2WKN=)5^9*0P5Z_aa));cE+Jn^sF-lb#19GSl$3%hwH&^@K^L|V|N?FJyh#gjK zqkXj8YgGsy(~Rdw~E$OFRf% zW`+vqZ7HUzBV4YETSLH@$A*WbP{HP>)i^3YWT98h9P7=hOY6RN+h99T! zh}TJU6f~PD1pnemCWu<=kGoing$*B{f7W$h79Z3%fdtY+$~RfsKX2npor9vjG~drG z{mIj;X5U-VPS?};#jSZ&-hyNTTHTJJpy}Ar-e30D*1N=Sg+772a&5n~il|*(?egRU z4tKtItUtm{wZbpl-j3b~T|Xgl+UOi}o`3!)fP3N7l*oxy9jc_F{rUo!D-b*+rn{y$qsi zn)<-sep(KirI=p3nK{@$knmI!`I^2HN!~Q)ArvMvf?PlB@P>z{`IlX5Y0)I5>*aza zHh444SpFMvAzCB?bW&i}(U;UES)FDu25YYLHQ3{>&ve3NZrKIHZSbVfzFF!4yzs}Q zQ-1Xh>4d+sz<&O96TwKLzPp~Sgn%iTNEoKbS78`d(3rbewH4xluAbDIuaz5-OAK`1 zPv)H!bPA^A07b+~f>HmHx?}^gf;*dYafCgzx_{t?^AO}<8_<3LQ(Q0MRn&;XzO|*> zjb$mWIF!{v%mnAMWW2ORjXqS>K56US8?+@(1b2-KUC{)zYlFXczv8-oZ6(Z_bnafg z3CjH}EhCg8QTx~pR)U&8kIg5Ks^V)I&3UIE{JQzVP_eH>9=7^AvuMCp^(jq)Kes>h z8b+CAb>eL8zA|m)CY-@KIk&8i6K_ScuJ;3C$lG|U#3g_g>7d4rUVhWJ|$~17`#Y3ITtSa zWQj++$P}EIh@!qLD=C4W?wZZ7({dUzT{g^hJ|1Uwxy|QIxh$0Ck;7xySfqI(zv9hV^{a5;LnJ z?|Je-yR~U;h|xvQ4Z2kYT&i)`3e%)kK&4aC!B`*%$1&-DDQthZSXx-omyPv zVHH~tcd7nIR;2VO(g+kCi>&U=S&di_P8S1X*9MeZP<>W{1fz9w5r2 z)Gl{59?jxDNOaV=J>7K|M@VLvj9*su>99q06MlxQIOCE9XRwZP1|G5JJcQqo)tjG~ zDY9hHDAs2P@jEuDVJpL~SN#mE=Hb(8H4tm6hfZ7&z@C)VP4w zRt?!~g2(#HBP?q4(=Mer_2mB~DhN-)Il}ZVVx!M|n^ak@V3bp&C{)Q_3y9 z`#PO(!uGoVUEWp0@+Q-C(~>#_go{Qwv9PCFSm2 zd=pIPEG8<>Mn7Q@SPDLnlfcZ13{p@3Bwna0)akQNDC;?1d$>;z3YxEI{kG0EkVkxD zYdOD~yIM0=@lUd%&GB*P`fhd-@Lb6wnN**CxyCriK#>Xipwznr;9HG;WiRzoE{vIYiq++kD-$%0|O_NRo<7{c71)|Kl2B=1(NRj=0&9NNsg-7h3Jfmn zU1D6jiGRVnaEto_qc1K82}d1bnFr+`uIm@3;!ocWU9W8dfVM#tylV+0f5Y_FzuXaqrmozsxB3 z$;X^FwISoM+<4$BQzp-}b-rkwW)qZY^ok*eqvn{s6Ri+r_eA~f-h0;1t{XmMmys9a z>IOTu>`*eK&h#JgrdtQ`aSbw3I-WN&gUp>ao#PtC=8vlB$-UNEl%^?_erGOnwjK+4 zhE=|yM+iFp@$~Y;Z-0{nFtm;!tn)R*=vOm)&?4jzvGjQYp)Y3?Ci5U^YVKUAX&d$p zA#yB;tKh~*$e|;agyJi3kai98^FO4$t1*k8;&PC##ciWhqg440bcV%4(4$}DMfder z-yUpzNz@w8*nqavi`LX$rq-l6_yo3B_eV>&#{0-jUGx(Nj<5U*F}EiiT(xZIvG6AE z`%*+4gtf{RnWbN=vG7f`p*?zKQ$y1nnNNpme?7p8V0Vn)@&D_`uO#eoFEG*&T&?QJ zsq5)idW4o4{TQlBjj?FUl{EIjeJL!xKLXaJa~f*c7oDN`9O+s@hN#YBY-`RWVEZ`I zv=2FT$4yr}JHc`A01LFxa9Dy}?E4)gwt*Mwrg(tmWg(!-1_a3Zu1w@cm&ZW8$q3r@ z@q*KkNR}(K!9BV$V(5V@>E3Mw{bB(I1wz)8yb1_5v0@uLMeehQJ*OLIdj72Frz(&nlOHcXcC}kU zi;AC4!Hz_xMh8J%*qO-h&HumkoOep`Gb8Z@QHstBC6(^2ZX;u(lIab8U3!?=I0J@6 zQZtKp>ie&kCsbFf47N0Dsr#vbbp8CHKwmr13%M?9UUq@9S7KXyVUJZ@J86|Ji{7rx z4#B`+qM3?@(Q7#brJdgS8J`qLuIyy54O`sl*uN{^55;x%)C3!Z)VjV|Sy@QPkKX9y zZ)*!LHNuTlR#`i}1Z1(_8=>mzBIt!H9_?EK<-5m45{fh3y$Cxn< zstTf*z3Mv8c5g)|x%9n)6}lmyZbhr#lLwTb)0O8qSZR&lMqY7tyU%~@Eb6fDdS|ub zuQg7Bj-E0SVZ~xXCFszWi=4=A-%&bqmjAVleF8cn)%adf&;`g}?zd-EOj ze>bnsNKbBUVlZ)Kc0tMOftMtQ!19_X7`s{U0NK!BAPH6$~|Lqk}uNQ!|e`%y4Tfb4zMahN3K-TfeF-em2GFV`tbb4DASh z@R>I^vZn;%RQ~Kl$=RZXzjmZm{dbQ z#4t)eEX0H7`i0_0eR@vm*4whzDcMmU@_xF9R12CKwRBWeB>~?Zn{XXr_ z-Q#|{EcJARLG=6V1F!vOf8DkNSwrV{vH#Z^I@B-u$$=aBP}iXfiJhI$9SS55i#E`h8&mp&&Y zyJH&@u8@ZdVgCnUnnojz|GCtYjAW<1ZizRv-jw9~ms$M>G~uJ=aGzdTr&D(>iU+Pd z2HZr8YF3n|bTjikIu0sCg+EI~XcP<76Nhr4{y)k(t`@!4=6hZ!vWjS0( z>9UM7ycq%g{NYlqXzqw^g`S)N>#k3Sc{7f!&W#ay{^UkjWLNZiM3xW{L5>5OHjb@@ z%HA`b4X-PMC~70K)2_sd+dOok9U0c`fl3brD124!H*+v0-<0Wd2(kD$d0T9*; zShu|~$+>6tx*RQova_o*F3|mac}Bzj6b75iCve_w;S274dYax- z7SJbN7cT;wdK1qJilA>=a91T7Yj^VDR!|Q8p8R^*qK!7IsRA#&(Om_{vgMx0fnY&^V> z$+ATUk#OD6^Hb7E!6mas;OYecW#=W;Zza6jgnUT40od4|s%7E~e-0-}Cv~>GT}gGk z5W(ZW^((h5g?w|=7#NC|(R+`D=bil1-kSd!4jCidf1w>RF2p(`d@8C&9=xPXq8Q0N zWVW`zrX(=I1$Cv1{ab4x2$>LTda~cnbFP0~#vW;VJYL&{y_*PXlo1wB7fK4DkeAlb z{TYgG-yCNvi=mPEG=EQpu8DkTrYrBCYFo~Qj0shDV(%5eDf4{(uzXG8Q#rLs7jd(7 zxMpjA-TdqQ)0OS`dC&2Oi5;e7tpUM5)TvO#Vfw^+Z_YVII-VGljKG`&jw=#jsFmJ^ z?(gU4=juBGIs4a_a^=Biw8sYB5~X{EtW`RQTNCSbGbxV!@dZwGpBL_-`ycT^4nf2q zXW?w0SbdJ|hN{nO2N;V-tsr8YHfo)i_YD`~`9kadQAPW%_m|hLM`{D#oCxy%N9IF+ zU&yZ(V{hZ}!#<)jaf!`R4#U)tEnWm0@68ZX(I){<;rSVoHR45pCxg~A$%0(4>*i;P$fY*=OTu?5^ z^a~$BZoBap+sb(-x2Hr~F+4Sr*tk?E%6MjB-gH;Cs<*hFpV=dgQN~N^;lH}su;Y{4 zPB<;>U(7dspKaV`B#(K(=4Fq2t~47wY09z(+3{7SYV^o8xLVNI;bEBo6p0W}XW^6M<-o2~n7W?FgNDf9&e+@ZVy zt7Y(Y!=!CwdM1xFLr$toDBzE=SxebvZTSnKy}P_kz9Wp%xgYnQ{4!_2rmIePWy!QC z^49B%uvku;K6ysB3fsMZlH57Dxf20D--%+^&WV!lLjs5`{ z5FGFi|D%mq{$WA>lS;S)*Yax;eNIOjjKuK|SIL(A2~h(&`JN5&KzZ&qQ5=!lJ0=0` zrHi`5;jkX))o-MdDcgM$xBRvz{!K8Ts}cd9cM&9xRgBph98M=#_dYLQg^_y{^)Kel z8}hi1Cf*g>&MFS=0$k~cyL)dU>0wh|25fV$kLG=~bmgt*O9@8k#DHzG0$yKWv$=Pd zP2c(8rfu+o!+9#U@)%a%mJ%)@JCp2--8gFA|NmeZkv%02C|)#Dv%h^@=bEOH4zcVX zFWIvlmFGqO&(qpbjp9YIw_&n+EuW0(RZbS(2Z^Bh*uRE1$wFmalaI=Pe;(yZ5m*z#*3dof6X)4)9Xrk&bR)M7PG#5N zAReq3(b0#(mSo)+yOZyp&&sK{j^uV9#!nb(KxgwncF~-OWhO z*o$dzv&5mh!l{?98+nnSgz#ije&_fO zAu)M<@6Q4-G>Gj#rT*}yx$R^>Vb_^`d{ma|`a-TY;3jHQ%!$aJ_@uPM?iu4^41piy zwfNo_@?nHs&*YHWJ;UpkAdu(Ij!&s>t8D(mcJB>R*eJwwN;97ucmU{miOFtO>73i~ z=ORTvUW_=cJstIL>2^YxZj*IphpdXcn+@Oi!Dh@njQqbQcp#ZO^wvY#B$NfQ>HCIxyQHDIZ;G-RS$- z1a|ItVkv8f+X&I7tN=|Ry0czIWCI!(`$dUJ^fI+i`Dm+kzjB0qA?J`fu%kOJxAXgy zxQ`w7B!10qw0C!SWYaNlj}!kkr17kR@j;KZwjL+&wy^H(2rI|9IMd^W!Ua2KG%r{7 z@GtqyrG?xhz^K1WKis#@c8&e|^)h~b`>K=hddK-z70s0@>m55>7D%`vuQPxcT#->i zC0UOtz12bz)AZN#_k*vb#4}uhDR8zrXPNIP=xd+N7wg@5i#2v*Q$uE{B`=*PwWv$x!w*Y&z*b`I+6j2c`&W6;#3(0FF z;ZQCqb-CM~r~1bzIi(x94b68O+V Date: Tue, 18 Apr 2023 07:01:01 +0200 Subject: [PATCH 055/473] Escape # and - in markdown utilities --- discord/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/utils.py b/discord/utils.py index 6b4e14347..fd711387b 100644 --- a/discord/utils.py +++ b/discord/utils.py @@ -900,7 +900,7 @@ _MARKDOWN_ESCAPE_REGEX = re.compile(fr'(?P{_MARKDOWN_ESCAPE_SUBREGEX}| _URL_REGEX = r'(?P<[^: >]+:\/[^ >]+>|(?:https?|steam):\/\/[^\s<]+[^<.,:;\"\'\]\s])' -_MARKDOWN_STOCK_REGEX = fr'(?P[_\\~|\*`]|{_MARKDOWN_ESCAPE_COMMON})' +_MARKDOWN_STOCK_REGEX = fr'(?P[_\\~|\*`#-]|{_MARKDOWN_ESCAPE_COMMON})' def remove_markdown(text: str, *, ignore_links: bool = True) -> str: From 8991525215622d842f1115b27a0bc41f76b6154d Mon Sep 17 00:00:00 2001 From: Michael H Date: Tue, 18 Apr 2023 04:03:40 -0400 Subject: [PATCH 056/473] Improve handling of ArrayFlags Why discord did it this way instead of as an integer bitfield like everything reasonable is unknowable, but this does less work to get to the same result. Add comment detailing what many would find unreadbale --- discord/flags.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/discord/flags.py b/discord/flags.py index 1dbb7c3c3..1b0005bd2 100644 --- a/discord/flags.py +++ b/discord/flags.py @@ -25,6 +25,7 @@ DEALINGS IN THE SOFTWARE. from __future__ import annotations from functools import reduce +from operator import or_ from typing import TYPE_CHECKING, Any, Callable, ClassVar, Dict, Iterator, List, Optional, Tuple, Type, TypeVar, overload from .enums import UserFlags @@ -1566,7 +1567,15 @@ class ArrayFlags(BaseFlags): @classmethod def _from_value(cls: Type[Self], value: List[int]) -> Self: self = cls.__new__(cls) - self.value = reduce(lambda a, b: a | (1 << b - 1), value, 0) + # This is a micro-optimization given the frequency this object can be created. + # (1).__lshift__ is used in place of lambda x: 1 << x + # prebinding to a method of a constant rather than define a lambda. + # Pairing this with map, is essentially equivalent to (1 << x for x in value) + # reduction using operator.or_ instead of defining a lambda each call + # Discord sends these starting with a value of 1 + # Rather than subtract 1 from each element prior to left shift, + # we shift right by 1 once at the end. + self.value = reduce(or_, map((1).__lshift__, value), 0) >> 1 return self def to_array(self) -> List[int]: From 0adef0ec8979a9f6c52d8062c8cdbe021f6810ac Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 18 Apr 2023 01:08:52 -0400 Subject: [PATCH 057/473] Update auto_archive_duration documentation Fix #9351 --- discord/app_commands/models.py | 2 +- discord/channel.py | 4 ++-- discord/message.py | 2 +- discord/threads.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/discord/app_commands/models.py b/discord/app_commands/models.py index ef2e1849d..3e9d250b2 100644 --- a/discord/app_commands/models.py +++ b/discord/app_commands/models.py @@ -673,7 +673,7 @@ class AppCommandThread(Hashable): archiver_id: Optional[:class:`int`] The user's ID that archived this thread. auto_archive_duration: :class:`int` - The duration in minutes until the thread is automatically archived due to inactivity. + The duration in minutes until the thread is automatically hidden from the channel list. Usually a value of 60, 1440, 4320 and 10080. archive_timestamp: :class:`datetime.datetime` An aware timestamp of when the thread's archived status was last updated in UTC. diff --git a/discord/channel.py b/discord/channel.py index 3c93832f3..cd5490b2e 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -737,7 +737,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): If ``None`` is passed then a private thread is created. Defaults to ``None``. auto_archive_duration: :class:`int` - The duration in minutes before a thread is automatically archived for inactivity. + The duration in minutes before a thread is automatically hidden from the channel list. If not provided, the channel's default auto archive duration is used. Must be one of ``60``, ``1440``, ``4320``, or ``10080``, if provided. @@ -2607,7 +2607,7 @@ class ForumChannel(discord.abc.GuildChannel, Hashable): name: :class:`str` The name of the thread. auto_archive_duration: :class:`int` - The duration in minutes before a thread is automatically archived for inactivity. + The duration in minutes before a thread is automatically hidden from the channel list. If not provided, the channel's default auto archive duration is used. Must be one of ``60``, ``1440``, ``4320``, or ``10080``, if provided. diff --git a/discord/message.py b/discord/message.py index 8c9b732f5..c96c7e022 100644 --- a/discord/message.py +++ b/discord/message.py @@ -1215,7 +1215,7 @@ class PartialMessage(Hashable): name: :class:`str` The name of the thread. auto_archive_duration: :class:`int` - The duration in minutes before a thread is automatically archived for inactivity. + The duration in minutes before a thread is automatically hidden from the channel list. If not provided, the channel's default auto archive duration is used. Must be one of ``60``, ``1440``, ``4320``, or ``10080``, if provided. diff --git a/discord/threads.py b/discord/threads.py index c5551a55a..b47c189d2 100644 --- a/discord/threads.py +++ b/discord/threads.py @@ -122,7 +122,7 @@ class Thread(Messageable, Hashable): archiver_id: Optional[:class:`int`] The user's ID that archived this thread. auto_archive_duration: :class:`int` - The duration in minutes until the thread is automatically archived due to inactivity. + The duration in minutes until the thread is automatically hidden from the channel list. Usually a value of 60, 1440, 4320 and 10080. archive_timestamp: :class:`datetime.datetime` An aware timestamp of when the thread's archived status was last updated in UTC. @@ -608,7 +608,7 @@ class Thread(Messageable, Hashable): Whether non-moderators can add other non-moderators to this thread. Only available for private threads. auto_archive_duration: :class:`int` - The new duration in minutes before a thread is automatically archived for inactivity. + The new duration in minutes before a thread is automatically hidden from the channel list. Must be one of ``60``, ``1440``, ``4320``, or ``10080``. slowmode_delay: :class:`int` Specifies the slowmode rate limit for user in this thread, in seconds. From cb6170a7247958294b85a3bd0ab29b71088e86a2 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 18 Apr 2023 06:14:49 -0400 Subject: [PATCH 058/473] Fix AuditLogEntry.target being None for invites Fix #9336 --- discord/audit_logs.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/discord/audit_logs.py b/discord/audit_logs.py index 489e064b7..17f308c45 100644 --- a/discord/audit_logs.py +++ b/discord/audit_logs.py @@ -733,12 +733,11 @@ class AuditLogEntry(Hashable): if self.action.target_type is None: return None - if self._target_id is None: - return None - try: converter = getattr(self, '_convert_target_' + self.action.target_type) except AttributeError: + if self._target_id is None: + return None return Object(id=self._target_id) else: return converter(self._target_id) @@ -771,7 +770,12 @@ class AuditLogEntry(Hashable): def _convert_target_channel(self, target_id: int) -> Union[abc.GuildChannel, Object]: return self.guild.get_channel(target_id) or Object(id=target_id) - def _convert_target_user(self, target_id: int) -> Union[Member, User, Object]: + def _convert_target_user(self, target_id: Optional[int]) -> Optional[Union[Member, User, Object]]: + # For some reason the member_disconnect and member_move action types + # do not have a non-null target_id so safeguard against that + if target_id is None: + return None + return self._get_member(target_id) or Object(id=target_id, type=Member) def _convert_target_role(self, target_id: int) -> Union[Role, Object]: From 952558d5948d376980abdf676e1330451e8a964d Mon Sep 17 00:00:00 2001 From: Andrin S <65789180+Puncher1@users.noreply.github.com> Date: Tue, 18 Apr 2023 14:04:47 +0200 Subject: [PATCH 059/473] [docs] Add missing attributes to AuditLogDiff --- docs/api.rst | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/docs/api.rst b/docs/api.rst index 316dbda14..e2f77de97 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -3422,6 +3422,12 @@ AuditLogDiff :type: :class:`str` + .. attribute:: guild + + The guild of something. + + :type: :class:`Guild` + .. attribute:: icon A guild's or role's icon. See also :attr:`Guild.icon` or :attr:`Role.icon`. @@ -3996,6 +4002,38 @@ AuditLogDiff :type: :class:`ChannelFlags` + .. attribute:: default_thread_slowmode_delay + + The default slowmode delay for threads created in this text channel or forum. + + See also :attr:`TextChannel.default_thread_slowmode_delay` and :attr:`ForumChannel.default_thread_slowmode_delay` + + :type: :class:`int` + + .. attribute:: applied_tags + + The applied tags of a forum post. + + See also :attr:`Thread.applied_tags` + + :type: List[Union[:class:`ForumTag`, :class:`Object`]] + + .. attribute:: available_tags + + The available tags of a forum. + + See also :attr:`ForumChannel.available_tags` + + :type: Sequence[:class:`ForumTag`] + + .. attribute:: default_reaction_emoji + + The default_reaction_emoji for forum posts. + + See also :attr:`ForumChannel.default_reaction_emoji` + + :type: :class:`default_reaction_emoji` + .. this is currently missing the following keys: reason and application_id I'm not sure how to port these From 4e276f59d716973a8640c9685eb80b93749f844a Mon Sep 17 00:00:00 2001 From: Andrin S <65789180+Puncher1@users.noreply.github.com> Date: Tue, 18 Apr 2023 14:53:56 +0200 Subject: [PATCH 060/473] Fix on_socket_raw_send and on_raw_thread_member_remove param types --- docs/api.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/api.rst b/docs/api.rst index e2f77de97..4a8233065 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -493,6 +493,7 @@ Debug :param payload: The message that is about to be passed on to the WebSocket library. It can be :class:`bytes` to denote a binary message or :class:`str` to denote a regular text message. + :type payload: Union[:class:`bytes`, :class:`str`] Gateway @@ -1363,7 +1364,7 @@ Threads .. versionadded:: 2.0 :param payload: The raw event payload data. - :type member: :class:`RawThreadMembersUpdate` + :type payload: :class:`RawThreadMembersUpdate` Voice ~~~~~~ From 4615d6848aa0fa41ae0578f50f8a57430b344af3 Mon Sep 17 00:00:00 2001 From: Andrin S <65789180+Puncher1@users.noreply.github.com> Date: Tue, 18 Apr 2023 14:55:18 +0200 Subject: [PATCH 061/473] Add auto_mod_badge to ApplicationFlags --- discord/flags.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/discord/flags.py b/discord/flags.py index 1b0005bd2..d0938583c 100644 --- a/discord/flags.py +++ b/discord/flags.py @@ -1422,6 +1422,15 @@ class ApplicationFlags(BaseFlags): rather than using this raw value. """ + @flag_value + def auto_mod_badge(self): + """:class:`bool`: Returns ``True`` if the application uses auto moderation. + This shows up as a badge in the official client. + + .. versionadded:: 2.3 + """ + return 1 << 6 + @flag_value def gateway_presence(self): """:class:`bool`: Returns ``True`` if the application is verified and is allowed to From bee2db805d33456eada62c61cdf11a4c9a01a43d Mon Sep 17 00:00:00 2001 From: Andrin S <65789180+Puncher1@users.noreply.github.com> Date: Tue, 18 Apr 2023 14:58:50 +0200 Subject: [PATCH 062/473] Add and change Guild attributes and Guild.edit params --- discord/guild.py | 66 +++++++++++++++++++++++++++++++++++++++--- discord/http.py | 1 + discord/types/guild.py | 1 + 3 files changed, 64 insertions(+), 4 deletions(-) diff --git a/discord/guild.py b/discord/guild.py index e86d121ba..67627cfaa 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -267,6 +267,10 @@ class Guild(Hashable): Indicates if the guild has widget enabled. .. versionadded:: 2.0 + max_stage_video_users: Optional[:class:`int`] + The maximum amount of users in a stage video channel. + + .. versionadded:: 2.3 """ __slots__ = ( @@ -315,6 +319,8 @@ class Guild(Hashable): 'approximate_member_count', 'approximate_presence_count', 'premium_progress_bar_enabled', + '_safety_alerts_channel_id', + 'max_stage_video_users', ) _PREMIUM_GUILD_LIMITS: ClassVar[Dict[Optional[int], _GuildLimit]] = { @@ -478,6 +484,7 @@ class Guild(Hashable): self.max_presences: Optional[int] = guild.get('max_presences') self.max_members: Optional[int] = guild.get('max_members') self.max_video_channel_users: Optional[int] = guild.get('max_video_channel_users') + self.max_stage_video_users: Optional[int] = guild.get('max_stage_video_channel_users') self.premium_tier: int = guild.get('premium_tier', 0) self.premium_subscription_count: int = guild.get('premium_subscription_count') or 0 self.vanity_url_code: Optional[str] = guild.get('vanity_url_code') @@ -488,6 +495,7 @@ class Guild(Hashable): self._discovery_splash: Optional[str] = guild.get('discovery_splash') self._rules_channel_id: Optional[int] = utils._get_as_snowflake(guild, 'rules_channel_id') self._public_updates_channel_id: Optional[int] = utils._get_as_snowflake(guild, 'public_updates_channel_id') + self._safety_alerts_channel_id: Optional[int] = utils._get_as_snowflake(guild, 'safety_alerts_channel_id') self.nsfw_level: NSFWLevel = try_enum(NSFWLevel, guild.get('nsfw_level', 0)) self.mfa_level: MFALevel = try_enum(MFALevel, guild.get('mfa_level', 0)) self.approximate_presence_count: Optional[int] = guild.get('approximate_presence_count') @@ -801,6 +809,17 @@ class Guild(Hashable): channel_id = self._public_updates_channel_id return channel_id and self._channels.get(channel_id) # type: ignore + @property + def safety_alerts_channel(self) -> Optional[TextChannel]: + """Optional[:class:`TextChannel`]: Return's the guild's channel used for safety alerts, if set. + + For example, this is used for the raid protection setting. The guild must have the ``COMMUNITY`` feature. + + .. versionadded:: 2.3 + """ + channel_id = self._safety_alerts_channel_id + return channel_id and self._channels.get(channel_id) # type: ignore + @property def widget_channel(self) -> Optional[Union[TextChannel, ForumChannel, VoiceChannel, StageChannel]]: """Optional[Union[:class:`TextChannel`, :class:`ForumChannel`, :class:`VoiceChannel`, :class:`StageChannel`]]: Returns @@ -1820,6 +1839,8 @@ class Guild(Hashable): widget_enabled: bool = MISSING, widget_channel: Optional[Snowflake] = MISSING, mfa_level: MFALevel = MISSING, + raid_alerts_disabled: bool = MISSING, + safety_alerts_channel: TextChannel = MISSING, ) -> Guild: r"""|coro| @@ -1934,6 +1955,18 @@ class Guild(Hashable): reason: Optional[:class:`str`] The reason for editing this guild. Shows up on the audit log. + raid_alerts_disabled: :class:`bool` + Whether the alerts for raid protection should be disabled for the guild. + + .. versionadded:: 2.3 + + safety_alerts_channel: Optional[:class:`TextChannel`] + The new channel that is used for safety alerts. This is only available to + guilds that contain ``COMMUNITY`` in :attr:`Guild.features`. Could be ``None`` for no + safety alerts channel. + + .. versionadded:: 2.3 + Raises ------- Forbidden @@ -1945,9 +1978,9 @@ class Guild(Hashable): PNG or JPG. This is also raised if you are not the owner of the guild and request an ownership transfer. TypeError - The type passed to the ``default_notifications``, ``verification_level``, - ``explicit_content_filter``, ``system_channel_flags``, or ``mfa_level`` parameter was - of the incorrect type. + The type passed to the ``default_notifications``, ``rules_channel``, ``public_updates_channel``, + ``safety_alerts_channel`` ``verification_level``, ``explicit_content_filter``, + ``system_channel_flags``, or ``mfa_level`` parameter was of the incorrect type. Returns -------- @@ -2019,14 +2052,33 @@ class Guild(Hashable): if rules_channel is None: fields['rules_channel_id'] = rules_channel else: + if not isinstance(rules_channel, TextChannel): + raise TypeError(f'rules_channel must be of type TextChannel not {rules_channel.__class__.__name__}') + fields['rules_channel_id'] = rules_channel.id if public_updates_channel is not MISSING: if public_updates_channel is None: fields['public_updates_channel_id'] = public_updates_channel else: + if not isinstance(public_updates_channel, TextChannel): + raise TypeError( + f'public_updates_channel must be of type TextChannel not {public_updates_channel.__class__.__name__}' + ) + fields['public_updates_channel_id'] = public_updates_channel.id + if safety_alerts_channel is not MISSING: + if safety_alerts_channel is None: + fields['safety_alerts_channel_id'] = safety_alerts_channel + else: + if not isinstance(safety_alerts_channel, TextChannel): + raise TypeError( + f'safety_alerts_channel must be of type TextChannel not {safety_alerts_channel.__class__.__name__}' + ) + + fields['safety_alerts_channel_id'] = safety_alerts_channel.id + if owner is not MISSING: if self.owner_id != self._state.self_id: raise ValueError('To transfer ownership you must be the owner of the guild.') @@ -2051,7 +2103,7 @@ class Guild(Hashable): fields['system_channel_flags'] = system_channel_flags.value - if any(feat is not MISSING for feat in (community, discoverable, invites_disabled)): + if any(feat is not MISSING for feat in (community, discoverable, invites_disabled, raid_alerts_disabled)): features = set(self.features) if community is not MISSING: @@ -2077,6 +2129,12 @@ class Guild(Hashable): else: features.discard('INVITES_DISABLED') + if raid_alerts_disabled is not MISSING: + if raid_alerts_disabled: + features.add('RAID_ALERTS_DISABLED') + else: + features.discard('RAID_ALERTS_DISABLED') + fields['features'] = list(features) if premium_progress_bar_enabled is not MISSING: diff --git a/discord/http.py b/discord/http.py index 22336b323..e7c23162a 100644 --- a/discord/http.py +++ b/discord/http.py @@ -1426,6 +1426,7 @@ class HTTPClient: 'public_updates_channel_id', 'preferred_locale', 'premium_progress_bar_enabled', + 'safety_alerts_channel_id', ) payload = {k: v for k, v in fields.items() if k in valid_keys} diff --git a/discord/types/guild.py b/discord/types/guild.py index 1ff2854aa..44d51019a 100644 --- a/discord/types/guild.py +++ b/discord/types/guild.py @@ -84,6 +84,7 @@ GuildFeature = Literal[ 'VERIFIED', 'VIP_REGIONS', 'WELCOME_SCREEN_ENABLED', + 'RAID_ALERTS_DISABLED', ] From 1767be0081070501b2a4e5d1a55b4386ea24bc89 Mon Sep 17 00:00:00 2001 From: Andrin S <65789180+Puncher1@users.noreply.github.com> Date: Thu, 20 Apr 2023 06:08:04 +0200 Subject: [PATCH 063/473] Add support for voice messages Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com> --- discord/flags.py | 8 ++++++++ discord/message.py | 18 ++++++++++++++++++ discord/permissions.py | 16 ++++++++++++++-- discord/types/message.py | 2 ++ discord/utils.py | 6 +++++- 5 files changed, 47 insertions(+), 3 deletions(-) diff --git a/discord/flags.py b/discord/flags.py index d0938583c..837aefc42 100644 --- a/discord/flags.py +++ b/discord/flags.py @@ -451,6 +451,14 @@ class MessageFlags(BaseFlags): """ return 4096 + @flag_value + def voice(self): + """:class:`bool`: Returns ``True`` if the message is a voice message. + + .. versionadded:: 2.3 + """ + return 8192 + @fill_with_flags() class PublicUserFlags(BaseFlags): diff --git a/discord/message.py b/discord/message.py index c96c7e022..f99fa01fb 100644 --- a/discord/message.py +++ b/discord/message.py @@ -183,6 +183,14 @@ class Attachment(Hashable): Whether the attachment is ephemeral. .. versionadded:: 2.0 + duration: Optional[:class:`float`] + The duration of the audio file in seconds. Returns ``None`` if it's not a voice message. + + .. versionadded:: 2.3 + waveform: Optional[:class:`bytes`] + The waveform (amplitudes) of the audio in bytes. Returns ``None`` if it's not a voice message. + + .. versionadded:: 2.3 """ __slots__ = ( @@ -197,6 +205,8 @@ class Attachment(Hashable): 'content_type', 'description', 'ephemeral', + 'duration', + 'waveform', ) def __init__(self, *, data: AttachmentPayload, state: ConnectionState): @@ -211,11 +221,19 @@ class Attachment(Hashable): self.content_type: Optional[str] = data.get('content_type') self.description: Optional[str] = data.get('description') self.ephemeral: bool = data.get('ephemeral', False) + self.duration: Optional[float] = data.get('duration_secs') + + waveform = data.get('waveform') + self.waveform: Optional[bytes] = utils._base64_to_bytes(waveform) if waveform is not None else None def is_spoiler(self) -> bool: """:class:`bool`: Whether this attachment contains a spoiler.""" return self.filename.startswith('SPOILER_') + def is_voice_message(self) -> bool: + """:class:`bool`: Whether this attachment is a voice message.""" + return self.duration is not None and 'voice-message' in self.url + def __repr__(self) -> str: return f'' diff --git a/discord/permissions.py b/discord/permissions.py index 9716f07c6..6be0674c9 100644 --- a/discord/permissions.py +++ b/discord/permissions.py @@ -177,7 +177,7 @@ class Permissions(BaseFlags): """A factory method that creates a :class:`Permissions` with all permissions set to ``True``. """ - return cls(0b1111111111111111111111111111111111111111111111) + return cls(0b11111111111111111111111111111111111111111111111) @classmethod def _timeout_mask(cls) -> int: @@ -261,8 +261,11 @@ class Permissions(BaseFlags): .. versionchanged:: 2.0 Added :attr:`create_public_threads`, :attr:`create_private_threads`, :attr:`manage_threads`, :attr:`send_messages_in_threads` and :attr:`use_external_stickers` permissions. + + .. versionchanged:: 2.3 + Added :attr:`send_voice_messages` permission. """ - return cls(0b111110010000000000001111111100001000000) + return cls(0b10000000111110010000000000001111111100001000000) @classmethod def voice(cls) -> Self: @@ -671,6 +674,14 @@ class Permissions(BaseFlags): """ return 1 << 45 + @flag_value + def send_voice_messages(self) -> int: + """:class:`bool`: Returns ``True`` if a user can send voice messages. + + .. versionadded:: 2.3 + """ + return 1 << 46 + def _augment_from_permissions(cls): cls.VALID_NAMES = set(Permissions.VALID_FLAGS) @@ -788,6 +799,7 @@ class PermissionOverwrite: moderate_members: Optional[bool] use_soundboard: Optional[bool] use_external_sounds: Optional[bool] + send_voice_messages: Optional[bool] def __init__(self, **kwargs: Optional[bool]): self._values: Dict[str, Optional[bool]] = {} diff --git a/discord/types/message.py b/discord/types/message.py index 1319b2e65..1157100fc 100644 --- a/discord/types/message.py +++ b/discord/types/message.py @@ -68,6 +68,8 @@ class Attachment(TypedDict): content_type: NotRequired[str] spoiler: NotRequired[bool] ephemeral: NotRequired[bool] + duration_secs: NotRequired[float] + waveform: NotRequired[str] MessageActivityType = Literal[1, 2, 3, 5] diff --git a/discord/utils.py b/discord/utils.py index fd711387b..9fe664caf 100644 --- a/discord/utils.py +++ b/discord/utils.py @@ -56,7 +56,7 @@ from typing import ( TYPE_CHECKING, ) import unicodedata -from base64 import b64encode +from base64 import b64encode, b64decode from bisect import bisect_left import datetime import functools @@ -628,6 +628,10 @@ def _bytes_to_base64_data(data: bytes) -> str: return fmt.format(mime=mime, data=b64) +def _base64_to_bytes(data: str) -> bytes: + return b64decode(data.encode('ascii')) + + def _is_submodule(parent: str, child: str) -> bool: return parent == child or child.startswith(parent + '.') From c6162cfec5534416fe3281fc987bbbf8d9ae281b Mon Sep 17 00:00:00 2001 From: Andrin S <65789180+Puncher1@users.noreply.github.com> Date: Sat, 22 Apr 2023 02:28:07 +0200 Subject: [PATCH 064/473] Update auto_mod_badge documentation --- discord/flags.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/flags.py b/discord/flags.py index 837aefc42..841a9863f 100644 --- a/discord/flags.py +++ b/discord/flags.py @@ -1432,7 +1432,7 @@ class ApplicationFlags(BaseFlags): @flag_value def auto_mod_badge(self): - """:class:`bool`: Returns ``True`` if the application uses auto moderation. + """:class:`bool`: Returns ``True`` if the application uses at least 100 automod rules across all guilds. This shows up as a badge in the official client. .. versionadded:: 2.3 From c57d488ca699de69a240ae7c8304bd53da23141d Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 25 Apr 2023 00:19:20 -0400 Subject: [PATCH 065/473] Fix FileHandler having ANSI escapes when used within PyCharm --- discord/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/discord/utils.py b/discord/utils.py index 9fe664caf..6d1e2ed17 100644 --- a/discord/utils.py +++ b/discord/utils.py @@ -1243,11 +1243,12 @@ def is_docker() -> bool: def stream_supports_colour(stream: Any) -> bool: + is_a_tty = hasattr(stream, 'isatty') and stream.isatty() + # Pycharm and Vscode support colour in their inbuilt editors if 'PYCHARM_HOSTED' in os.environ or os.environ.get('TERM_PROGRAM') == 'vscode': - return True + return is_a_tty - is_a_tty = hasattr(stream, 'isatty') and stream.isatty() if sys.platform != 'win32': # Docker does not consistently have a tty attached to it return is_a_tty or is_docker() From da10065c1912996ff69ccd21602828edf843f305 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 27 Apr 2023 18:05:20 -0400 Subject: [PATCH 066/473] Fix channel edits on webhooks sending two requests --- discord/webhook/async_.py | 3 +-- discord/webhook/sync.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index f9b03193a..b8ff4993e 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -1511,8 +1511,7 @@ class Webhook(BaseWebhook): proxy_auth=self.proxy_auth, reason=reason, ) - - if prefer_auth and self.auth_token: + elif prefer_auth and self.auth_token: data = await adapter.edit_webhook( self.id, self.auth_token, diff --git a/discord/webhook/sync.py b/discord/webhook/sync.py index 71564a58d..982f94a93 100644 --- a/discord/webhook/sync.py +++ b/discord/webhook/sync.py @@ -835,8 +835,7 @@ class SyncWebhook(BaseWebhook): payload['channel_id'] = channel.id data = adapter.edit_webhook(self.id, self.auth_token, payload=payload, session=self.session, reason=reason) - - if prefer_auth and self.auth_token: + elif prefer_auth and self.auth_token: data = adapter.edit_webhook(self.id, self.auth_token, payload=payload, session=self.session, reason=reason) elif self.token: data = adapter.edit_webhook_with_token(self.id, self.token, payload=payload, session=self.session, reason=reason) From 2880f15287cac0e455a0b623532dfe61711981e1 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 1 May 2023 18:14:06 -0400 Subject: [PATCH 067/473] Add changelog for v2.2.3 --- docs/whats_new.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/whats_new.rst b/docs/whats_new.rst index 760be0152..af13da1c1 100644 --- a/docs/whats_new.rst +++ b/docs/whats_new.rst @@ -11,6 +11,20 @@ Changelog This page keeps a detailed human friendly rendering of what's new and changed in specific versions. +.. _vp2p2p3: + +v2.2.3 +------- + +Bug Fixes +~~~~~~~~~~ + +- Fix crash from Discord sending null ``channel_id`` for automod audit logs. +- Fix ``channel`` edits when using :meth:`Webhook.edit` sending two requests. +- Fix :attr:`AuditLogEntry.target` being ``None`` for invites (:issue:`9336`). +- Fix :exc:`KeyError` when accessing data for :class:`GuildSticker` (:issue:`9324`). + + .. _vp2p2p2: v2.2.2 From c8e26444974f9064f2b4025b2cf6a81753c4172a Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 2 May 2023 20:10:39 -0400 Subject: [PATCH 068/473] Fix custom attributes not being copied over for subclassed Group --- discord/app_commands/commands.py | 33 +++--------------------- tests/test_app_commands_group.py | 43 ++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 30 deletions(-) diff --git a/discord/app_commands/commands.py b/discord/app_commands/commands.py index fd6388443..8e6693408 100644 --- a/discord/app_commands/commands.py +++ b/discord/app_commands/commands.py @@ -46,6 +46,7 @@ from typing import ( ) import re +from copy import copy as shallow_copy from ..enums import AppCommandOptionType, AppCommandType, ChannelType, Locale from .models import Choice @@ -707,25 +708,10 @@ class Command(Generic[GroupT, P, T]): ) -> Command: bindings = {} if bindings is MISSING else bindings - cls = self.__class__ - copy = cls.__new__(cls) - copy.name = self.name - copy._locale_name = self._locale_name - copy._guild_ids = self._guild_ids - copy.checks = self.checks - copy.description = self.description - copy._locale_description = self._locale_description - copy.default_permissions = self.default_permissions - copy.guild_only = self.guild_only - copy.nsfw = self.nsfw - copy._attr = self._attr - copy._callback = self._callback - copy.on_error = self.on_error + copy = shallow_copy(self) copy._params = self._params.copy() - copy.module = self.module copy.parent = parent copy.binding = bindings.get(self.binding) if self.binding is not None else binding - copy.extras = self.extras if copy._attr and set_on_binding: setattr(copy.binding, copy._attr, copy) @@ -1622,22 +1608,9 @@ class Group: ) -> Group: bindings = {} if bindings is MISSING else bindings - cls = self.__class__ - copy = cls.__new__(cls) - copy.name = self.name - copy._locale_name = self._locale_name - copy._guild_ids = self._guild_ids - copy.description = self.description - copy._locale_description = self._locale_description + copy = shallow_copy(self) copy.parent = parent - copy.module = self.module - copy.default_permissions = self.default_permissions - copy.guild_only = self.guild_only - copy.nsfw = self.nsfw - copy._attr = self._attr - copy._owner_cls = self._owner_cls copy._children = {} - copy.extras = self.extras bindings[self] = copy diff --git a/tests/test_app_commands_group.py b/tests/test_app_commands_group.py index 756f7c48f..d5f07976f 100644 --- a/tests/test_app_commands_group.py +++ b/tests/test_app_commands_group.py @@ -354,3 +354,46 @@ def test_cog_group_with_subclassed_subclass_group(): assert cog.sub_group.my_command.parent is cog.sub_group assert cog.my_cog_command.parent is cog.sub_group assert cog.my_cog_command.binding is cog + + +def test_cog_group_with_custom_state_issue9383(): + class InnerGroup(app_commands.Group): + def __init__(self): + super().__init__() + self.state: int = 20 + + @app_commands.command() + async def my_command(self, interaction: discord.Interaction) -> None: + ... + + class MyCog(commands.GroupCog): + inner = InnerGroup() + + @app_commands.command() + async def my_regular_command(self, interaction: discord.Interaction) -> None: + ... + + @inner.command() + async def my_inner_command(self, interaction: discord.Interaction) -> None: + ... + + cog = MyCog() + assert cog.inner.state == 20 + assert cog.my_regular_command is not MyCog.my_regular_command + + # Basically the same tests as above... (superset?) + assert MyCog.__cog_app_commands__[0].parent is not cog + assert MyCog.__cog_app_commands__[0].parent is not cog.__cog_app_commands_group__ + assert InnerGroup.__discord_app_commands_group_children__[0].parent is not cog.inner + assert InnerGroup.__discord_app_commands_group_children__[0].parent is not cog.inner + assert cog.inner is not MyCog.inner + assert cog.inner.my_command is not InnerGroup.my_command + assert cog.inner.my_command is not InnerGroup.my_command + assert cog.my_inner_command is not MyCog.my_inner_command + assert not hasattr(cog.inner, 'my_inner_command') + assert cog.__cog_app_commands_group__ is not None + assert cog.__cog_app_commands_group__.parent is None + assert cog.inner.parent is cog.__cog_app_commands_group__ + assert cog.inner.my_command.parent is cog.inner + assert cog.my_inner_command.parent is cog.inner + assert cog.my_inner_command.binding is cog From 34a434b2afb605fb3cb7884608394c258b6ef962 Mon Sep 17 00:00:00 2001 From: Lilly Rose Berner Date: Wed, 3 May 2023 02:19:21 +0200 Subject: [PATCH 069/473] Fix AutoMod audit log entry error due to empty channel_id --- discord/audit_logs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/discord/audit_logs.py b/discord/audit_logs.py index 17f308c45..eebcecfbd 100644 --- a/discord/audit_logs.py +++ b/discord/audit_logs.py @@ -652,7 +652,9 @@ class AuditLogEntry(Hashable): ): channel_id = utils._get_as_snowflake(extra, 'channel_id') channel = None - if channel_id is not None: + + # May be an empty string instead of None due to a Discord issue + if channel_id: channel = self.guild.get_channel_or_thread(channel_id) or Object(id=channel_id) self.extra = _AuditLogProxyAutoModAction( From 252ac38f9206e412aa7353c0832fe13951f2ce8e Mon Sep 17 00:00:00 2001 From: Rapptz Date: Fri, 5 May 2023 10:55:23 -0400 Subject: [PATCH 070/473] Add fallback ClientUser.mutual_guilds property Fixes #9387 --- discord/user.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/discord/user.py b/discord/user.py index 23868712c..1b899883a 100644 --- a/discord/user.py +++ b/discord/user.py @@ -409,6 +409,18 @@ class ClientUser(BaseUser): data: UserPayload = await self._state.http.edit_profile(payload) return ClientUser(state=self._state, data=data) + @property + def mutual_guilds(self) -> List[Guild]: + """List[:class:`Guild`]: The guilds that the user shares with the client. + + .. note:: + + This will only return mutual guilds within the client's internal cache. + + .. versionadded:: 1.7 + """ + return list(self._state.guilds) + class User(BaseUser, discord.abc.Messageable): """Represents a Discord user. From 23352fba7949a491257cc06d2d88377035f0a39f Mon Sep 17 00:00:00 2001 From: Josh Date: Sat, 6 May 2023 19:20:37 +1000 Subject: [PATCH 071/473] Fix exception raised by around strategy when the limit is set to 100/101 --- discord/abc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/abc.py b/discord/abc.py index c6b63920f..4fd92e121 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -1722,12 +1722,12 @@ class Messageable: async def _around_strategy(retrieve: int, around: Optional[Snowflake], limit: Optional[int]): if not around: - return [] + return [], None, 0 around_id = around.id if around else None data = await self._state.http.logs_from(channel.id, retrieve, around=around_id) - return data, None, limit + return data, None, 0 async def _after_strategy(retrieve: int, after: Optional[Snowflake], limit: Optional[int]): after_id = after.id if after else None From 16f1760dd08a91649f594799fff4c39bdf52c0ac Mon Sep 17 00:00:00 2001 From: Jakub Kuczys Date: Sun, 7 May 2023 15:22:38 +0200 Subject: [PATCH 072/473] Document user_limit argument in StageChannel.edit() --- discord/channel.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/discord/channel.py b/discord/channel.py index cd5490b2e..907d0b4bd 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -1687,6 +1687,7 @@ class StageChannel(VocalGuildChannel): *, name: str = ..., nsfw: bool = ..., + user_limit: int = ..., position: int = ..., sync_permissions: int = ..., category: Optional[CategoryChannel] = ..., @@ -1726,6 +1727,8 @@ class StageChannel(VocalGuildChannel): The new channel's position. nsfw: :class:`bool` To mark the channel as NSFW or not. + user_limit: :class:`int` + The new channel's user limit. sync_permissions: :class:`bool` Whether to sync permissions with the channel's new or pre-existing category. Defaults to ``False``. From 8d047d9e1d265505b2f93f91669a5074227ea999 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 11 May 2023 02:27:01 -0400 Subject: [PATCH 073/473] Fix opus.Decoder triggering a segfault --- discord/opus.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/discord/opus.py b/discord/opus.py index 7cbdd8386..966a8ccc6 100644 --- a/discord/opus.py +++ b/discord/opus.py @@ -454,7 +454,9 @@ class Decoder(_OpusStruct): channel_count = self.CHANNELS else: frames = self.packet_get_nb_frames(data) - channel_count = self.packet_get_nb_channels(data) + # Discord silent frames erroneously present themselves as 1 channel instead of 2 + # Therefore we need to hardcode the number instead of using packet_get_nb_channels + channel_count = self.CHANNELS samples_per_frame = self.packet_get_samples_per_frame(data) frame_size = frames * samples_per_frame From ca0b44404743eb9e37c5123a9937d561daa63e2a Mon Sep 17 00:00:00 2001 From: Jakub Kuczys Date: Sat, 13 May 2023 20:13:55 +0200 Subject: [PATCH 074/473] Document the change in behaviour of bool(flag_obj) --- discord/flags.py | 46 ++++++++++++++++++++++++++++++++++++++++++ discord/permissions.py | 6 ++++++ docs/migrating.rst | 14 +++++++++++++ 3 files changed, 66 insertions(+) diff --git a/discord/flags.py b/discord/flags.py index 841a9863f..b93a643e5 100644 --- a/discord/flags.py +++ b/discord/flags.py @@ -239,6 +239,12 @@ class SystemChannelFlags(BaseFlags): Returns an iterator of ``(name, value)`` pairs. This allows it to be, for example, constructed as a dict or a list of pairs. + .. describe:: bool(b) + + Returns whether any flag is set to ``True``. + + .. versionadded:: 2.0 + Attributes ----------- value: :class:`int` @@ -361,6 +367,12 @@ class MessageFlags(BaseFlags): Returns an iterator of ``(name, value)`` pairs. This allows it to be, for example, constructed as a dict or a list of pairs. + .. describe:: bool(b) + + Returns whether any flag is set to ``True``. + + .. versionadded:: 2.0 + .. versionadded:: 1.3 Attributes @@ -509,6 +521,12 @@ class PublicUserFlags(BaseFlags): to be, for example, constructed as a dict or a list of pairs. Note that aliases are not shown. + .. describe:: bool(b) + + Returns whether any flag is set to ``True``. + + .. versionadded:: 2.0 + .. versionadded:: 1.4 Attributes @@ -693,6 +711,12 @@ class Intents(BaseFlags): Returns an iterator of ``(name, value)`` pairs. This allows it to be, for example, constructed as a dict or a list of pairs. + .. describe:: bool(b) + + Returns whether any intent is enabled. + + .. versionadded:: 2.0 + Attributes ----------- value: :class:`int` @@ -1278,6 +1302,12 @@ class MemberCacheFlags(BaseFlags): Returns an iterator of ``(name, value)`` pairs. This allows it to be, for example, constructed as a dict or a list of pairs. + .. describe:: bool(b) + + Returns whether any flag is set to ``True``. + + .. versionadded:: 2.0 + Attributes ----------- value: :class:`int` @@ -1421,6 +1451,10 @@ class ApplicationFlags(BaseFlags): to be, for example, constructed as a dict or a list of pairs. Note that aliases are not shown. + .. describe:: bool(b) + + Returns whether any flag is set to ``True``. + .. versionadded:: 2.0 Attributes @@ -1556,6 +1590,10 @@ class ChannelFlags(BaseFlags): to be, for example, constructed as a dict or a list of pairs. Note that aliases are not shown. + .. describe:: bool(b) + + Returns whether any flag is set to ``True``. + .. versionadded:: 2.0 Attributes @@ -1652,6 +1690,10 @@ class AutoModPresets(ArrayFlags): to be, for example, constructed as a dict or a list of pairs. Note that aliases are not shown. + .. describe:: bool(b) + + Returns whether any flag is set to ``True``. + Attributes ----------- value: :class:`int` @@ -1736,6 +1778,10 @@ class MemberFlags(BaseFlags): to be, for example, constructed as a dict or a list of pairs. Note that aliases are not shown. + .. describe:: bool(b) + + Returns whether any flag is set to ``True``. + Attributes ----------- diff --git a/discord/permissions.py b/discord/permissions.py index 6be0674c9..47c50c35f 100644 --- a/discord/permissions.py +++ b/discord/permissions.py @@ -119,6 +119,12 @@ class Permissions(BaseFlags): to be, for example, constructed as a dict or a list of pairs. Note that aliases are not shown. + .. describe:: bool(b) + + Returns whether the permissions object has any permissions set to ``True``. + + .. versionadded:: 2.0 + Attributes ----------- value: :class:`int` diff --git a/docs/migrating.rst b/docs/migrating.rst index 8e31417fd..1a0b52158 100644 --- a/docs/migrating.rst +++ b/docs/migrating.rst @@ -1006,6 +1006,20 @@ Due to a breaking API change by Discord, :meth:`Guild.bans` no longer returns a async for ban in guild.bans(limit=1000): ... +Flag classes now have a custom ``bool()`` implementation +-------------------------------------------------------- + +To allow library users to easily check whether an instance of a flag class has any flags enabled, +using `bool` on them will now only return ``True`` if at least one flag is enabled. + +This means that evaluating instances of the following classes in a bool context (such as ``if obj:``) may no longer return ``True``: + +- :class:`Intents` +- :class:`MemberCacheFlags` +- :class:`MessageFlags` +- :class:`Permissions` +- :class:`PublicUserFlags` +- :class:`SystemChannelFlags` Function Signature Changes ---------------------------- From be861e5eac826fbea4254853f3944e4a55ab4e07 Mon Sep 17 00:00:00 2001 From: Joab Date: Sat, 13 May 2023 15:15:45 -0300 Subject: [PATCH 075/473] Fix indentation in create_text_channel docs --- discord/guild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/guild.py b/discord/guild.py index 67627cfaa..009a1ef97 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1322,7 +1322,7 @@ class Guild(Hashable): nsfw: :class:`bool` To mark the channel as NSFW or not. news: :class:`bool` - Whether to create the text channel as a news channel. + Whether to create the text channel as a news channel. .. versionadded:: 2.0 default_auto_archive_duration: :class:`int` From 9717317c780d00b65354b59f9397f98513dfc5dc Mon Sep 17 00:00:00 2001 From: Murtada Altarouti <63660298+maltarouti@users.noreply.github.com> Date: Sat, 13 May 2023 21:16:52 +0300 Subject: [PATCH 076/473] Add missing import to modal example --- discord/ui/modal.py | 1 + 1 file changed, 1 insertion(+) diff --git a/discord/ui/modal.py b/discord/ui/modal.py index 615930d5c..b26fa9335 100644 --- a/discord/ui/modal.py +++ b/discord/ui/modal.py @@ -64,6 +64,7 @@ class Modal(View): .. code-block:: python3 + import discord from discord import ui class Questionnaire(ui.Modal, title='Questionnaire Response'): From 3951b61440a9fb87255d00349621e7a8863d5856 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Fri, 19 May 2023 09:43:51 -0400 Subject: [PATCH 077/473] Allow Interaction webhook URLs to be used in Webhook.from_url --- discord/webhook/async_.py | 2 +- discord/webhook/sync.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index b8ff4993e..c574914a6 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -1275,7 +1275,7 @@ class Webhook(BaseWebhook): A partial :class:`Webhook`. A partial webhook is just a webhook object with an ID and a token. """ - m = re.search(r'discord(?:app)?\.com/api/webhooks/(?P[0-9]{17,20})/(?P[A-Za-z0-9\.\-\_]{60,68})', url) + m = re.search(r'discord(?:app)?\.com/api/webhooks/(?P[0-9]{17,20})/(?P[A-Za-z0-9\.\-\_]{60,})', url) if m is None: raise ValueError('Invalid webhook URL given.') diff --git a/discord/webhook/sync.py b/discord/webhook/sync.py index 982f94a93..7da6ada70 100644 --- a/discord/webhook/sync.py +++ b/discord/webhook/sync.py @@ -682,7 +682,7 @@ class SyncWebhook(BaseWebhook): A partial :class:`SyncWebhook`. A partial :class:`SyncWebhook` is just a :class:`SyncWebhook` object with an ID and a token. """ - m = re.search(r'discord(?:app)?\.com/api/webhooks/(?P[0-9]{17,20})/(?P[A-Za-z0-9\.\-\_]{60,68})', url) + m = re.search(r'discord(?:app)?\.com/api/webhooks/(?P[0-9]{17,20})/(?P[A-Za-z0-9\.\-\_]{60,})', url) if m is None: raise ValueError('Invalid webhook URL given.') From be71383af9612f17926f20a503157c8a4cc1b10e Mon Sep 17 00:00:00 2001 From: Andrin S <65789180+Puncher1@users.noreply.github.com> Date: Sat, 20 May 2023 02:31:39 +0200 Subject: [PATCH 078/473] Add create_expressions permission --- discord/permissions.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/discord/permissions.py b/discord/permissions.py index 47c50c35f..c0b5ee3f4 100644 --- a/discord/permissions.py +++ b/discord/permissions.py @@ -219,6 +219,7 @@ class Permissions(BaseFlags): - :attr:`kick_members` - :attr:`ban_members` - :attr:`administrator` + - :attr:`create_expressions` .. versionchanged:: 1.7 Added :attr:`stream`, :attr:`priority_speaker` and :attr:`use_application_commands` permissions. @@ -229,9 +230,9 @@ class Permissions(BaseFlags): :attr:`request_to_speak` permissions. .. versionchanged:: 2.3 - Added :attr:`use_soundboard` + Added :attr:`use_soundboard`, :attr:`create_expressions` permissions. """ - return cls(0b1000111110110110011111101111111111101010001) + return cls(0b01000111110110110011111101111111111101010001) @classmethod def general(cls) -> Self: @@ -243,8 +244,11 @@ class Permissions(BaseFlags): permissions :attr:`administrator`, :attr:`create_instant_invite`, :attr:`kick_members`, :attr:`ban_members`, :attr:`change_nickname` and :attr:`manage_nicknames` are no longer part of the general permissions. + + .. versionchanged:: 2.3 + Added :attr:`create_expressions` permission. """ - return cls(0b01110000000010000000010010110000) + return cls(0b10000000000001110000000010000000010010110000) @classmethod def membership(cls) -> Self: @@ -557,7 +561,7 @@ class Permissions(BaseFlags): @flag_value def manage_guild_expressions(self) -> int: - """:class:`bool`: Returns ``True`` if a user can create, edit, or delete emojis, stickers, and soundboard sounds. + """:class:`bool`: Returns ``True`` if a user can edit or delete emojis, stickers, and soundboard sounds. .. versionadded:: 2.3 """ @@ -672,6 +676,14 @@ class Permissions(BaseFlags): """ return 1 << 42 + @flag_value + def create_expressions(self) -> int: + """:class:`bool`: Returns ``True`` if a user can create emojis, stickers, and soundboard sounds. + + .. versionadded:: 2.3 + """ + return 1 << 43 + @flag_value def use_external_sounds(self) -> int: """:class:`bool`: Returns ``True`` if a user can use sounds from other guilds. @@ -806,6 +818,7 @@ class PermissionOverwrite: use_soundboard: Optional[bool] use_external_sounds: Optional[bool] send_voice_messages: Optional[bool] + create_expressions: Optional[bool] def __init__(self, **kwargs: Optional[bool]): self._values: Dict[str, Optional[bool]] = {} From 92d350059bd6273169c4e6a7d315608113335e60 Mon Sep 17 00:00:00 2001 From: Alex Liu <30390986+applebee1558@users.noreply.github.com> Date: Fri, 19 May 2023 17:32:35 -0700 Subject: [PATCH 079/473] Fix build issue on Sphinx v6 --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 8fee2cbfa..a5fcc1773 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -51,7 +51,7 @@ autodoc_typehints = 'none' # napoleon_attr_annotations = False extlinks = { - 'issue': ('https://github.com/Rapptz/discord.py/issues/%s', 'GH-'), + 'issue': ('https://github.com/Rapptz/discord.py/issues/%s', 'GH-%s'), 'ddocs': ('https://discord.com/developers/docs/%s', None), } From 54c62d7ef88f13cdf152d3f27e9f5cc9ee605a76 Mon Sep 17 00:00:00 2001 From: RedGuy12 <61329810+RedGuy12@users.noreply.github.com> Date: Fri, 19 May 2023 19:35:56 -0500 Subject: [PATCH 080/473] Fix system message for channel_icon_change --- discord/message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/message.py b/discord/message.py index f99fa01fb..a7c2f695c 100644 --- a/discord/message.py +++ b/discord/message.py @@ -2023,7 +2023,7 @@ class Message(PartialMessage, Hashable): return f'{self.author.name} changed the channel name: **{self.content}**' if self.type is MessageType.channel_icon_change: - return f'{self.author.name} changed the channel icon.' + return f'{self.author.name} changed the group icon.' if self.type is MessageType.pins_add: return f'{self.author.name} pinned a message to this channel.' From 1deb5bf82dcc5f18c4724341c150e1d9cb71293c Mon Sep 17 00:00:00 2001 From: owocado <24418520+owocado@users.noreply.github.com> Date: Sat, 20 May 2023 06:07:03 +0530 Subject: [PATCH 081/473] [commands] Add Context.filesize_limit property --- discord/ext/commands/context.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/discord/ext/commands/context.py b/discord/ext/commands/context.py index 92a1a6b51..ee34e1275 100644 --- a/discord/ext/commands/context.py +++ b/discord/ext/commands/context.py @@ -430,6 +430,14 @@ class Context(discord.abc.Messageable, Generic[BotT]): return None return self.command.cog + @property + def filesize_limit(self) -> int: + """:class:`int`: Returns the maximum number of bytes files can have when uploaded to this guild or DM channel associated with this context. + + .. versionadded:: 2.3 + """ + return self.guild.filesize_limit if self.guild is not None else 26214400 + @discord.utils.cached_property def guild(self) -> Optional[Guild]: """Optional[:class:`.Guild`]: Returns the guild associated with this context's command. None if not available.""" From 53ce05b0d01494ef46c165d363ac0cfafa290f14 Mon Sep 17 00:00:00 2001 From: Andrin S <65789180+Puncher1@users.noreply.github.com> Date: Sat, 20 May 2023 02:40:52 +0200 Subject: [PATCH 082/473] Add Interaction.channel from Discord payload Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com> --- discord/channel.py | 7 +++- discord/interactions.py | 62 ++++++++++++++++++++++------------- discord/types/channel.py | 10 +++++- discord/types/interactions.py | 3 +- 4 files changed, 56 insertions(+), 26 deletions(-) diff --git a/discord/channel.py b/discord/channel.py index 907d0b4bd..8c212c0cb 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -2890,7 +2890,12 @@ class DMChannel(discord.abc.Messageable, discord.abc.PrivateChannel, Hashable): def __init__(self, *, me: ClientUser, state: ConnectionState, data: DMChannelPayload): self._state: ConnectionState = state - self.recipient: Optional[User] = state.store_user(data['recipients'][0]) + self.recipient: Optional[User] = None + + recipients = data.get('recipients') + if recipients is not None: + self.recipient = state.store_user(recipients[0]) + self.me: ClientUser = me self.id: int = int(data['id']) diff --git a/discord/interactions.py b/discord/interactions.py index f9ed7976d..f62a08703 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -25,6 +25,8 @@ DEALINGS IN THE SOFTWARE. """ from __future__ import annotations + +import logging from typing import Any, Dict, Optional, Generic, TYPE_CHECKING, Sequence, Tuple, Union import asyncio import datetime @@ -33,7 +35,7 @@ from . import utils from .enums import try_enum, Locale, InteractionType, InteractionResponseType from .errors import InteractionResponded, HTTPException, ClientException, DiscordException from .flags import MessageFlags -from .channel import PartialMessageable, ChannelType +from .channel import ChannelType from ._types import ClientT from .user import User @@ -44,6 +46,7 @@ from .http import handle_message_parameters from .webhook.async_ import async_context, Webhook, interaction_response_params, interaction_message_response_params from .app_commands.namespace import Namespace from .app_commands.translator import locale_str, TranslationContext, TranslationContextLocation +from .channel import _threaded_channel_factory __all__ = ( 'Interaction', @@ -69,12 +72,19 @@ if TYPE_CHECKING: from .ui.view import View from .app_commands.models import Choice, ChoiceT from .ui.modal import Modal - from .channel import VoiceChannel, StageChannel, TextChannel, ForumChannel, CategoryChannel + from .channel import VoiceChannel, StageChannel, TextChannel, ForumChannel, CategoryChannel, DMChannel, GroupChannel from .threads import Thread from .app_commands.commands import Command, ContextMenu InteractionChannel = Union[ - VoiceChannel, StageChannel, TextChannel, ForumChannel, CategoryChannel, Thread, PartialMessageable + VoiceChannel, + StageChannel, + TextChannel, + ForumChannel, + CategoryChannel, + Thread, + DMChannel, + GroupChannel, ] MISSING: Any = utils.MISSING @@ -96,8 +106,10 @@ class Interaction(Generic[ClientT]): The interaction type. guild_id: Optional[:class:`int`] The guild ID the interaction was sent from. - channel_id: Optional[:class:`int`] - The channel ID the interaction was sent from. + channel: Optional[Union[:class:`abc.GuildChannel`, :class:`abc.PrivateChannel`, :class:`Thread`]] + The channel the interaction was sent from. + + Note that due to a Discord limitation, if sent from a DM channel :attr:`~DMChannel.recipient` is ``None``. application_id: :class:`int` The application ID that the interaction was for. user: Union[:class:`User`, :class:`Member`] @@ -128,7 +140,6 @@ class Interaction(Generic[ClientT]): 'id', 'type', 'guild_id', - 'channel_id', 'data', 'application_id', 'message', @@ -148,7 +159,7 @@ class Interaction(Generic[ClientT]): '_original_response', '_cs_response', '_cs_followup', - '_cs_channel', + 'channel', '_cs_namespace', '_cs_command', ) @@ -171,8 +182,24 @@ class Interaction(Generic[ClientT]): self.data: Optional[InteractionData] = data.get('data') self.token: str = data['token'] self.version: int = data['version'] - self.channel_id: Optional[int] = utils._get_as_snowflake(data, 'channel_id') self.guild_id: Optional[int] = utils._get_as_snowflake(data, 'guild_id') + self.channel: Optional[InteractionChannel] = None + + raw_channel = data.get('channel', {}) + raw_ch_type = raw_channel.get('type') + if raw_ch_type is not None: + factory, ch_type = _threaded_channel_factory(raw_ch_type) # type is never None + if factory is None: + logging.info('Unknown channel type {type} for channel ID {id}.'.format_map(raw_channel)) + else: + if ch_type in (ChannelType.group, ChannelType.private): + channel = factory(me=self._client.user, data=raw_channel, state=self._state) # type: ignore + else: + guild = self._state._get_or_create_unavailable_guild(self.guild_id) # type: ignore + channel = factory(guild=guild, state=self._state, data=raw_channel) # type: ignore + + self.channel = channel + self.application_id: int = int(data['application_id']) self.locale: Locale = try_enum(Locale, data.get('locale', 'en-US')) @@ -227,21 +254,10 @@ class Interaction(Generic[ClientT]): """Optional[:class:`Guild`]: The guild the interaction was sent from.""" return self._state and self._state._get_guild(self.guild_id) - @utils.cached_slot_property('_cs_channel') - def channel(self) -> Optional[InteractionChannel]: - """Optional[Union[:class:`abc.GuildChannel`, :class:`PartialMessageable`, :class:`Thread`]]: The channel the interaction was sent from. - - Note that due to a Discord limitation, DM channels are not resolved since there is - no data to complete them. These are :class:`PartialMessageable` instead. - """ - guild = self.guild - channel = guild and guild._resolve_channel(self.channel_id) - if channel is None: - if self.channel_id is not None: - type = ChannelType.text if self.guild_id is not None else ChannelType.private - return PartialMessageable(state=self._state, guild_id=self.guild_id, id=self.channel_id, type=type) - return None - return channel + @property + def channel_id(self) -> Optional[int]: + """Optional[:class:`int`]: The ID of the channel the interaction was sent from.""" + return self.channel.id if self.channel is not None else None @property def permissions(self) -> Permissions: diff --git a/discord/types/channel.py b/discord/types/channel.py index 421232b45..3068185f1 100644 --- a/discord/types/channel.py +++ b/discord/types/channel.py @@ -150,16 +150,24 @@ class ForumChannel(_BaseTextChannel): GuildChannel = Union[TextChannel, NewsChannel, VoiceChannel, CategoryChannel, StageChannel, ThreadChannel, ForumChannel] -class DMChannel(_BaseChannel): +class _BaseDMChannel(_BaseChannel): type: Literal[1] last_message_id: Optional[Snowflake] + + +class DMChannel(_BaseDMChannel): recipients: List[PartialUser] +class InteractionDMChannel(_BaseDMChannel): + recipients: NotRequired[List[PartialUser]] + + class GroupDMChannel(_BaseChannel): type: Literal[3] icon: Optional[str] owner_id: Snowflake + recipients: List[PartialUser] Channel = Union[GuildChannel, DMChannel, GroupDMChannel] diff --git a/discord/types/interactions.py b/discord/types/interactions.py index cfbaf310e..039203dfa 100644 --- a/discord/types/interactions.py +++ b/discord/types/interactions.py @@ -27,7 +27,7 @@ from __future__ import annotations from typing import TYPE_CHECKING, Dict, List, Literal, TypedDict, Union from typing_extensions import NotRequired -from .channel import ChannelTypeWithoutThread, ThreadMetadata +from .channel import ChannelTypeWithoutThread, ThreadMetadata, GuildChannel, InteractionDMChannel, GroupDMChannel from .threads import ThreadType from .member import Member from .message import Attachment @@ -204,6 +204,7 @@ class _BaseInteraction(TypedDict): version: Literal[1] guild_id: NotRequired[Snowflake] channel_id: NotRequired[Snowflake] + channel: Union[GuildChannel, InteractionDMChannel, GroupDMChannel] app_permissions: NotRequired[str] locale: NotRequired[str] guild_locale: NotRequired[str] From 66689e16e8ddf9b2bbbb21d2db238f3027ae706c Mon Sep 17 00:00:00 2001 From: Andrin S <65789180+Puncher1@users.noreply.github.com> Date: Sat, 20 May 2023 02:47:16 +0200 Subject: [PATCH 083/473] Add with_counts param to fetch_guilds --- discord/client.py | 14 +++++++++++--- discord/guild.py | 4 ++-- discord/http.py | 2 ++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/discord/client.py b/discord/client.py index 298959b21..c4c59e75f 100644 --- a/discord/client.py +++ b/discord/client.py @@ -2059,13 +2059,15 @@ class Client: limit: Optional[int] = 200, before: Optional[SnowflakeTime] = None, after: Optional[SnowflakeTime] = None, + with_counts: bool = True, ) -> AsyncIterator[Guild]: """Retrieves an :term:`asynchronous iterator` that enables receiving your guilds. .. note:: Using this, you will only receive :attr:`.Guild.owner`, :attr:`.Guild.icon`, - :attr:`.Guild.id`, and :attr:`.Guild.name` per :class:`.Guild`. + :attr:`.Guild.id`, :attr:`.Guild.name`, :attr:`.Guild.approximate_member_count`, + and :attr:`.Guild.approximate_presence_count` per :class:`.Guild`. .. note:: @@ -2106,6 +2108,12 @@ class Client: Retrieve guilds after this date or object. If a datetime is provided, it is recommended to use a UTC aware datetime. If the datetime is naive, it is assumed to be local time. + with_counts: :class:`bool` + Whether to include count information in the guilds. This fills the + :attr:`.Guild.approximate_member_count` and :attr:`.Guild.approximate_presence_count` + attributes without needing any privileged intents. Defaults to ``True``. + + .. versionadded:: 2.3 Raises ------ @@ -2120,7 +2128,7 @@ class Client: async def _before_strategy(retrieve: int, before: Optional[Snowflake], limit: Optional[int]): before_id = before.id if before else None - data = await self.http.get_guilds(retrieve, before=before_id) + data = await self.http.get_guilds(retrieve, before=before_id, with_counts=with_counts) if data: if limit is not None: @@ -2132,7 +2140,7 @@ class Client: async def _after_strategy(retrieve: int, after: Optional[Snowflake], limit: Optional[int]): after_id = after.id if after else None - data = await self.http.get_guilds(retrieve, after=after_id) + data = await self.http.get_guilds(retrieve, after=after_id, with_counts=with_counts) if data: if limit is not None: diff --git a/discord/guild.py b/discord/guild.py index 009a1ef97..b79f3bb21 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -250,13 +250,13 @@ class Guild(Hashable): approximate_member_count: Optional[:class:`int`] The approximate number of members in the guild. This is ``None`` unless the guild is obtained - using :meth:`Client.fetch_guild` with ``with_counts=True``. + using :meth:`Client.fetch_guild` or :meth:`Client.fetch_guilds` with ``with_counts=True``. .. versionadded:: 2.0 approximate_presence_count: Optional[:class:`int`] The approximate number of members currently active in the guild. Offline members are excluded. This is ``None`` unless the guild is obtained using - :meth:`Client.fetch_guild` with ``with_counts=True``. + :meth:`Client.fetch_guild` or :meth:`Client.fetch_guilds` with ``with_counts=True``. .. versionchanged:: 2.0 premium_progress_bar_enabled: :class:`bool` diff --git a/discord/http.py b/discord/http.py index e7c23162a..5556d1a56 100644 --- a/discord/http.py +++ b/discord/http.py @@ -1373,9 +1373,11 @@ class HTTPClient: limit: int, before: Optional[Snowflake] = None, after: Optional[Snowflake] = None, + with_counts: bool = True, ) -> Response[List[guild.Guild]]: params: Dict[str, Any] = { 'limit': limit, + 'with_counts': int(with_counts), } if before: From df01db34902cb5f44d28189cc142ae19e040433e Mon Sep 17 00:00:00 2001 From: Rapptz Date: Wed, 3 May 2023 23:48:46 -0400 Subject: [PATCH 084/473] Initial support for pomelo migration --- discord/abc.py | 7 +++-- discord/ext/commands/converter.py | 36 ++++++++++--------------- discord/flags.py | 1 + discord/guild.py | 30 +++++---------------- discord/member.py | 19 ++++++------- discord/state.py | 1 + discord/team.py | 10 ++++--- discord/types/user.py | 3 ++- discord/user.py | 44 ++++++++++++++++++++++--------- discord/webhook/async_.py | 8 +++++- discord/widget.py | 14 +++++----- 11 files changed, 93 insertions(+), 80 deletions(-) diff --git a/discord/abc.py b/discord/abc.py index 4fd92e121..32d843f63 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -219,7 +219,9 @@ class User(Snowflake, Protocol): name: :class:`str` The user's username. discriminator: :class:`str` - The user's discriminator. + The user's discriminator. This is a legacy concept that is no longer used. + global_name: Optional[:class:`str`] + The user's global nickname. bot: :class:`bool` If the user is a bot account. system: :class:`bool` @@ -228,6 +230,7 @@ class User(Snowflake, Protocol): name: str discriminator: str + global_name: Optional[str] bot: bool system: bool @@ -248,7 +251,7 @@ class User(Snowflake, Protocol): @property def default_avatar(self) -> Asset: - """:class:`~discord.Asset`: Returns the default avatar for a given user. This is calculated by the user's discriminator.""" + """:class:`~discord.Asset`: Returns the default avatar for a given user.""" raise NotImplementedError @property diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py index e5be9d47f..0e4812226 100644 --- a/discord/ext/commands/converter.py +++ b/discord/ext/commands/converter.py @@ -186,9 +186,9 @@ class MemberConverter(IDConverter[discord.Member]): 1. Lookup by ID. 2. Lookup by mention. - 3. Lookup by name#discrim - 4. Lookup by name - 5. Lookup by nickname + 3. Lookup by guild nickname + 4. Lookup by global name + 5. Lookup by user name .. versionchanged:: 1.5 Raise :exc:`.MemberNotFound` instead of generic :exc:`.BadArgument` @@ -196,17 +196,15 @@ class MemberConverter(IDConverter[discord.Member]): .. versionchanged:: 1.5.1 This converter now lazily fetches members from the gateway and HTTP APIs, optionally caching the result if :attr:`.MemberCacheFlags.joined` is enabled. + + .. versionchanged:: 2.3 + This converter lookup strategy has changed due to the removal of discriminators. """ async def query_member_named(self, guild: discord.Guild, argument: str) -> Optional[discord.Member]: cache = guild._state.member_cache_flags.joined - if len(argument) > 5 and argument[-5] == '#': - username, _, discriminator = argument.rpartition('#') - members = await guild.query_members(username, limit=100, cache=cache) - return discord.utils.get(members, name=username, discriminator=discriminator) - else: - members = await guild.query_members(argument, limit=100, cache=cache) - return discord.utils.find(lambda m: m.name == argument or m.nick == argument, members) + members = await guild.query_members(argument, limit=100, cache=cache) + return discord.utils.find(lambda m: m.nick == argument or m.global_name == argument or m.name == argument, members) async def query_member_by_id(self, bot: _Bot, guild: discord.Guild, user_id: int) -> Optional[discord.Member]: ws = bot._get_websocket(shard_id=guild.shard_id) @@ -273,8 +271,8 @@ class UserConverter(IDConverter[discord.User]): 1. Lookup by ID. 2. Lookup by mention. - 3. Lookup by name#discrim - 4. Lookup by name + 3. Lookup by global name + 4. Lookup by user name .. versionchanged:: 1.5 Raise :exc:`.UserNotFound` instead of generic :exc:`.BadArgument` @@ -282,6 +280,9 @@ class UserConverter(IDConverter[discord.User]): .. versionchanged:: 1.6 This converter now lazily fetches users from the HTTP APIs if an ID is passed and it's not available in cache. + + .. versionchanged:: 2.3 + This converter lookup strategy has changed due to the removal of discriminators. """ async def convert(self, ctx: Context[BotT], argument: str) -> discord.User: @@ -307,16 +308,7 @@ class UserConverter(IDConverter[discord.User]): # Remove first character arg = arg[1:] - # check for discriminator if it exists, - if len(arg) > 5 and arg[-5] == '#': - discrim = arg[-4:] - name = arg[:-5] - predicate = lambda u: u.name == name and u.discriminator == discrim - result = discord.utils.find(predicate, state._users.values()) - if result is not None: - return result - - predicate = lambda u: u.name == arg + predicate = lambda u: u.global_name == arg or u.name == arg result = discord.utils.find(predicate, state._users.values()) if result is None: diff --git a/discord/flags.py b/discord/flags.py index b93a643e5..0fb60084d 100644 --- a/discord/flags.py +++ b/discord/flags.py @@ -816,6 +816,7 @@ class Intents(BaseFlags): - :attr:`User.name` - :attr:`User.avatar` - :attr:`User.discriminator` + - :attr:`User.global_name` For more information go to the :ref:`member intent documentation `. diff --git a/discord/guild.py b/discord/guild.py index b79f3bb21..31649376d 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1075,26 +1075,20 @@ class Guild(Hashable): def get_member_named(self, name: str, /) -> Optional[Member]: """Returns the first member found that matches the name provided. - The name can have an optional discriminator argument, e.g. "Jake#0001" - or "Jake" will both do the lookup. However the former will give a more - precise result. Note that the discriminator must have all 4 digits - for this to work. - - If a nickname is passed, then it is looked up via the nickname. Note - however, that a nickname + discriminator combo will not lookup the nickname - but rather the username + discriminator combo due to nickname + discriminator - not being unique. - If no member is found, ``None`` is returned. .. versionchanged:: 2.0 ``name`` parameter is now positional-only. + .. versionchanged:: 2.3 + + ``discriminator`` is no longer used in lookup, due to being removed on Discord. + Parameters ----------- name: :class:`str` - The name of the member to lookup with an optional discriminator. + The name of the member to lookup. Returns -------- @@ -1103,22 +1097,10 @@ class Guild(Hashable): then ``None`` is returned. """ - result = None members = self.members - if len(name) > 5 and name[-5] == '#': - # The 5 length is checking to see if #0000 is in the string, - # as a#0000 has a length of 6, the minimum for a potential - # discriminator lookup. - potential_discriminator = name[-4:] - - # do the actual lookup and return if found - # if it isn't found then we'll do a full name lookup below. - result = utils.get(members, name=name[:-5], discriminator=potential_discriminator) - if result is not None: - return result def pred(m: Member) -> bool: - return m.nick == name or m.name == name + return m.nick == name or m.global_name == name or m.name == name return utils.find(pred, members) diff --git a/discord/member.py b/discord/member.py index ee303f5bc..dad54deb0 100644 --- a/discord/member.py +++ b/discord/member.py @@ -274,7 +274,7 @@ class Member(discord.abc.Messageable, _UserTag): .. describe:: str(x) - Returns the member's name with the discriminator. + Returns the member's name with a ``@``. Attributes ---------- @@ -293,7 +293,7 @@ class Member(discord.abc.Messageable, _UserTag): guild: :class:`Guild` The guild that the member belongs to. nick: Optional[:class:`str`] - The guild specific nickname of the user. + The guild specific nickname of the user. Takes precedence over the global name. pending: :class:`bool` Whether the member is pending member verification. @@ -329,6 +329,7 @@ class Member(discord.abc.Messageable, _UserTag): name: str id: int discriminator: str + global_name: Optional[str] bot: bool system: bool created_at: datetime.datetime @@ -368,7 +369,7 @@ class Member(discord.abc.Messageable, _UserTag): def __repr__(self) -> str: return ( - f'' ) @@ -463,12 +464,12 @@ class Member(discord.abc.Messageable, _UserTag): def _update_inner_user(self, user: UserPayload) -> Optional[Tuple[User, User]]: u = self._user - original = (u.name, u._avatar, u.discriminator, u._public_flags) + original = (u.name, u._avatar, u.global_name, u._public_flags) # These keys seem to always be available - modified = (user['username'], user['avatar'], user['discriminator'], user.get('public_flags', 0)) + modified = (user['username'], user['avatar'], user.get('global_name'), user.get('public_flags', 0)) if original != modified: to_return = User._copy(self._user) - u.name, u._avatar, u.discriminator, u._public_flags = modified + u.name, u._avatar, u.global_name, u._public_flags = modified # Signal to dispatch on_user_update return to_return, u @@ -581,11 +582,11 @@ class Member(discord.abc.Messageable, _UserTag): def display_name(self) -> str: """:class:`str`: Returns the user's display name. - For regular users this is just their username, but - if they have a guild specific nickname then that + For regular users this is just their global name or their username, + but if they have a guild specific nickname then that is returned instead. """ - return self.nick or self.name + return self.nick or self.global_name or self.name @property def display_avatar(self) -> Asset: diff --git a/discord/state.py b/discord/state.py index f2f2a0a83..c13c93b7a 100644 --- a/discord/state.py +++ b/discord/state.py @@ -356,6 +356,7 @@ class ConnectionState(Generic[ClientT]): return self._users[user_id] except KeyError: user = User(state=self, data=data) + # TODO: with the removal of discrims this becomes a bit annoying if user.discriminator != '0000': self._users[user_id] = user return user diff --git a/discord/team.py b/discord/team.py index eef2c2d81..6539e07e2 100644 --- a/discord/team.py +++ b/discord/team.py @@ -108,7 +108,7 @@ class TeamMember(BaseUser): .. describe:: str(x) - Returns the team member's name with discriminator. + Returns the team member's name with a ``@``. .. versionadded:: 1.3 @@ -119,7 +119,11 @@ class TeamMember(BaseUser): id: :class:`int` The team member's unique ID. discriminator: :class:`str` - The team member's discriminator. This is given when the username has conflicts. + The team member's discriminator. This is a legacy concept that is no longer used. + global_name: Optional[:class:`str`] + The user's global nickname, taking precedence over the username in display. + + .. versionadded:: 2.3 bot: :class:`bool` Specifies if the user is a bot account. team: :class:`Team` @@ -139,5 +143,5 @@ class TeamMember(BaseUser): def __repr__(self) -> str: return ( f'<{self.__class__.__name__} id={self.id} name={self.name!r} ' - f'discriminator={self.discriminator!r} membership_state={self.membership_state!r}>' + f'global_name={self.global_name!r} membership_state={self.membership_state!r}>' ) diff --git a/discord/types/user.py b/discord/types/user.py index fba5aef5b..0a17a5459 100644 --- a/discord/types/user.py +++ b/discord/types/user.py @@ -31,6 +31,7 @@ class PartialUser(TypedDict): username: str discriminator: str avatar: Optional[str] + global_name: Optional[str] PremiumType = Literal[0, 1, 2] @@ -40,7 +41,7 @@ class User(PartialUser, total=False): bot: bool system: bool mfa_enabled: bool - local: str + locale: str verified: bool email: Optional[str] flags: int diff --git a/discord/user.py b/discord/user.py index 1b899883a..b58afaa87 100644 --- a/discord/user.py +++ b/discord/user.py @@ -65,6 +65,7 @@ class BaseUser(_UserTag): 'name', 'id', 'discriminator', + 'global_name', '_avatar', '_banner', '_accent_colour', @@ -78,6 +79,7 @@ class BaseUser(_UserTag): name: str id: int discriminator: str + global_name: Optional[str] bot: bool system: bool _state: ConnectionState @@ -92,12 +94,12 @@ class BaseUser(_UserTag): def __repr__(self) -> str: return ( - f"" ) def __str__(self) -> str: - return f'{self.name}#{self.discriminator}' + return f'@{self.name}' def __eq__(self, other: object) -> bool: return isinstance(other, _UserTag) and other.id == self.id @@ -112,6 +114,7 @@ class BaseUser(_UserTag): self.name = data['username'] self.id = int(data['id']) self.discriminator = data['discriminator'] + self.global_name = data.get('global_name') self._avatar = data['avatar'] self._banner = data.get('banner', None) self._accent_colour = data.get('accent_color', None) @@ -126,6 +129,7 @@ class BaseUser(_UserTag): self.name = user.name self.id = user.id self.discriminator = user.discriminator + self.global_name = user.global_name self._avatar = user._avatar self._banner = user._banner self._accent_colour = user._accent_colour @@ -141,6 +145,7 @@ class BaseUser(_UserTag): 'id': self.id, 'avatar': self._avatar, 'discriminator': self.discriminator, + 'global_name': self.global_name, 'bot': self.bot, } @@ -162,8 +167,13 @@ class BaseUser(_UserTag): @property def default_avatar(self) -> Asset: - """:class:`Asset`: Returns the default avatar for a given user. This is calculated by the user's discriminator.""" - return Asset._from_default_avatar(self._state, int(self.discriminator) % len(DefaultAvatar)) + """:class:`Asset`: Returns the default avatar for a given user.""" + if self.discriminator == '0': + avatar_id = self.id % len(DefaultAvatar) + else: + avatar_id = int(self.discriminator) % len(DefaultAvatar) + + return Asset._from_default_avatar(self._state, avatar_id) @property def display_avatar(self) -> Asset: @@ -260,10 +270,12 @@ class BaseUser(_UserTag): def display_name(self) -> str: """:class:`str`: Returns the user's display name. - For regular users this is just their username, but - if they have a guild specific nickname then that + For regular users this is just their global name or their username, + but if they have a guild specific nickname then that is returned instead. """ + if self.global_name: + return self.global_name return self.name def mentioned_in(self, message: Message) -> bool: @@ -305,7 +317,7 @@ class ClientUser(BaseUser): .. describe:: str(x) - Returns the user's name with discriminator. + Returns the user's name with a ``@``. Attributes ----------- @@ -314,7 +326,11 @@ class ClientUser(BaseUser): id: :class:`int` The user's unique ID. discriminator: :class:`str` - The user's discriminator. This is given when the username has conflicts. + The user's discriminator. This is a legacy concept that is no longer used. + global_name: Optional[:class:`str`] + The user's global nickname, taking precedence over the username in display. + + .. versionadded:: 2.3 bot: :class:`bool` Specifies if the user is a bot account. system: :class:`bool` @@ -343,7 +359,7 @@ class ClientUser(BaseUser): def __repr__(self) -> str: return ( - f'' ) @@ -441,7 +457,7 @@ class User(BaseUser, discord.abc.Messageable): .. describe:: str(x) - Returns the user's name with discriminator. + Returns the user's name with a ``@``. Attributes ----------- @@ -450,7 +466,11 @@ class User(BaseUser, discord.abc.Messageable): id: :class:`int` The user's unique ID. discriminator: :class:`str` - The user's discriminator. This is given when the username has conflicts. + The user's discriminator. This is a legacy concept that is no longer used. + global_name: Optional[:class:`str`] + The user's global nickname, taking precedence over the username in display. + + .. versionadded:: 2.3 bot: :class:`bool` Specifies if the user is a bot account. system: :class:`bool` @@ -460,7 +480,7 @@ class User(BaseUser, discord.abc.Messageable): __slots__ = ('__weakref__',) def __repr__(self) -> str: - return f'' + return f'' async def _get_channel(self) -> DMChannel: ch = await self.create_dm() diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index c574914a6..f0a649ff8 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -1301,7 +1301,13 @@ class Webhook(BaseWebhook): 'name': name, 'channel_id': channel.id, 'guild_id': channel.guild.id, - 'user': {'username': user.name, 'discriminator': user.discriminator, 'id': user.id, 'avatar': user._avatar}, + 'user': { + 'username': user.name, + 'discriminator': user.discriminator, + 'global_name': user.global_name, + 'id': user.id, + 'avatar': user._avatar, + }, } state = channel._state diff --git a/discord/widget.py b/discord/widget.py index 2a7c17a21..b2289c2e8 100644 --- a/discord/widget.py +++ b/discord/widget.py @@ -121,7 +121,7 @@ class WidgetMember(BaseUser): .. describe:: str(x) - Returns the widget member's ``name#discriminator``. + Returns the widget member's name with a ``@``. Attributes ----------- @@ -130,13 +130,17 @@ class WidgetMember(BaseUser): name: :class:`str` The member's username. discriminator: :class:`str` - The member's discriminator. + The member's discriminator. This is a legacy concept that is no longer used. + global_name: Optional[:class:`str`] + The member's global nickname, taking precedence over the username in display. + + .. versionadded:: 2.3 bot: :class:`bool` Whether the member is a bot. status: :class:`Status` The member's status. nick: Optional[:class:`str`] - The member's nickname. + The member's guild-specific nickname. Takes precedence over the global name. avatar: Optional[:class:`str`] The member's avatar hash. activity: Optional[Union[:class:`BaseActivity`, :class:`Spotify`]] @@ -191,9 +195,7 @@ class WidgetMember(BaseUser): self.connected_channel: Optional[WidgetChannel] = connected_channel def __repr__(self) -> str: - return ( - f"" - ) + return f"" @property def display_name(self) -> str: From b8310268b0b335a7fe5597c0fe678c3b9d62233f Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 4 May 2023 20:43:11 -0400 Subject: [PATCH 085/473] Fix default_avatar detection for migrated users --- discord/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/user.py b/discord/user.py index b58afaa87..303a33ea6 100644 --- a/discord/user.py +++ b/discord/user.py @@ -169,7 +169,7 @@ class BaseUser(_UserTag): def default_avatar(self) -> Asset: """:class:`Asset`: Returns the default avatar for a given user.""" if self.discriminator == '0': - avatar_id = self.id % len(DefaultAvatar) + avatar_id = (self.id >> 22) % len(DefaultAvatar) else: avatar_id = int(self.discriminator) % len(DefaultAvatar) From 9ebc13e160cd339f000d80d1d00dc625ab27b9c0 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 4 May 2023 21:56:34 -0400 Subject: [PATCH 086/473] Only use @ prefix in __str__ if the user is migrated --- discord/member.py | 2 +- discord/team.py | 4 ++-- discord/user.py | 8 +++++--- discord/widget.py | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/discord/member.py b/discord/member.py index dad54deb0..a45fcae43 100644 --- a/discord/member.py +++ b/discord/member.py @@ -274,7 +274,7 @@ class Member(discord.abc.Messageable, _UserTag): .. describe:: str(x) - Returns the member's name with a ``@``. + Returns the member's handle (e.g. ``@user`` or ``user#discriminator``). Attributes ---------- diff --git a/discord/team.py b/discord/team.py index 6539e07e2..89bc2cfa1 100644 --- a/discord/team.py +++ b/discord/team.py @@ -108,7 +108,7 @@ class TeamMember(BaseUser): .. describe:: str(x) - Returns the team member's name with a ``@``. + Returns the team member's handle (e.g. ``@user`` or ``user#discriminator``). .. versionadded:: 1.3 @@ -121,7 +121,7 @@ class TeamMember(BaseUser): discriminator: :class:`str` The team member's discriminator. This is a legacy concept that is no longer used. global_name: Optional[:class:`str`] - The user's global nickname, taking precedence over the username in display. + The team member's global nickname, taking precedence over the username in display. .. versionadded:: 2.3 bot: :class:`bool` diff --git a/discord/user.py b/discord/user.py index 303a33ea6..6b3a041bb 100644 --- a/discord/user.py +++ b/discord/user.py @@ -99,7 +99,9 @@ class BaseUser(_UserTag): ) def __str__(self) -> str: - return f'@{self.name}' + if self.discriminator == '0': + return f'@{self.name}' + return f'{self.name}#{self.discriminator}' def __eq__(self, other: object) -> bool: return isinstance(other, _UserTag) and other.id == self.id @@ -317,7 +319,7 @@ class ClientUser(BaseUser): .. describe:: str(x) - Returns the user's name with a ``@``. + Returns the user's handle (e.g. ``@user`` or ``user#discriminator``). Attributes ----------- @@ -457,7 +459,7 @@ class User(BaseUser, discord.abc.Messageable): .. describe:: str(x) - Returns the user's name with a ``@``. + Returns the user's handle (e.g. ``@user`` or ``user#discriminator``). Attributes ----------- diff --git a/discord/widget.py b/discord/widget.py index b2289c2e8..268173585 100644 --- a/discord/widget.py +++ b/discord/widget.py @@ -121,7 +121,7 @@ class WidgetMember(BaseUser): .. describe:: str(x) - Returns the widget member's name with a ``@``. + Returns the widget member's handle (e.g. ``@user`` or ``user#discriminator``). Attributes ----------- From 48cca30ca1bd400310351c942dec49a2da68016e Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 6 May 2023 22:43:25 -0400 Subject: [PATCH 087/473] Revert removal of discriminator lookup --- discord/ext/commands/converter.py | 49 +++++++++++++++++++------------ discord/guild.py | 16 ++++++++-- 2 files changed, 44 insertions(+), 21 deletions(-) diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py index 0e4812226..4cd8a3533 100644 --- a/discord/ext/commands/converter.py +++ b/discord/ext/commands/converter.py @@ -186,9 +186,11 @@ class MemberConverter(IDConverter[discord.Member]): 1. Lookup by ID. 2. Lookup by mention. - 3. Lookup by guild nickname - 4. Lookup by global name - 5. Lookup by user name + 3. Lookup by username#discriminator (deprecated). + 4. Lookup by username#0 (deprecated, only gets users that migrated from their discriminator). + 5. Lookup by guild nickname. + 6. Lookup by global name. + 7. Lookup by user name. .. versionchanged:: 1.5 Raise :exc:`.MemberNotFound` instead of generic :exc:`.BadArgument` @@ -197,14 +199,23 @@ class MemberConverter(IDConverter[discord.Member]): This converter now lazily fetches members from the gateway and HTTP APIs, optionally caching the result if :attr:`.MemberCacheFlags.joined` is enabled. - .. versionchanged:: 2.3 - This converter lookup strategy has changed due to the removal of discriminators. + .. deprecated:: 2.3 + Looking up users by discriminator will be removed in a future version due to + the removal of discriminators in an API change. """ async def query_member_named(self, guild: discord.Guild, argument: str) -> Optional[discord.Member]: cache = guild._state.member_cache_flags.joined - members = await guild.query_members(argument, limit=100, cache=cache) - return discord.utils.find(lambda m: m.nick == argument or m.global_name == argument or m.name == argument, members) + username, _, discriminator = argument.rpartition('#') + if discriminator == '0' or (len(discriminator) == 4 and discriminator.isdigit()): + lookup = username + predicate = lambda m: m.name == username and m.discriminator == discriminator + else: + lookup = argument + predicate = lambda m: m.nick == argument or m.global_name == argument or m.name == argument + + members = await guild.query_members(lookup, limit=100, cache=cache) + return discord.utils.find(predicate, members) async def query_member_by_id(self, bot: _Bot, guild: discord.Guild, user_id: int) -> Optional[discord.Member]: ws = bot._get_websocket(shard_id=guild.shard_id) @@ -271,8 +282,10 @@ class UserConverter(IDConverter[discord.User]): 1. Lookup by ID. 2. Lookup by mention. - 3. Lookup by global name - 4. Lookup by user name + 3. Lookup by username#discriminator (deprecated). + 4. Lookup by username#0 (deprecated, only gets users that migrated from their discriminator). + 5. Lookup by global name. + 6. Lookup by user name. .. versionchanged:: 1.5 Raise :exc:`.UserNotFound` instead of generic :exc:`.BadArgument` @@ -281,8 +294,9 @@ class UserConverter(IDConverter[discord.User]): This converter now lazily fetches users from the HTTP APIs if an ID is passed and it's not available in cache. - .. versionchanged:: 2.3 - This converter lookup strategy has changed due to the removal of discriminators. + .. deprecated:: 2.3 + Looking up users by discriminator will be removed in a future version due to + the removal of discriminators in an API change. """ async def convert(self, ctx: Context[BotT], argument: str) -> discord.User: @@ -301,16 +315,13 @@ class UserConverter(IDConverter[discord.User]): return result # type: ignore - arg = argument - - # Remove the '@' character if this is the first character from the argument - if arg[0] == '@': - # Remove first character - arg = arg[1:] + username, _, discriminator = argument.rpartition('#') + if discriminator == '0' or (len(discriminator) == 4 and discriminator.isdigit()): + predicate = lambda u: u.name == username and u.discriminator == discriminator + else: + predicate = lambda u: u.global_name == argument or u.name == argument - predicate = lambda u: u.global_name == arg or u.name == arg result = discord.utils.find(predicate, state._users.values()) - if result is None: raise UserNotFound(argument) diff --git a/discord/guild.py b/discord/guild.py index 31649376d..ea5d3a967 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1075,15 +1075,23 @@ class Guild(Hashable): def get_member_named(self, name: str, /) -> Optional[Member]: """Returns the first member found that matches the name provided. + The name is looked up in the following order: + + - Username#Discriminator (deprecated) + - Username#0 (deprecated, only gets users that migrated from their discriminator) + - Nickname + - Global name + - Username + If no member is found, ``None`` is returned. .. versionchanged:: 2.0 ``name`` parameter is now positional-only. - .. versionchanged:: 2.3 + .. deprecated:: 2.3 - ``discriminator`` is no longer used in lookup, due to being removed on Discord. + Looking up users via discriminator due to Discord API change. Parameters ----------- @@ -1099,6 +1107,10 @@ class Guild(Hashable): members = self.members + username, _, discriminator = name.rpartition('#') + if discriminator == '0' or (len(discriminator) == 4 and discriminator.isdigit()): + return utils.find(lambda m: m.name == username and m.discriminator == discriminator, members) + def pred(m: Member) -> bool: return m.nick == name or m.global_name == name or m.name == name From 8d17aa23c958050ae0c04ae0dbfb1b49c1426a6e Mon Sep 17 00:00:00 2001 From: Rapptz Date: Fri, 19 May 2023 20:24:23 -0400 Subject: [PATCH 088/473] Remove @ prefix from usernames Discord seemed to have backtracked on this display --- discord/member.py | 2 +- discord/team.py | 2 +- discord/user.py | 6 +++--- discord/widget.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/discord/member.py b/discord/member.py index a45fcae43..b2a819732 100644 --- a/discord/member.py +++ b/discord/member.py @@ -274,7 +274,7 @@ class Member(discord.abc.Messageable, _UserTag): .. describe:: str(x) - Returns the member's handle (e.g. ``@user`` or ``user#discriminator``). + Returns the member's handle (e.g. ``name`` or ``name#discriminator``). Attributes ---------- diff --git a/discord/team.py b/discord/team.py index 89bc2cfa1..6d441078e 100644 --- a/discord/team.py +++ b/discord/team.py @@ -108,7 +108,7 @@ class TeamMember(BaseUser): .. describe:: str(x) - Returns the team member's handle (e.g. ``@user`` or ``user#discriminator``). + Returns the team member's handle (e.g. ``name`` or ``name#discriminator``). .. versionadded:: 1.3 diff --git a/discord/user.py b/discord/user.py index 6b3a041bb..04efd9653 100644 --- a/discord/user.py +++ b/discord/user.py @@ -100,7 +100,7 @@ class BaseUser(_UserTag): def __str__(self) -> str: if self.discriminator == '0': - return f'@{self.name}' + return self.name return f'{self.name}#{self.discriminator}' def __eq__(self, other: object) -> bool: @@ -319,7 +319,7 @@ class ClientUser(BaseUser): .. describe:: str(x) - Returns the user's handle (e.g. ``@user`` or ``user#discriminator``). + Returns the user's handle (e.g. ``name`` or ``name#discriminator``). Attributes ----------- @@ -459,7 +459,7 @@ class User(BaseUser, discord.abc.Messageable): .. describe:: str(x) - Returns the user's handle (e.g. ``@user`` or ``user#discriminator``). + Returns the user's handle (e.g. ``name`` or ``name#discriminator``). Attributes ----------- diff --git a/discord/widget.py b/discord/widget.py index 268173585..822008665 100644 --- a/discord/widget.py +++ b/discord/widget.py @@ -121,7 +121,7 @@ class WidgetMember(BaseUser): .. describe:: str(x) - Returns the widget member's handle (e.g. ``@user`` or ``user#discriminator``). + Returns the widget member's handle (e.g. ``name`` or ``name#discriminator``). Attributes ----------- From 8d583ea71bbb13f30b09b10fc65151948012f2cd Mon Sep 17 00:00:00 2001 From: Rapptz Date: Fri, 19 May 2023 20:28:39 -0400 Subject: [PATCH 089/473] Update discriminator again for user_update events --- discord/member.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/discord/member.py b/discord/member.py index b2a819732..04ce645c9 100644 --- a/discord/member.py +++ b/discord/member.py @@ -464,12 +464,18 @@ class Member(discord.abc.Messageable, _UserTag): def _update_inner_user(self, user: UserPayload) -> Optional[Tuple[User, User]]: u = self._user - original = (u.name, u._avatar, u.global_name, u._public_flags) + original = (u.name, u.discriminator, u._avatar, u.global_name, u._public_flags) # These keys seem to always be available - modified = (user['username'], user['avatar'], user.get('global_name'), user.get('public_flags', 0)) + modified = ( + user['username'], + user['discriminator'], + user['avatar'], + user.get('global_name'), + user.get('public_flags', 0), + ) if original != modified: to_return = User._copy(self._user) - u.name, u._avatar, u.global_name, u._public_flags = modified + u.name, u.discriminator, u._avatar, u.global_name, u._public_flags = modified # Signal to dispatch on_user_update return to_return, u From e870bb1335e3f824c83a40df4ea9b17f215fde63 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Fri, 19 May 2023 21:21:37 -0400 Subject: [PATCH 090/473] Add constant for the default file size limit --- discord/ext/commands/context.py | 2 +- discord/guild.py | 6 +++--- discord/utils.py | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/discord/ext/commands/context.py b/discord/ext/commands/context.py index ee34e1275..40ef48cf8 100644 --- a/discord/ext/commands/context.py +++ b/discord/ext/commands/context.py @@ -436,7 +436,7 @@ class Context(discord.abc.Messageable, Generic[BotT]): .. versionadded:: 2.3 """ - return self.guild.filesize_limit if self.guild is not None else 26214400 + return self.guild.filesize_limit if self.guild is not None else discord.utils.DEFAULT_FILE_SIZE_LIMIT_BYTES @discord.utils.cached_property def guild(self) -> Optional[Guild]: diff --git a/discord/guild.py b/discord/guild.py index ea5d3a967..0c50f5aeb 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -324,9 +324,9 @@ class Guild(Hashable): ) _PREMIUM_GUILD_LIMITS: ClassVar[Dict[Optional[int], _GuildLimit]] = { - None: _GuildLimit(emoji=50, stickers=5, bitrate=96e3, filesize=26214400), - 0: _GuildLimit(emoji=50, stickers=5, bitrate=96e3, filesize=26214400), - 1: _GuildLimit(emoji=100, stickers=15, bitrate=128e3, filesize=26214400), + None: _GuildLimit(emoji=50, stickers=5, bitrate=96e3, filesize=utils.DEFAULT_FILE_SIZE_LIMIT_BYTES), + 0: _GuildLimit(emoji=50, stickers=5, bitrate=96e3, filesize=utils.DEFAULT_FILE_SIZE_LIMIT_BYTES), + 1: _GuildLimit(emoji=100, stickers=15, bitrate=128e3, filesize=utils.DEFAULT_FILE_SIZE_LIMIT_BYTES), 2: _GuildLimit(emoji=150, stickers=30, bitrate=256e3, filesize=52428800), 3: _GuildLimit(emoji=250, stickers=60, bitrate=384e3, filesize=104857600), } diff --git a/discord/utils.py b/discord/utils.py index 6d1e2ed17..3ee867975 100644 --- a/discord/utils.py +++ b/discord/utils.py @@ -100,6 +100,7 @@ __all__ = ( ) DISCORD_EPOCH = 1420070400000 +DEFAULT_FILE_SIZE_LIMIT_BYTES = 26214400 class _MissingSentinel: From 0e727d8e6d386738c1b3b587d9c83b2c253c0e1a Mon Sep 17 00:00:00 2001 From: owocado <24418520+owocado@users.noreply.github.com> Date: Wed, 24 May 2023 04:12:12 +0530 Subject: [PATCH 091/473] Fix StageChannel.last_message_id always being None --- discord/state.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/state.py b/discord/state.py index c13c93b7a..7da1a8f15 100644 --- a/discord/state.py +++ b/discord/state.py @@ -615,7 +615,7 @@ class ConnectionState(Generic[ClientT]): if self._messages is not None: self._messages.append(message) # we ensure that the channel is either a TextChannel, VoiceChannel, or Thread - if channel and channel.__class__ in (TextChannel, VoiceChannel, Thread): + if channel and channel.__class__ in (TextChannel, VoiceChannel, Thread, StageChannel): channel.last_message_id = message.id # type: ignore def parse_message_delete(self, data: gw.MessageDeleteEvent) -> None: From 2ab6541715b8ffc97c8f787749c301d2721705ba Mon Sep 17 00:00:00 2001 From: Sebastian Law Date: Tue, 23 May 2023 17:31:49 -0700 Subject: [PATCH 092/473] [commands] Document exceptions being ignored in teardown and cog_unload Co-authored-by: Josh --- discord/ext/commands/cog.py | 2 ++ docs/ext/commands/extensions.rst | 2 ++ 2 files changed, 4 insertions(+) diff --git a/discord/ext/commands/cog.py b/discord/ext/commands/cog.py index 02136bce8..319f85b80 100644 --- a/discord/ext/commands/cog.py +++ b/discord/ext/commands/cog.py @@ -550,6 +550,8 @@ class Cog(metaclass=CogMeta): Subclasses must replace this if they want special unloading behaviour. + Exceptions raised in this method are ignored during extension unloading. + .. versionchanged:: 2.0 This method can now be a :term:`coroutine`. diff --git a/docs/ext/commands/extensions.rst b/docs/ext/commands/extensions.rst index 9351c9702..d03607845 100644 --- a/docs/ext/commands/extensions.rst +++ b/docs/ext/commands/extensions.rst @@ -54,6 +54,8 @@ Cleaning Up Although rare, sometimes an extension needs to clean-up or know when it's being unloaded. For cases like these, there is another entry point named ``teardown`` which is similar to ``setup`` except called when the extension is unloaded. +Exceptions raised in the ``teardown`` function are ignored, and the extension is still unloaded. + .. code-block:: python3 :caption: basic_ext.py From 70b19c869581cc2fccc7f6b724ffccc231919572 Mon Sep 17 00:00:00 2001 From: Senev <91662824+senev3141@users.noreply.github.com> Date: Sun, 28 May 2023 13:04:38 +0200 Subject: [PATCH 093/473] Updated deprecated versioning in .readthedocs.yml --- .readthedocs.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index f67ef5268..68c792379 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -2,7 +2,9 @@ version: 2 formats: [] build: - image: latest + os: "ubuntu-22.04" + tools: + python: "3.8" sphinx: configuration: docs/conf.py @@ -10,7 +12,6 @@ sphinx: builder: html python: - version: 3.8 install: - method: pip path: . From a8882f7cb2dff550102d83ee21c08d95ad259e39 Mon Sep 17 00:00:00 2001 From: kairi Date: Mon, 29 May 2023 17:47:59 +0900 Subject: [PATCH 094/473] Fix Piped Audio Input Ends Prematurely Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com> --- discord/player.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/discord/player.py b/discord/player.py index 2030442af..38113ebd8 100644 --- a/discord/player.py +++ b/discord/player.py @@ -210,7 +210,8 @@ class FFmpegAudio(AudioSource): # arbitrarily large read size data = source.read(8192) if not data: - self._process.terminate() + if self._stdin is not None: + self._stdin.close() return try: if self._stdin is not None: From a9bd698683f4f8a9d9904a5ea3e6887b9810002c Mon Sep 17 00:00:00 2001 From: Agent-E11 <116777388+Agent-E11@users.noreply.github.com> Date: Wed, 31 May 2023 19:01:19 -0700 Subject: [PATCH 095/473] Add more specific directions (OAuth2 > URL Generator) --- docs/discord.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/discord.rst b/docs/discord.rst index 63485138e..d58ca8fb0 100644 --- a/docs/discord.rst +++ b/docs/discord.rst @@ -61,7 +61,7 @@ If you want to invite your bot you must create an invite URL for it. 1. Make sure you're logged on to the `Discord website `_. 2. Navigate to the `application page `_ 3. Click on your bot's page. -4. Go to the "OAuth2" tab. +4. Go to the "OAuth2 > URL Generator" tab. .. image:: /images/discord_oauth2.png :alt: How the OAuth2 page should look like. From 6b6cbc44ce66bfb09647188a5bdd3737c351409a Mon Sep 17 00:00:00 2001 From: yvqc <88755906+yvqc@users.noreply.github.com> Date: Sun, 4 Jun 2023 13:50:56 +0200 Subject: [PATCH 096/473] Fix TextInput's is_persistent() flow --- discord/ui/select.py | 4 ++-- discord/ui/text_input.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/discord/ui/select.py b/discord/ui/select.py index bcd7b466d..222596075 100644 --- a/discord/ui/select.py +++ b/discord/ui/select.py @@ -162,10 +162,10 @@ class BaseSelect(Item[V]): @custom_id.setter def custom_id(self, value: str) -> None: if not isinstance(value, str): - raise TypeError('custom_id must be None or str') + raise TypeError('custom_id must be a str') self._underlying.custom_id = value - self._provided_custom_id = value is not None + self._provided_custom_id = True @property def placeholder(self) -> Optional[str]: diff --git a/discord/ui/text_input.py b/discord/ui/text_input.py index 79ac652b9..95524ef51 100644 --- a/discord/ui/text_input.py +++ b/discord/ui/text_input.py @@ -137,10 +137,11 @@ class TextInput(Item[V]): @custom_id.setter def custom_id(self, value: str) -> None: if not isinstance(value, str): - raise TypeError('custom_id must be None or str') + raise TypeError('custom_id must be a str') self._underlying.custom_id = value - + self._provided_custom_id = True + @property def width(self) -> int: return 5 From 223e95a252c8fe14be8d84ed8f1dc272075dd87e Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 4 Jun 2023 07:52:09 -0400 Subject: [PATCH 097/473] Catch TypeError for unhashable annotation types --- discord/app_commands/transformers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/app_commands/transformers.py b/discord/app_commands/transformers.py index 0816c5b87..8f009181b 100644 --- a/discord/app_commands/transformers.py +++ b/discord/app_commands/transformers.py @@ -750,7 +750,7 @@ def get_supported_annotation( try: return (_mapping[annotation], MISSING, True) - except KeyError: + except (KeyError, TypeError): pass if isinstance(annotation, Transformer): From 914773d0fb4c5c66edce4d1f033093b7fe0d6d1b Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 4 Jun 2023 07:53:25 -0400 Subject: [PATCH 098/473] Remove trailing whitespace --- discord/ui/text_input.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/ui/text_input.py b/discord/ui/text_input.py index 95524ef51..23c1d874f 100644 --- a/discord/ui/text_input.py +++ b/discord/ui/text_input.py @@ -141,7 +141,7 @@ class TextInput(Item[V]): self._underlying.custom_id = value self._provided_custom_id = True - + @property def width(self) -> int: return 5 From e6d2d82803d79cdd3fccecb7c5fd473e98100787 Mon Sep 17 00:00:00 2001 From: Michael H Date: Sun, 4 Jun 2023 15:11:16 -0700 Subject: [PATCH 099/473] Set socket family of connector to AF_INET - discord doesn't support ipv6 - prevents issues with hosts with DNS64 enabled - resolves #9442 --- discord/http.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/discord/http.py b/discord/http.py index 5556d1a56..6e803830e 100644 --- a/discord/http.py +++ b/discord/http.py @@ -48,6 +48,7 @@ from typing import ( from urllib.parse import quote as _uriquote from collections import deque import datetime +import socket import aiohttp @@ -784,7 +785,8 @@ class HTTPClient: async def static_login(self, token: str) -> user.User: # Necessary to get aiohttp to stop complaining about session creation if self.connector is MISSING: - self.connector = aiohttp.TCPConnector(limit=0) + # discord does not support ipv6 + self.connector = aiohttp.TCPConnector(limit=0, family=socket.AF_INET) self.__session = aiohttp.ClientSession( connector=self.connector, From eedd7e3014220e4237d69e6a1597bde91d6046de Mon Sep 17 00:00:00 2001 From: Rapptz Date: Wed, 7 Jun 2023 22:12:47 -0400 Subject: [PATCH 100/473] Add support for new pink default avatars --- discord/colour.py | 10 ++++++++++ discord/enums.py | 1 + discord/user.py | 2 +- docs/api.rst | 6 ++++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/discord/colour.py b/discord/colour.py index 52dca9cc0..e640f9df4 100644 --- a/discord/colour.py +++ b/discord/colour.py @@ -509,5 +509,15 @@ class Colour: """ return cls(0xEEEFF1) + @classmethod + def pink(cls) -> Self: + """A factory method that returns a :class:`Colour` with a value of ``0xEB459F``. + + .. colour:: #EB459F + + .. versionadded:: 2.3 + """ + return cls(0xEB459F) + Color = Colour diff --git a/discord/enums.py b/discord/enums.py index 94ca8c726..81d5cb444 100644 --- a/discord/enums.py +++ b/discord/enums.py @@ -295,6 +295,7 @@ class DefaultAvatar(Enum): green = 2 orange = 3 red = 4 + pink = 5 def __str__(self) -> str: return self.name diff --git a/discord/user.py b/discord/user.py index 04efd9653..cc836374a 100644 --- a/discord/user.py +++ b/discord/user.py @@ -173,7 +173,7 @@ class BaseUser(_UserTag): if self.discriminator == '0': avatar_id = (self.id >> 22) % len(DefaultAvatar) else: - avatar_id = int(self.discriminator) % len(DefaultAvatar) + avatar_id = int(self.discriminator) % 5 return Asset._from_default_avatar(self._state, avatar_id) diff --git a/docs/api.rst b/docs/api.rst index 4a8233065..8a899bbc7 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -2896,6 +2896,12 @@ of :class:`enum.Enum`. Represents the default avatar with the color red. See also :attr:`Colour.red` + .. attribute:: pink + + Represents the default avatar with the color pink. + See also :attr:`Colour.pink` + + .. versionadded:: 2.3 .. class:: StickerType From d34a88411d3d973453d80128ab924f6aca197995 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Wed, 7 Jun 2023 22:13:58 -0400 Subject: [PATCH 101/473] Fix spelling of DefaultAvatar colour doc strings --- docs/api.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index 8a899bbc7..29bb530ba 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -2875,30 +2875,30 @@ of :class:`enum.Enum`. .. attribute:: blurple - Represents the default avatar with the color blurple. + Represents the default avatar with the colour blurple. See also :attr:`Colour.blurple` .. attribute:: grey - Represents the default avatar with the color grey. + Represents the default avatar with the colour grey. See also :attr:`Colour.greyple` .. attribute:: gray An alias for :attr:`grey`. .. attribute:: green - Represents the default avatar with the color green. + Represents the default avatar with the colour green. See also :attr:`Colour.green` .. attribute:: orange - Represents the default avatar with the color orange. + Represents the default avatar with the colour orange. See also :attr:`Colour.orange` .. attribute:: red - Represents the default avatar with the color red. + Represents the default avatar with the colour red. See also :attr:`Colour.red` .. attribute:: pink - Represents the default avatar with the color pink. + Represents the default avatar with the colour pink. See also :attr:`Colour.pink` .. versionadded:: 2.3 From 94bf7d8644954518447f8636d58267259ef27947 Mon Sep 17 00:00:00 2001 From: Soheab_ <33902984+Soheab@users.noreply.github.com> Date: Sun, 11 Jun 2023 18:38:39 +0200 Subject: [PATCH 102/473] [commands] Add displayed_name to commands.Parameter --- discord/ext/commands/core.py | 12 ++++++++++-- discord/ext/commands/errors.py | 8 ++++---- discord/ext/commands/help.py | 2 +- discord/ext/commands/parameters.py | 27 ++++++++++++++++++++++++--- 4 files changed, 39 insertions(+), 10 deletions(-) diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 8140dca00..ffbefe284 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -151,6 +151,7 @@ def get_signature_parameters( parameter._default = default.default parameter._description = default._description parameter._displayed_default = default._displayed_default + parameter._displayed_name = default._displayed_name annotation = parameter.annotation @@ -194,8 +195,13 @@ def extract_descriptions_from_docstring(function: Callable[..., Any], params: Di description, param_docstring = divide for match in NUMPY_DOCSTRING_ARG_REGEX.finditer(param_docstring): name = match.group('name') + if name not in params: - continue + is_display_name = discord.utils.get(params.values(), displayed_name=name) + if is_display_name: + name = is_display_name.name + else: + continue param = params[name] if param.description is None: @@ -1169,7 +1175,9 @@ class Command(_BaseCommand, Generic[CogT, P, T]): return '' result = [] - for name, param in params.items(): + for param in params.values(): + name = param.displayed_name or param.name + greedy = isinstance(param.converter, Greedy) optional = False # postpone evaluation of if it's an optional argument diff --git a/discord/ext/commands/errors.py b/discord/ext/commands/errors.py index b25e6ae95..736d0b5af 100644 --- a/discord/ext/commands/errors.py +++ b/discord/ext/commands/errors.py @@ -182,7 +182,7 @@ class MissingRequiredArgument(UserInputError): def __init__(self, param: Parameter) -> None: self.param: Parameter = param - super().__init__(f'{param.name} is a required argument that is missing.') + super().__init__(f'{param.displayed_name or param.name} is a required argument that is missing.') class MissingRequiredAttachment(UserInputError): @@ -201,7 +201,7 @@ class MissingRequiredAttachment(UserInputError): def __init__(self, param: Parameter) -> None: self.param: Parameter = param - super().__init__(f'{param.name} is a required argument that is missing an attachment.') + super().__init__(f'{param.displayed_name or param.name} is a required argument that is missing an attachment.') class TooManyArguments(UserInputError): @@ -901,7 +901,7 @@ class BadUnionArgument(UserInputError): else: fmt = ' or '.join(to_string) - super().__init__(f'Could not convert "{param.name}" into {fmt}.') + super().__init__(f'Could not convert "{param.displayed_name or param.name}" into {fmt}.') class BadLiteralArgument(UserInputError): @@ -938,7 +938,7 @@ class BadLiteralArgument(UserInputError): else: fmt = ' or '.join(to_string) - super().__init__(f'Could not convert "{param.name}" into the literal {fmt}.') + super().__init__(f'Could not convert "{param.displayed_name or param.name}" into the literal {fmt}.') class ArgumentParsingError(UserInputError): diff --git a/discord/ext/commands/help.py b/discord/ext/commands/help.py index d8f341474..32228d205 100644 --- a/discord/ext/commands/help.py +++ b/discord/ext/commands/help.py @@ -1166,7 +1166,7 @@ class DefaultHelpCommand(HelpCommand): get_width = discord.utils._string_width for argument in arguments: - name = argument.name + name = argument.displayed_name or argument.name width = max_size - (get_width(name) - len(name)) entry = f'{self.indent * " "}{name:<{width}} {argument.description or self.default_argument_description}' # we do not want to shorten the default value, if any. diff --git a/discord/ext/commands/parameters.py b/discord/ext/commands/parameters.py index 5039a16aa..d3302f5a3 100644 --- a/discord/ext/commands/parameters.py +++ b/discord/ext/commands/parameters.py @@ -87,7 +87,7 @@ class Parameter(inspect.Parameter): .. versionadded:: 2.0 """ - __slots__ = ('_displayed_default', '_description', '_fallback') + __slots__ = ('_displayed_default', '_description', '_fallback', '_displayed_name') def __init__( self, @@ -97,6 +97,7 @@ class Parameter(inspect.Parameter): annotation: Any = empty, description: str = empty, displayed_default: str = empty, + displayed_name: str = empty, ) -> None: super().__init__(name=name, kind=kind, default=default, annotation=annotation) self._name = name @@ -106,6 +107,7 @@ class Parameter(inspect.Parameter): self._annotation = annotation self._displayed_default = displayed_default self._fallback = False + self._displayed_name = displayed_name def replace( self, @@ -116,6 +118,7 @@ class Parameter(inspect.Parameter): annotation: Any = MISSING, description: str = MISSING, displayed_default: Any = MISSING, + displayed_name: Any = MISSING, ) -> Self: if name is MISSING: name = self._name @@ -129,6 +132,8 @@ class Parameter(inspect.Parameter): description = self._description if displayed_default is MISSING: displayed_default = self._displayed_default + if displayed_name is MISSING: + displayed_name = self._displayed_name return self.__class__( name=name, @@ -137,6 +142,7 @@ class Parameter(inspect.Parameter): annotation=annotation, description=description, displayed_default=displayed_default, + displayed_name=displayed_name, ) if not TYPE_CHECKING: # this is to prevent anything breaking if inspect internals change @@ -171,6 +177,14 @@ class Parameter(inspect.Parameter): return None if self.required else str(self.default) + @property + def displayed_name(self) -> Optional[str]: + """Optional[:class:`str`]: The name that is displayed to the user. + + .. versionadded:: 2.3 + """ + return self._displayed_name if self._displayed_name is not empty else None + async def get_default(self, ctx: Context[Any]) -> Any: """|coro| @@ -193,8 +207,9 @@ def parameter( default: Any = empty, description: str = empty, displayed_default: str = empty, + displayed_name: str = empty, ) -> Any: - r"""parameter(\*, converter=..., default=..., description=..., displayed_default=...) + r"""parameter(\*, converter=..., default=..., description=..., displayed_default=..., displayed_name=...) A way to assign custom metadata for a :class:`Command`\'s parameter. @@ -221,6 +236,10 @@ def parameter( The description of this parameter. displayed_default: :class:`str` The displayed default in :attr:`Command.signature`. + displayed_name: :class:`str` + The name that is displayed to the user. + + .. versionadded:: 2.3 """ return Parameter( name='empty', @@ -229,6 +248,7 @@ def parameter( default=default, description=description, displayed_default=displayed_default, + displayed_name=displayed_name, ) @@ -240,12 +260,13 @@ class ParameterAlias(Protocol): default: Any = empty, description: str = empty, displayed_default: str = empty, + displayed_name: str = empty, ) -> Any: ... param: ParameterAlias = parameter -r"""param(\*, converter=..., default=..., description=..., displayed_default=...) +r"""param(\*, converter=..., default=..., description=..., displayed_default=..., displayed_name=...) An alias for :func:`parameter`. From f1bade4bda43ae95ba457ff381d2927eb27fea1b Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 11 Jun 2023 12:21:37 -0400 Subject: [PATCH 103/473] Hoist webhook detection outside of store_user helper --- discord/interactions.py | 4 ++-- discord/message.py | 2 +- discord/state.py | 7 +++---- discord/webhook/async_.py | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/discord/interactions.py b/discord/interactions.py index f62a08703..44645396e 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -1041,8 +1041,8 @@ class _InteractionMessageState: def _get_guild(self, guild_id): return self._parent._get_guild(guild_id) - def store_user(self, data): - return self._parent.store_user(data) + def store_user(self, data, *, cache: bool = True): + return self._parent.store_user(data, cache=cache) def create_user(self, data): return self._parent.create_user(data) diff --git a/discord/message.py b/discord/message.py index a7c2f695c..a3e788d0c 100644 --- a/discord/message.py +++ b/discord/message.py @@ -1808,7 +1808,7 @@ class Message(PartialMessage, Hashable): self.nonce = value def _handle_author(self, author: UserPayload) -> None: - self.author = self._state.store_user(author) + self.author = self._state.store_user(author, cache=self.webhook_id is None) if isinstance(self.guild, Guild): found = self.guild.get_member(self.author.id) if found is not None: diff --git a/discord/state.py b/discord/state.py index 7da1a8f15..d509c23fd 100644 --- a/discord/state.py +++ b/discord/state.py @@ -349,19 +349,18 @@ class ConnectionState(Generic[ClientT]): for vc in self.voice_clients: vc.main_ws = ws # type: ignore # Silencing the unknown attribute (ok at runtime). - def store_user(self, data: Union[UserPayload, PartialUserPayload]) -> User: + def store_user(self, data: Union[UserPayload, PartialUserPayload], *, cache: bool = True) -> User: # this way is 300% faster than `dict.setdefault`. user_id = int(data['id']) try: return self._users[user_id] except KeyError: user = User(state=self, data=data) - # TODO: with the removal of discrims this becomes a bit annoying - if user.discriminator != '0000': + if cache: self._users[user_id] = user return user - def store_user_no_intents(self, data: Union[UserPayload, PartialUserPayload]) -> User: + def store_user_no_intents(self, data: Union[UserPayload, PartialUserPayload], *, cache: bool = True) -> User: return User(state=self, data=data) def create_user(self, data: Union[UserPayload, PartialUserPayload]) -> User: diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index f0a649ff8..9ce18bbe4 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -715,9 +715,9 @@ class _WebhookState: return self._parent._get_guild(guild_id) return None - def store_user(self, data: Union[UserPayload, PartialUserPayload]) -> BaseUser: + def store_user(self, data: Union[UserPayload, PartialUserPayload], *, cache: bool = True) -> BaseUser: if self._parent is not None: - return self._parent.store_user(data) + return self._parent.store_user(data, cache=cache) # state parameter is artificial return BaseUser(state=self, data=data) # type: ignore From c5da0fe7c1442981de1aac6bb91ea7046d5cc79f Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 11 Jun 2023 12:29:13 -0400 Subject: [PATCH 104/473] Remove and address stale TODO comments --- discord/abc.py | 2 -- discord/guild.py | 36 +++++++++++++----------------------- discord/message.py | 1 - discord/reaction.py | 1 - 4 files changed, 13 insertions(+), 27 deletions(-) diff --git a/discord/abc.py b/discord/abc.py index 32d843f63..242662d15 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -946,8 +946,6 @@ class GuildChannel: if len(permissions) > 0: raise TypeError('Cannot mix overwrite and keyword arguments.') - # TODO: wait for event - if overwrite is None: await http.delete_channel_permissions(self.id, target.id, reason=reason) elif isinstance(overwrite, PermissionOverwrite): diff --git a/discord/guild.py b/discord/guild.py index 0c50f5aeb..b95ac4247 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -502,56 +502,47 @@ class Guild(Hashable): self.approximate_member_count: Optional[int] = guild.get('approximate_member_count') self.premium_progress_bar_enabled: bool = guild.get('premium_progress_bar_enabled', False) self.owner_id: Optional[int] = utils._get_as_snowflake(guild, 'owner_id') - - self._sync(guild) self._large: Optional[bool] = None if self._member_count is None else self._member_count >= 250 - self.afk_channel: Optional[VocalGuildChannel] = self.get_channel(utils._get_as_snowflake(guild, 'afk_channel_id')) # type: ignore - - # TODO: refactor/remove? - def _sync(self, data: GuildPayload) -> None: - try: - self._large = data['large'] - except KeyError: - pass - - if 'channels' in data: - channels = data['channels'] + if 'channels' in guild: + channels = guild['channels'] for c in channels: factory, ch_type = _guild_channel_factory(c['type']) if factory: self._add_channel(factory(guild=self, data=c, state=self._state)) # type: ignore - for obj in data.get('voice_states', []): + self.afk_channel: Optional[VocalGuildChannel] = self.get_channel(utils._get_as_snowflake(guild, 'afk_channel_id')) # type: ignore + + for obj in guild.get('voice_states', []): self._update_voice_state(obj, int(obj['channel_id'])) cache_joined = self._state.member_cache_flags.joined cache_voice = self._state.member_cache_flags.voice self_id = self._state.self_id - for mdata in data.get('members', []): + for mdata in guild.get('members', []): member = Member(data=mdata, guild=self, state=self._state) # type: ignore # Members will have the 'user' key in this scenario if cache_joined or member.id == self_id or (cache_voice and member.id in self._voice_states): self._add_member(member) empty_tuple = () - for presence in data.get('presences', []): + for presence in guild.get('presences', []): user_id = int(presence['user']['id']) member = self.get_member(user_id) if member is not None: member._presence_update(presence, empty_tuple) # type: ignore - if 'threads' in data: - threads = data['threads'] + if 'threads' in guild: + threads = guild['threads'] for thread in threads: self._add_thread(Thread(guild=self, state=self._state, data=thread)) - if 'stage_instances' in data: - for s in data['stage_instances']: + if 'stage_instances' in guild: + for s in guild['stage_instances']: stage_instance = StageInstance(guild=self, data=s, state=self._state) self._stage_instances[stage_instance.id] = stage_instance - if 'guild_scheduled_events' in data: - for s in data['guild_scheduled_events']: + if 'guild_scheduled_events' in guild: + for s in guild['guild_scheduled_events']: scheduled_event = ScheduledEvent(data=s, state=self._state) self._scheduled_events[scheduled_event.id] = scheduled_event @@ -3484,7 +3475,6 @@ class Guild(Hashable): data = await self._state.http.create_role(self.id, reason=reason, **fields) role = Role(guild=self, data=data, state=self._state) - # TODO: add to cache return role async def edit_role_positions(self, positions: Mapping[Snowflake, int], *, reason: Optional[str] = None) -> List[Role]: diff --git a/discord/message.py b/discord/message.py index a3e788d0c..338d9c33e 100644 --- a/discord/message.py +++ b/discord/message.py @@ -1827,7 +1827,6 @@ class Message(PartialMessage, Hashable): author._update_from_message(member) # type: ignore except AttributeError: # It's a user here - # TODO: consider adding to cache here self.author = Member._from_message(message=self, data=member) def _handle_mentions(self, mentions: List[UserWithMemberPayload]) -> None: diff --git a/discord/reaction.py b/discord/reaction.py index 5f50ec8f4..c0cbb8ee5 100644 --- a/discord/reaction.py +++ b/discord/reaction.py @@ -89,7 +89,6 @@ class Reaction: self.count: int = data.get('count', 1) self.me: bool = data['me'] - # TODO: typeguard def is_custom_emoji(self) -> bool: """:class:`bool`: If this is a custom emoji.""" return not isinstance(self.emoji, str) From abfb3a11b056e0a32db93fcae9a907e03279c452 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 11 Jun 2023 12:35:27 -0400 Subject: [PATCH 105/473] Refactor Guild.afk_channel to use a property --- discord/guild.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/discord/guild.py b/discord/guild.py index b95ac4247..e8c7ebcf0 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -275,7 +275,6 @@ class Guild(Hashable): __slots__ = ( 'afk_timeout', - 'afk_channel', 'name', 'id', 'unavailable', @@ -298,6 +297,7 @@ class Guild(Hashable): 'vanity_url_code', 'widget_enabled', '_widget_channel_id', + '_afk_channel_id', '_members', '_channels', '_icon', @@ -503,6 +503,7 @@ class Guild(Hashable): self.premium_progress_bar_enabled: bool = guild.get('premium_progress_bar_enabled', False) self.owner_id: Optional[int] = utils._get_as_snowflake(guild, 'owner_id') self._large: Optional[bool] = None if self._member_count is None else self._member_count >= 250 + self._afk_channel_id: Optional[int] = utils._get_as_snowflake(guild, 'afk_channel_id') if 'channels' in guild: channels = guild['channels'] @@ -511,8 +512,6 @@ class Guild(Hashable): if factory: self._add_channel(factory(guild=self, data=c, state=self._state)) # type: ignore - self.afk_channel: Optional[VocalGuildChannel] = self.get_channel(utils._get_as_snowflake(guild, 'afk_channel_id')) # type: ignore - for obj in guild.get('voice_states', []): self._update_voice_state(obj, int(obj['channel_id'])) @@ -761,6 +760,14 @@ class Guild(Hashable): return emoji return None + @property + def afk_channel(self) -> Optional[VocalGuildChannel]: + """Optional[Union[:class:`VoiceChannel`, :class:`StageChannel`]]: The channel that denotes the AFK channel. + + If no channel is set, then this returns ``None``. + """ + return self.get_channel(self._afk_channel_id) # type: ignore + @property def system_channel(self) -> Optional[TextChannel]: """Optional[:class:`TextChannel`]: Returns the guild's channel used for system messages. @@ -1875,8 +1882,6 @@ class Guild(Hashable): and ``public_updates_channel`` parameters are required. .. versionadded:: 2.0 - afk_channel: Optional[:class:`VoiceChannel`] - The new channel that is the AFK channel. Could be ``None`` for no AFK channel. afk_timeout: :class:`int` The number of seconds until someone is moved to the AFK channel. owner: :class:`Member` From a8675ccde88c4d710928ba65c813a4126cbb25f7 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 11 Jun 2023 12:52:47 -0400 Subject: [PATCH 106/473] Fix afk_channel docstring error --- discord/guild.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/guild.py b/discord/guild.py index e8c7ebcf0..a37fb549f 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -186,8 +186,6 @@ class Guild(Hashable): .. versionadded:: 2.0 afk_timeout: :class:`int` The number of seconds until someone is moved to the AFK channel. - afk_channel: Optional[:class:`VoiceChannel`] - The channel that denotes the AFK channel. ``None`` if it doesn't exist. id: :class:`int` The guild's ID. owner_id: :class:`int` @@ -1882,6 +1880,8 @@ class Guild(Hashable): and ``public_updates_channel`` parameters are required. .. versionadded:: 2.0 + afk_channel: Optional[:class:`VoiceChannel`] + The new channel that is the AFK channel. Could be ``None`` for no AFK channel. afk_timeout: :class:`int` The number of seconds until someone is moved to the AFK channel. owner: :class:`Member` From cf681105ceb88723b926aef6f41b237fff0b312c Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 11 Jun 2023 13:52:16 -0400 Subject: [PATCH 107/473] Rename Permissions.manage_guild_expressions to manage_expressions --- discord/permissions.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/discord/permissions.py b/discord/permissions.py index c0b5ee3f4..74cf22ef4 100644 --- a/discord/permissions.py +++ b/discord/permissions.py @@ -210,7 +210,7 @@ class Permissions(BaseFlags): ``True`` and the guild-specific ones set to ``False``. The guild-specific permissions are currently: - - :attr:`manage_guild_expressions` + - :attr:`manage_expressions` - :attr:`view_audit_log` - :attr:`view_guild_insights` - :attr:`manage_guild` @@ -321,7 +321,7 @@ class Permissions(BaseFlags): - :attr:`manage_messages` - :attr:`manage_roles` - :attr:`manage_webhooks` - - :attr:`manage_guild_expressions` + - :attr:`manage_expressions` - :attr:`manage_threads` - :attr:`moderate_members` @@ -560,21 +560,21 @@ class Permissions(BaseFlags): return 1 << 29 @flag_value - def manage_guild_expressions(self) -> int: + def manage_expressions(self) -> int: """:class:`bool`: Returns ``True`` if a user can edit or delete emojis, stickers, and soundboard sounds. .. versionadded:: 2.3 """ return 1 << 30 - @make_permission_alias('manage_guild_expressions') + @make_permission_alias('manage_expressions') def manage_emojis(self) -> int: - """:class:`bool`: An alias for :attr:`manage_guild_expressions`.""" + """:class:`bool`: An alias for :attr:`manage_expressions`.""" return 1 << 30 - @make_permission_alias('manage_guild_expressions') + @make_permission_alias('manage_expressions') def manage_emojis_and_stickers(self) -> int: - """:class:`bool`: An alias for :attr:`manage_guild_expressions`. + """:class:`bool`: An alias for :attr:`manage_expressions`. .. versionadded:: 2.0 """ @@ -801,7 +801,7 @@ class PermissionOverwrite: manage_roles: Optional[bool] manage_permissions: Optional[bool] manage_webhooks: Optional[bool] - manage_guild_expressions: Optional[bool] + manage_expressions: Optional[bool] manage_emojis: Optional[bool] manage_emojis_and_stickers: Optional[bool] use_application_commands: Optional[bool] From 9f5b6c2bed56a34fd1061c93fa682015e36fb43e Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 12 Jun 2023 13:40:12 -0400 Subject: [PATCH 108/473] Add changelog for v2.3 --- docs/whats_new.rst | 72 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/docs/whats_new.rst b/docs/whats_new.rst index af13da1c1..04effd7de 100644 --- a/docs/whats_new.rst +++ b/docs/whats_new.rst @@ -11,6 +11,78 @@ Changelog This page keeps a detailed human friendly rendering of what's new and changed in specific versions. +.. _vp2p3p0: + +v2.3.0 +-------- + +New Features +~~~~~~~~~~~~~ + +- Add support for the new username system (also known as "pomelo"). + - Add :attr:`User.global_name` to get their global nickname or "display name". + - Update :attr:`User.display_name` and :attr:`Member.display_name` to understand global nicknames. + - Update ``__str__`` for :class:`User` to drop discriminators if the user has been migrated. + - Update :meth:`Guild.get_member_named` to work with migrated users. + - Update :attr:`User.default_avatar` to work with migrated users. + - |commands| Update user and member converters to understand migrated users. + +- Add :attr:`DefaultAvatar.pink` for new pink default avatars. +- Add :meth:`Colour.pink` to get the pink default avatar colour. +- Add support for voice messages (:issue:`9358`) + - Add :attr:`MessageFlags.voice` + - Add :attr:`Attachment.duration` and :attr:`Attachment.waveform` + - Add :meth:`Attachment.is_voice_message` + - This does not support *sending* voice messages because this is currently unsupported by the API. + +- Add support for new :attr:`Interaction.channel` attribute from the API update (:issue:`9339`). +- Add support for :attr:`TextChannel.default_thread_slowmode_delay` (:issue:`9291`). +- Add support for :attr:`ForumChannel.default_sort_order` (:issue:`9290`). +- Add support for ``default_reaction_emoji`` and ``default_forum_layout`` in :meth:`Guild.create_forum` (:issue:`9300`). +- Add support for ``widget_channel``, ``widget_enabled``, and ``mfa_level`` in :meth:`Guild.edit` (:issue:`9302`, :issue:`9303`). +- Add various new :class:`Permissions` and changes (:issue:`9312`, :issue:`9325`, :issue:`9358`, :issue:`9378`) + - Add new :attr:`~Permissions.manage_expressions`, :attr:`~Permissions.use_external_sounds`, :attr:`~Permissions.use_soundboard`, :attr:`~Permissions.send_voice_messages`, :attr:`~Permissions.create_expressions` permissions. + - Change :attr:`Permissions.manage_emojis` to be an alias of :attr:`~Permissions.manage_expressions`. + +- Add various new properties to :class:`PartialAppInfo` and :class:`AppInfo` (:issue:`9298`). +- Add support for ``with_counts`` parameter to :meth:`Client.fetch_guilds` (:issue:`9369`). +- Add new :meth:`Guild.get_emoji` helper (:issue:`9296`). +- Add :attr:`ApplicationFlags.auto_mod_badge` (:issue:`9313`). +- Add :attr:`Guild.max_stage_video_users` and :attr:`Guild.safety_alerts_channel` (:issue:`9318`). +- Add support for ``raid_alerts_disabled`` and ``safety_alerts_channel`` in :meth:`Guild.edit` (:issue:`9318`). +- |commands| Add :attr:`BadLiteralArgument.argument ` to get the failed argument's value (:issue:`9283`). +- |commands| Add :attr:`Context.filesize_limit ` property (:issue:`9416`). +- |commands| Add support for :attr:`Parameter.displayed_name ` (:issue:`9427`). + +Bug Fixes +~~~~~~~~~~ + +- Fix ``FileHandler`` handlers being written ANSI characters when the bot is executed inside PyCharm. + - This has the side effect of removing coloured logs from the PyCharm terminal due an upstream bug involving TTY detection. This issue is tracked under `PY-43798 `_. + +- Fix channel edits with :meth:`Webhook.edit` sending two requests instead of one. +- Fix :attr:`StageChannel.last_message_id` always being ``None`` (:issue:`9422`). +- Fix piped audio input ending prematurely (:issue:`9001`, :issue:`9380`). +- Fix persistent detection for :class:`ui.TextInput` being incorrect if the ``custom_id`` is set later (:issue:`9438`). +- Fix custom attributes not being copied over when inheriting from :class:`app_commands.Group` (:issue:`9383`). +- Fix AutoMod audit log entry error due to empty channel_id (:issue:`9384`). +- Fix handling of ``around`` parameter in :meth:`abc.Messageable.history` (:issue:`9388`). +- Fix occasional :exc:`AttributeError` when accessing the :attr:`ClientUser.mutual_guilds` property (:issue:`9387`). +- Fix :func:`utils.escape_markdown` not escaping the new markdown (:issue:`9361`). +- Fix webhook targets not being converted in audit logs (:issue:`9332`). +- Fix error when not passing ``enabled`` in :meth:`Guild.create_automod_rule` (:issue:`9292`). +- Fix how various parameters are handled in :meth:`Guild.create_scheduled_event` (:issue:`9275`). +- Fix not sending the ``ssrc`` parameter when sending the SPEAKING payload (:issue:`9301`). +- Fix :attr:`Message.guild` being ``None`` sometimes when received via an interaction. +- Fix :attr:`Message.system_content` for :attr:`MessageType.channel_icon_change` (:issue:`9410`). + +Miscellaneous +~~~~~~~~~~~~~~ + +- Update the base :attr:`Guild.filesize_limit` to 25MiB (:issue:`9353`). +- Allow Interaction webhook URLs to be used in :meth:`Webhook.from_url`. +- Set the socket family of internal connector to ``AF_INET`` to prevent IPv6 connections (:issue:`9442`, :issue:`9443`). + .. _vp2p2p3: v2.2.3 From c785e4ba755e9b25c36953bdb0ffc34b41fe24d7 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 12 Jun 2023 13:40:41 -0400 Subject: [PATCH 109/473] Version bump to v2.3 --- discord/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/__init__.py b/discord/__init__.py index 39fdb2673..6461cfe71 100644 --- a/discord/__init__.py +++ b/discord/__init__.py @@ -13,7 +13,7 @@ __title__ = 'discord' __author__ = 'Rapptz' __license__ = 'MIT' __copyright__ = 'Copyright 2015-present Rapptz' -__version__ = '2.3.0a' +__version__ = '2.3.0' __path__ = __import__('pkgutil').extend_path(__path__, __name__) @@ -78,7 +78,7 @@ class VersionInfo(NamedTuple): serial: int -version_info: VersionInfo = VersionInfo(major=2, minor=3, micro=0, releaselevel='alpha', serial=0) +version_info: VersionInfo = VersionInfo(major=2, minor=3, micro=0, releaselevel='final', serial=0) logging.getLogger(__name__).addHandler(logging.NullHandler()) From 0c6a2fc3d5a1c30cb92c45331ff0b3e487e088f8 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 12 Jun 2023 14:03:02 -0400 Subject: [PATCH 110/473] Version bump for development --- discord/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/__init__.py b/discord/__init__.py index 6461cfe71..a72b9969e 100644 --- a/discord/__init__.py +++ b/discord/__init__.py @@ -13,7 +13,7 @@ __title__ = 'discord' __author__ = 'Rapptz' __license__ = 'MIT' __copyright__ = 'Copyright 2015-present Rapptz' -__version__ = '2.3.0' +__version__ = '2.4.0a' __path__ = __import__('pkgutil').extend_path(__path__, __name__) @@ -78,7 +78,7 @@ class VersionInfo(NamedTuple): serial: int -version_info: VersionInfo = VersionInfo(major=2, minor=3, micro=0, releaselevel='final', serial=0) +version_info: VersionInfo = VersionInfo(major=2, minor=4, micro=0, releaselevel='alpha', serial=0) logging.getLogger(__name__).addHandler(logging.NullHandler()) From dc4ed438a5ba780fcaaf3fb46bbc603827d87bf2 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 12 Jun 2023 19:39:41 -0400 Subject: [PATCH 111/473] Fix plain username lookup for Guild.get_member_named Fix #9451 --- discord/ext/commands/converter.py | 10 ++++++++++ discord/guild.py | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py index 4cd8a3533..30cea2a5c 100644 --- a/discord/ext/commands/converter.py +++ b/discord/ext/commands/converter.py @@ -207,6 +207,11 @@ class MemberConverter(IDConverter[discord.Member]): async def query_member_named(self, guild: discord.Guild, argument: str) -> Optional[discord.Member]: cache = guild._state.member_cache_flags.joined username, _, discriminator = argument.rpartition('#') + + # If # isn't found then "discriminator" actually has the username + if not username: + discriminator, username = username, discriminator + if discriminator == '0' or (len(discriminator) == 4 and discriminator.isdigit()): lookup = username predicate = lambda m: m.name == username and m.discriminator == discriminator @@ -316,6 +321,11 @@ class UserConverter(IDConverter[discord.User]): return result # type: ignore username, _, discriminator = argument.rpartition('#') + + # If # isn't found then "discriminator" actually has the username + if not username: + discriminator, username = username, discriminator + if discriminator == '0' or (len(discriminator) == 4 and discriminator.isdigit()): predicate = lambda u: u.name == username and u.discriminator == discriminator else: diff --git a/discord/guild.py b/discord/guild.py index a37fb549f..f7d1a5566 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1104,6 +1104,11 @@ class Guild(Hashable): members = self.members username, _, discriminator = name.rpartition('#') + + # If # isn't found then "discriminator" actually has the username + if not username: + discriminator, username = username, discriminator + if discriminator == '0' or (len(discriminator) == 4 and discriminator.isdigit()): return utils.find(lambda m: m.name == username and m.discriminator == discriminator, members) From 49e31e9e23517471252cd3f992fa3c88607741ff Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 17 Jun 2023 01:24:10 -0400 Subject: [PATCH 112/473] Use cache data if available for Interaction.channel The data from Discord does not contain all the attributes that the cached data has. There may be a slight chance that the interaction data is more up to date than the cached data or vice versa but more information tends to trump over this slight chance. --- discord/interactions.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/discord/interactions.py b/discord/interactions.py index 44645396e..1cf029451 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -184,22 +184,6 @@ class Interaction(Generic[ClientT]): self.version: int = data['version'] self.guild_id: Optional[int] = utils._get_as_snowflake(data, 'guild_id') self.channel: Optional[InteractionChannel] = None - - raw_channel = data.get('channel', {}) - raw_ch_type = raw_channel.get('type') - if raw_ch_type is not None: - factory, ch_type = _threaded_channel_factory(raw_ch_type) # type is never None - if factory is None: - logging.info('Unknown channel type {type} for channel ID {id}.'.format_map(raw_channel)) - else: - if ch_type in (ChannelType.group, ChannelType.private): - channel = factory(me=self._client.user, data=raw_channel, state=self._state) # type: ignore - else: - guild = self._state._get_or_create_unavailable_guild(self.guild_id) # type: ignore - channel = factory(guild=guild, state=self._state, data=raw_channel) # type: ignore - - self.channel = channel - self.application_id: int = int(data['application_id']) self.locale: Locale = try_enum(Locale, data.get('locale', 'en-US')) @@ -220,6 +204,7 @@ class Interaction(Generic[ClientT]): self._permissions: int = 0 self._app_permissions: int = int(data.get('app_permissions', 0)) + guild = None if self.guild_id: guild = self._state._get_or_create_unavailable_guild(self.guild_id) @@ -240,6 +225,22 @@ class Interaction(Generic[ClientT]): except KeyError: pass + raw_channel = data.get('channel', {}) + channel_id = utils._get_as_snowflake(raw_channel, 'id') + if channel_id is not None and guild is not None: + self.channel = guild and guild._resolve_channel(channel_id) + + raw_ch_type = raw_channel.get('type') + if self.channel is None and raw_ch_type is not None: + factory, ch_type = _threaded_channel_factory(raw_ch_type) # type is never None + if factory is None: + logging.info('Unknown channel type {type} for channel ID {id}.'.format_map(raw_channel)) + else: + if ch_type in (ChannelType.group, ChannelType.private): + self.channel = factory(me=self._client.user, data=raw_channel, state=self._state) # type: ignore + elif guild is not None: + self.channel = factory(guild=guild, state=self._state, data=raw_channel) # type: ignore + @property def client(self) -> ClientT: """:class:`Client`: The client that is handling this interaction. From a7f2c670c9ed1e9196d170239d6c2156a7aba503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20N=C3=B8rgaard?= Date: Wed, 21 Jun 2023 14:30:25 +0100 Subject: [PATCH 113/473] Fix false positives in animated for PartialEmoji.from_str --- discord/partial_emoji.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/partial_emoji.py b/discord/partial_emoji.py index 17c528c52..7d366949c 100644 --- a/discord/partial_emoji.py +++ b/discord/partial_emoji.py @@ -94,7 +94,7 @@ class PartialEmoji(_EmojiTag, AssetMixin): __slots__ = ('animated', 'name', 'id', '_state') - _CUSTOM_EMOJI_RE = re.compile(r'a)?:?(?P[A-Za-z0-9\_]+):(?P[0-9]{13,20})>?') + _CUSTOM_EMOJI_RE = re.compile(r'a)?:)?(?P[A-Za-z0-9\_]+):(?P[0-9]{13,20})>?') if TYPE_CHECKING: id: Optional[int] From 0efc05ccce5a7c03d5fe976cbfc19dbbafc3126a Mon Sep 17 00:00:00 2001 From: Soheab_ <33902984+Soheab@users.noreply.github.com> Date: Fri, 23 Jun 2023 06:19:52 +0200 Subject: [PATCH 114/473] Fix certain select types not appearing in Message.components --- discord/components.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/components.py b/discord/components.py index c0a213efa..5c3679b13 100644 --- a/discord/components.py +++ b/discord/components.py @@ -527,7 +527,7 @@ def _component_factory(data: ComponentPayload) -> Optional[Union[ActionRow, Acti return ActionRow(data) elif data['type'] == 2: return Button(data) - elif data['type'] == 3: - return SelectMenu(data) elif data['type'] == 4: return TextInput(data) + elif data['type'] in (3, 5, 6, 7, 8): + return SelectMenu(data) From 2fdbe59376d736483cd1226e674e609433877af4 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Fri, 23 Jun 2023 00:19:17 -0400 Subject: [PATCH 115/473] Fix Message.channel being None for interactions --- discord/interactions.py | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/discord/interactions.py b/discord/interactions.py index 1cf029451..595414b2f 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -193,6 +193,26 @@ class Interaction(Generic[ClientT]): except KeyError: self.guild_locale = None + guild = None + if self.guild_id: + guild = self._state._get_or_create_unavailable_guild(self.guild_id) + + raw_channel = data.get('channel', {}) + channel_id = utils._get_as_snowflake(raw_channel, 'id') + if channel_id is not None and guild is not None: + self.channel = guild and guild._resolve_channel(channel_id) + + raw_ch_type = raw_channel.get('type') + if self.channel is None and raw_ch_type is not None: + factory, ch_type = _threaded_channel_factory(raw_ch_type) # type is never None + if factory is None: + logging.info('Unknown channel type {type} for channel ID {id}.'.format_map(raw_channel)) + else: + if ch_type in (ChannelType.group, ChannelType.private): + self.channel = factory(me=self._client.user, data=raw_channel, state=self._state) # type: ignore + elif guild is not None: + self.channel = factory(guild=guild, state=self._state, data=raw_channel) # type: ignore + self.message: Optional[Message] try: # The channel and message payloads are mismatched yet handled properly at runtime @@ -204,10 +224,7 @@ class Interaction(Generic[ClientT]): self._permissions: int = 0 self._app_permissions: int = int(data.get('app_permissions', 0)) - guild = None - if self.guild_id: - guild = self._state._get_or_create_unavailable_guild(self.guild_id) - + if guild is not None: # Upgrade Message.guild in case it's missing with partial guild data if self.message is not None and self.message.guild is None: self.message.guild = guild @@ -225,22 +242,6 @@ class Interaction(Generic[ClientT]): except KeyError: pass - raw_channel = data.get('channel', {}) - channel_id = utils._get_as_snowflake(raw_channel, 'id') - if channel_id is not None and guild is not None: - self.channel = guild and guild._resolve_channel(channel_id) - - raw_ch_type = raw_channel.get('type') - if self.channel is None and raw_ch_type is not None: - factory, ch_type = _threaded_channel_factory(raw_ch_type) # type is never None - if factory is None: - logging.info('Unknown channel type {type} for channel ID {id}.'.format_map(raw_channel)) - else: - if ch_type in (ChannelType.group, ChannelType.private): - self.channel = factory(me=self._client.user, data=raw_channel, state=self._state) # type: ignore - elif guild is not None: - self.channel = factory(guild=guild, state=self._state, data=raw_channel) # type: ignore - @property def client(self) -> ClientT: """:class:`Client`: The client that is handling this interaction. From 5e86be3b7260426e26cf38a067cbda94a2b68652 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 26 Jun 2023 03:58:34 -0400 Subject: [PATCH 116/473] [commands] Change lookup order to place nicknames last --- discord/ext/commands/converter.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py index 30cea2a5c..7255f1715 100644 --- a/discord/ext/commands/converter.py +++ b/discord/ext/commands/converter.py @@ -188,9 +188,9 @@ class MemberConverter(IDConverter[discord.Member]): 2. Lookup by mention. 3. Lookup by username#discriminator (deprecated). 4. Lookup by username#0 (deprecated, only gets users that migrated from their discriminator). - 5. Lookup by guild nickname. + 5. Lookup by user name. 6. Lookup by global name. - 7. Lookup by user name. + 7. Lookup by guild nickname. .. versionchanged:: 1.5 Raise :exc:`.MemberNotFound` instead of generic :exc:`.BadArgument` @@ -217,7 +217,7 @@ class MemberConverter(IDConverter[discord.Member]): predicate = lambda m: m.name == username and m.discriminator == discriminator else: lookup = argument - predicate = lambda m: m.nick == argument or m.global_name == argument or m.name == argument + predicate = lambda m: m.name == argument or m.global_name == argument or m.nick == argument members = await guild.query_members(lookup, limit=100, cache=cache) return discord.utils.find(predicate, members) @@ -289,8 +289,8 @@ class UserConverter(IDConverter[discord.User]): 2. Lookup by mention. 3. Lookup by username#discriminator (deprecated). 4. Lookup by username#0 (deprecated, only gets users that migrated from their discriminator). - 5. Lookup by global name. - 6. Lookup by user name. + 5. Lookup by user name. + 6. Lookup by global name. .. versionchanged:: 1.5 Raise :exc:`.UserNotFound` instead of generic :exc:`.BadArgument` @@ -329,7 +329,7 @@ class UserConverter(IDConverter[discord.User]): if discriminator == '0' or (len(discriminator) == 4 and discriminator.isdigit()): predicate = lambda u: u.name == username and u.discriminator == discriminator else: - predicate = lambda u: u.global_name == argument or u.name == argument + predicate = lambda u: u.name == argument or u.global_name == argument result = discord.utils.find(predicate, state._users.values()) if result is None: From d48116af3b9e981b0f074d81f95e9319346074b4 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 26 Jun 2023 04:13:18 -0400 Subject: [PATCH 117/473] Add changelog for v2.3.1 --- docs/whats_new.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/whats_new.rst b/docs/whats_new.rst index 04effd7de..2de164435 100644 --- a/docs/whats_new.rst +++ b/docs/whats_new.rst @@ -11,6 +11,22 @@ Changelog This page keeps a detailed human friendly rendering of what's new and changed in specific versions. +.. _vp2p3p1: + +v2.3.1 +------- + +Bug Fixes +~~~~~~~~~~ + +- Fix username lookup in :meth:`Guild.get_member_named` (:issue:`9451`). +- Use cache data first for :attr:`Interaction.channel` instead of API data. + - This bug usually manifested in incomplete channel objects (e.g. no ``overwrites``) because Discord does not provide this data. + +- Fix false positives in :meth:`PartialEmoji.from_str` inappropriately setting ``animated`` to ``True`` (:issue:`9456`, :issue:`9457`). +- Fix certain select types not appearing in :attr:`Message.components` (:issue:`9462`). +- |commands| Change lookup order for :class:`~ext.commands.MemberConverter` and :class:`~ext.commands.UserConverter` to prioritise usernames instead of nicknames. + .. _vp2p3p0: v2.3.0 From 2a9640b5160194d81ee32584d772a445141b00ab Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 26 Jun 2023 04:13:50 -0400 Subject: [PATCH 118/473] Version bump to v2.3.1 --- discord/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/__init__.py b/discord/__init__.py index a72b9969e..85183ccb8 100644 --- a/discord/__init__.py +++ b/discord/__init__.py @@ -13,7 +13,7 @@ __title__ = 'discord' __author__ = 'Rapptz' __license__ = 'MIT' __copyright__ = 'Copyright 2015-present Rapptz' -__version__ = '2.4.0a' +__version__ = '2.3.1' __path__ = __import__('pkgutil').extend_path(__path__, __name__) @@ -78,7 +78,7 @@ class VersionInfo(NamedTuple): serial: int -version_info: VersionInfo = VersionInfo(major=2, minor=4, micro=0, releaselevel='alpha', serial=0) +version_info: VersionInfo = VersionInfo(major=2, minor=3, micro=1, releaselevel='final', serial=0) logging.getLogger(__name__).addHandler(logging.NullHandler()) From c6bdb0b0dd908f4fc4986143dad13bb240af2ce5 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 26 Jun 2023 04:14:15 -0400 Subject: [PATCH 119/473] Version bump for development --- discord/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/__init__.py b/discord/__init__.py index 85183ccb8..a72b9969e 100644 --- a/discord/__init__.py +++ b/discord/__init__.py @@ -13,7 +13,7 @@ __title__ = 'discord' __author__ = 'Rapptz' __license__ = 'MIT' __copyright__ = 'Copyright 2015-present Rapptz' -__version__ = '2.3.1' +__version__ = '2.4.0a' __path__ = __import__('pkgutil').extend_path(__path__, __name__) @@ -78,7 +78,7 @@ class VersionInfo(NamedTuple): serial: int -version_info: VersionInfo = VersionInfo(major=2, minor=3, micro=1, releaselevel='final', serial=0) +version_info: VersionInfo = VersionInfo(major=2, minor=4, micro=0, releaselevel='alpha', serial=0) logging.getLogger(__name__).addHandler(logging.NullHandler()) From 03140c0163261e0bd60ffb9121d13d19c619152d Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 26 Jun 2023 04:31:36 -0400 Subject: [PATCH 120/473] [tasks] Add name parameter to give the internal task a name --- discord/ext/tasks/__init__.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/discord/ext/tasks/__init__.py b/discord/ext/tasks/__init__.py index cf175b7a8..0a0f38413 100644 --- a/discord/ext/tasks/__init__.py +++ b/discord/ext/tasks/__init__.py @@ -144,6 +144,7 @@ class Loop(Generic[LF]): time: Union[datetime.time, Sequence[datetime.time]], count: Optional[int], reconnect: bool, + name: Optional[str], ) -> None: self.coro: LF = coro self.reconnect: bool = reconnect @@ -165,6 +166,7 @@ class Loop(Generic[LF]): self._is_being_cancelled = False self._has_failed = False self._stop_next_iteration = False + self._name: str = f'discord-ext-tasks: {coro.__qualname__}' if name is None else name if self.count is not None and self.count <= 0: raise ValueError('count must be greater than 0 or None.') @@ -395,7 +397,7 @@ class Loop(Generic[LF]): args = (self._injected, *args) self._has_failed = False - self._task = asyncio.create_task(self._loop(*args, **kwargs)) + self._task = asyncio.create_task(self._loop(*args, **kwargs), name=self._name) return self._task def stop(self) -> None: @@ -770,6 +772,7 @@ def loop( time: Union[datetime.time, Sequence[datetime.time]] = MISSING, count: Optional[int] = None, reconnect: bool = True, + name: Optional[str] = None, ) -> Callable[[LF], Loop[LF]]: """A decorator that schedules a task in the background for you with optional reconnect logic. The decorator returns a :class:`Loop`. @@ -802,6 +805,12 @@ def loop( Whether to handle errors and restart the task using an exponential back-off algorithm similar to the one used in :meth:`discord.Client.connect`. + name: Optional[:class:`str`] + The name to assign to the internal task. By default + it is assigned a name based off of the callable name + such as ``discord-ext-tasks: function_name``. + + .. versionadded:: 2.4 Raises -------- @@ -821,6 +830,7 @@ def loop( count=count, time=time, reconnect=reconnect, + name=name, ) return decorator From 646ab85bb62244666f092adb8683d2890f953664 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 26 Jun 2023 05:39:36 -0400 Subject: [PATCH 121/473] [tasks] Fix missing name parameter in loop copy --- discord/ext/tasks/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/discord/ext/tasks/__init__.py b/discord/ext/tasks/__init__.py index 0a0f38413..1ffb0b851 100644 --- a/discord/ext/tasks/__init__.py +++ b/discord/ext/tasks/__init__.py @@ -284,6 +284,7 @@ class Loop(Generic[LF]): time=self._time, count=self.count, reconnect=self.reconnect, + name=self._name, ) copy._injected = obj copy._before_loop = self._before_loop From 33243f9bd6395146c297c03040bd843b696d709c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aluerie=20=E2=9D=A4=236524?= <33165440+Aluerie@users.noreply.github.com> Date: Tue, 27 Jun 2023 16:01:56 -0700 Subject: [PATCH 122/473] Fix Intents.emoji and emojis_and_stickers swapped alias decorators --- discord/flags.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/flags.py b/discord/flags.py index 0fb60084d..27eaf2628 100644 --- a/discord/flags.py +++ b/discord/flags.py @@ -850,7 +850,7 @@ class Intents(BaseFlags): """ return 1 << 2 - @flag_value + @alias_flag_value def emojis(self): """:class:`bool`: Alias of :attr:`.emojis_and_stickers`. @@ -859,7 +859,7 @@ class Intents(BaseFlags): """ return 1 << 3 - @alias_flag_value + @flag_value def emojis_and_stickers(self): """:class:`bool`: Whether guild emoji and sticker related events are enabled. From 0871b34fc86af49deb6db2436d3e77f5516fdcba Mon Sep 17 00:00:00 2001 From: Rapptz Date: Wed, 28 Jun 2023 08:20:34 -0400 Subject: [PATCH 123/473] [commands] Revert on_error when cog is ejected for HelpCommand --- discord/ext/commands/help.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/discord/ext/commands/help.py b/discord/ext/commands/help.py index 32228d205..163bc2694 100644 --- a/discord/ext/commands/help.py +++ b/discord/ext/commands/help.py @@ -294,6 +294,9 @@ class _HelpCommandImpl(Command): cog.walk_commands = cog.walk_commands.__wrapped__ self.cog = None + # Revert `on_error` to use the original one in case of race conditions + self.on_error = self._injected.on_help_command_error + class HelpCommand: r"""The base implementation for help command formatting. From 630b2a1e550b7f0cfc8495ed0da70d3ef577bd50 Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 2 Jul 2023 08:26:27 +1000 Subject: [PATCH 124/473] Update pyright version --- .github/workflows/lint.yml | 2 +- discord/abc.py | 2 ++ discord/app_commands/commands.py | 2 +- discord/app_commands/transformers.py | 3 +-- discord/app_commands/translator.py | 2 +- discord/channel.py | 2 +- discord/components.py | 2 +- discord/ext/commands/cog.py | 2 +- discord/ext/commands/context.py | 2 +- discord/ext/commands/core.py | 6 +++--- discord/ext/commands/flags.py | 4 ++-- discord/ext/commands/hybrid.py | 6 +++--- discord/ext/commands/parameters.py | 2 +- discord/flags.py | 18 ++++++++++++++++-- discord/guild.py | 11 +++++++---- discord/http.py | 3 +-- discord/invite.py | 3 ++- 17 files changed, 45 insertions(+), 27 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 436b5ccc0..b233a5def 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -38,7 +38,7 @@ jobs: - name: Run Pyright uses: jakebailey/pyright-action@v1 with: - version: '1.1.289' + version: '1.1.316' warnings: false no-comments: ${{ matrix.python-version != '3.x' }} diff --git a/discord/abc.py b/discord/abc.py index 242662d15..f93ca3a9a 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -1246,6 +1246,8 @@ class GuildChannel: :class:`~discord.Invite` The invite that was created. """ + if target_type is InviteTarget.unknown: + raise ValueError('Cannot create invite with an unknown target type') data = await self._state.http.create_invite( self.id, diff --git a/discord/app_commands/commands.py b/discord/app_commands/commands.py index 8e6693408..0766475ec 100644 --- a/discord/app_commands/commands.py +++ b/discord/app_commands/commands.py @@ -976,7 +976,7 @@ class Command(Generic[GroupT, P, T]): if self.binding is not None: check: Optional[Check] = getattr(self.binding, 'interaction_check', None) if check: - ret = await maybe_coroutine(check, interaction) # type: ignore # Probable pyright bug + ret = await maybe_coroutine(check, interaction) if not ret: return False diff --git a/discord/app_commands/transformers.py b/discord/app_commands/transformers.py index 8f009181b..dfdbefa23 100644 --- a/discord/app_commands/transformers.py +++ b/discord/app_commands/transformers.py @@ -177,8 +177,7 @@ class CommandParameter: return choice try: - # ParamSpec doesn't understand that transform is a callable since it's unbound - return await maybe_coroutine(self._annotation.transform, interaction, value) # type: ignore + return await maybe_coroutine(self._annotation.transform, interaction, value) except AppCommandError: raise except Exception as e: diff --git a/discord/app_commands/translator.py b/discord/app_commands/translator.py index 1741054e3..4b6e01d4b 100644 --- a/discord/app_commands/translator.py +++ b/discord/app_commands/translator.py @@ -109,7 +109,7 @@ class TranslationContext(Generic[_L, _D]): def __init__(self, location: Literal[TranslationContextLocation.other], data: Any) -> None: ... - def __init__(self, location: _L, data: _D) -> None: + def __init__(self, location: _L, data: _D) -> None: # type: ignore # pyright doesn't like the overloads self.location: _L = location self.data: _D = data diff --git a/discord/channel.py b/discord/channel.py index 8c212c0cb..208d85eb0 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -776,7 +776,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): self.id, name=name, auto_archive_duration=auto_archive_duration or self.default_auto_archive_duration, - type=type.value, + type=type.value, # type: ignore # we're assuming that the user is passing a valid variant reason=reason, invitable=invitable, rate_limit_per_user=slowmode_delay, diff --git a/discord/components.py b/discord/components.py index 5c3679b13..6a8345801 100644 --- a/discord/components.py +++ b/discord/components.py @@ -279,7 +279,7 @@ class SelectMenu(Component): def to_dict(self) -> SelectMenuPayload: payload: SelectMenuPayload = { - 'type': self.type.value, + 'type': self.type.value, # type: ignore # we know this is a select menu. 'custom_id': self.custom_id, 'min_values': self.min_values, 'max_values': self.max_values, diff --git a/discord/ext/commands/cog.py b/discord/ext/commands/cog.py index 319f85b80..0e35021a1 100644 --- a/discord/ext/commands/cog.py +++ b/discord/ext/commands/cog.py @@ -377,7 +377,7 @@ class Cog(metaclass=CogMeta): if len(mapping) > 25: raise TypeError('maximum number of application command children exceeded') - self.__cog_app_commands_group__._children = mapping # type: ignore # Variance issue + self.__cog_app_commands_group__._children = mapping return self diff --git a/discord/ext/commands/context.py b/discord/ext/commands/context.py index 40ef48cf8..5fc675acd 100644 --- a/discord/ext/commands/context.py +++ b/discord/ext/commands/context.py @@ -251,7 +251,7 @@ class Context(discord.abc.Messageable, Generic[BotT]): if command is None: raise ValueError('interaction does not have command data') - bot: BotT = interaction.client # type: ignore + bot: BotT = interaction.client data: ApplicationCommandInteractionData = interaction.data # type: ignore if interaction.message is None: synthetic_payload = { diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index ffbefe284..efd7b09d2 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -776,7 +776,7 @@ class Command(_BaseCommand, Generic[CogT, P, T]): command = self # command.parent is type-hinted as GroupMixin some attributes are resolved via MRO while command.parent is not None: # type: ignore - command = command.parent # type: ignore + command = command.parent entries.append(command.name) # type: ignore return ' '.join(reversed(entries)) @@ -794,7 +794,7 @@ class Command(_BaseCommand, Generic[CogT, P, T]): entries = [] command = self while command.parent is not None: # type: ignore - command = command.parent # type: ignore + command = command.parent entries.append(command) return entries @@ -2004,7 +2004,7 @@ def check_any(*checks: Check[ContextT]) -> Check[ContextT]: # if we're here, all checks failed raise CheckAnyFailure(unwrapped, errors) - return check(predicate) # type: ignore + return check(predicate) def has_role(item: Union[int, str], /) -> Check[Any]: diff --git a/discord/ext/commands/flags.py b/discord/ext/commands/flags.py index 423101852..280b65257 100644 --- a/discord/ext/commands/flags.py +++ b/discord/ext/commands/flags.py @@ -485,7 +485,7 @@ class FlagConverter(metaclass=FlagsMeta): for flag in flags.values(): if callable(flag.default): # Type checker does not understand that flag.default is a Callable - default = await maybe_coroutine(flag.default, ctx) # type: ignore + default = await maybe_coroutine(flag.default, ctx) setattr(self, flag.attribute, default) else: setattr(self, flag.attribute, flag.default) @@ -600,7 +600,7 @@ class FlagConverter(metaclass=FlagsMeta): else: if callable(flag.default): # Type checker does not understand flag.default is a Callable - default = await maybe_coroutine(flag.default, ctx) # type: ignore + default = await maybe_coroutine(flag.default, ctx) setattr(self, flag.attribute, default) else: setattr(self, flag.attribute, flag.default) diff --git a/discord/ext/commands/hybrid.py b/discord/ext/commands/hybrid.py index 41d9ffd25..eec964f1d 100644 --- a/discord/ext/commands/hybrid.py +++ b/discord/ext/commands/hybrid.py @@ -398,7 +398,7 @@ class HybridAppCommand(discord.app_commands.Command[CogT, P, T]): if self.binding is not None: try: # Type checker does not like runtime attribute retrieval - check: AppCommandCheck = self.binding.interaction_check # type: ignore + check: AppCommandCheck = self.binding.interaction_check except AttributeError: pass else: @@ -920,9 +920,9 @@ def hybrid_group( If the function is not a coroutine or is already a command. """ - def decorator(func: CommandCallback[CogT, ContextT, P, T]): + def decorator(func: CommandCallback[CogT, ContextT, P, T]) -> HybridGroup[CogT, P, T]: if isinstance(func, Command): raise TypeError('Callback is already a command.') return HybridGroup(func, name=name, with_app_command=with_app_command, **attrs) - return decorator # type: ignore + return decorator diff --git a/discord/ext/commands/parameters.py b/discord/ext/commands/parameters.py index d3302f5a3..181653bdc 100644 --- a/discord/ext/commands/parameters.py +++ b/discord/ext/commands/parameters.py @@ -197,7 +197,7 @@ class Parameter(inspect.Parameter): """ # pre-condition: required is False if callable(self.default): - return await maybe_coroutine(self.default, ctx) # type: ignore + return await maybe_coroutine(self.default, ctx) return self.default diff --git a/discord/flags.py b/discord/flags.py index 27eaf2628..001dcfce5 100644 --- a/discord/flags.py +++ b/discord/flags.py @@ -26,7 +26,21 @@ from __future__ import annotations from functools import reduce from operator import or_ -from typing import TYPE_CHECKING, Any, Callable, ClassVar, Dict, Iterator, List, Optional, Tuple, Type, TypeVar, overload +from typing import ( + TYPE_CHECKING, + Any, + Callable, + ClassVar, + Dict, + Iterator, + List, + Optional, + Sequence, + Tuple, + Type, + TypeVar, + overload, +) from .enums import UserFlags @@ -1621,7 +1635,7 @@ class ChannelFlags(BaseFlags): class ArrayFlags(BaseFlags): @classmethod - def _from_value(cls: Type[Self], value: List[int]) -> Self: + def _from_value(cls: Type[Self], value: Sequence[int]) -> Self: self = cls.__new__(cls) # This is a micro-optimization given the frequency this object can be created. # (1).__lshift__ is used in place of lambda x: 1 << x diff --git a/discord/guild.py b/discord/guild.py index f7d1a5566..33ad1871a 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -132,6 +132,7 @@ if TYPE_CHECKING: from .types.integration import IntegrationType from .types.snowflake import SnowflakeList from .types.widget import EditWidgetSettings + from .types.audit_log import AuditLogEvent from .message import EmojiInputType VocalGuildChannel = Union[VoiceChannel, StageChannel] @@ -3853,7 +3854,7 @@ class Guild(Hashable): async def _before_strategy(retrieve: int, before: Optional[Snowflake], limit: Optional[int]): before_id = before.id if before else None data = await self._state.http.get_audit_logs( - self.id, limit=retrieve, user_id=user_id, action_type=action, before=before_id + self.id, limit=retrieve, user_id=user_id, action_type=action_type, before=before_id ) entries = data.get('audit_log_entries', []) @@ -3869,7 +3870,7 @@ class Guild(Hashable): async def _after_strategy(retrieve: int, after: Optional[Snowflake], limit: Optional[int]): after_id = after.id if after else None data = await self._state.http.get_audit_logs( - self.id, limit=retrieve, user_id=user_id, action_type=action, after=after_id + self.id, limit=retrieve, user_id=user_id, action_type=action_type, after=after_id ) entries = data.get('audit_log_entries', []) @@ -3887,8 +3888,10 @@ class Guild(Hashable): else: user_id = None - if action: - action = action.value + if action is not MISSING: + action_type: Optional[AuditLogEvent] = action.value + else: + action_type = None if isinstance(before, datetime.datetime): before = Object(id=utils.time_snowflake(before, high=False)) diff --git a/discord/http.py b/discord/http.py index 6e803830e..84365cec7 100644 --- a/discord/http.py +++ b/discord/http.py @@ -68,7 +68,6 @@ if TYPE_CHECKING: from .embeds import Embed from .message import Attachment from .flags import MessageFlags - from .enums import AuditLogAction from .types import ( appinfo, @@ -1727,7 +1726,7 @@ class HTTPClient: before: Optional[Snowflake] = None, after: Optional[Snowflake] = None, user_id: Optional[Snowflake] = None, - action_type: Optional[AuditLogAction] = None, + action_type: Optional[audit_log.AuditLogEvent] = None, ) -> Response[audit_log.AuditLog]: params: Dict[str, Any] = {'limit': limit} if before: diff --git a/discord/invite.py b/discord/invite.py index 6e00f36e3..1c18e4187 100644 --- a/discord/invite.py +++ b/discord/invite.py @@ -47,6 +47,7 @@ if TYPE_CHECKING: InviteGuild as InviteGuildPayload, GatewayInvite as GatewayInvitePayload, ) + from .types.guild import GuildFeature from .types.channel import ( PartialChannel as InviteChannelPayload, ) @@ -189,7 +190,7 @@ class PartialInviteGuild: self._state: ConnectionState = state self.id: int = id self.name: str = data['name'] - self.features: List[str] = data.get('features', []) + self.features: List[GuildFeature] = data.get('features', []) self._icon: Optional[str] = data.get('icon') self._banner: Optional[str] = data.get('banner') self._splash: Optional[str] = data.get('splash') From c448932fa0a35e347f3e963436df62f575aa740b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 3 Jul 2023 18:10:02 -0400 Subject: [PATCH 125/473] [Crowdin] Updated translation files --- docs/locale/ja/LC_MESSAGES/api.po | 3753 ++++++++++------- docs/locale/ja/LC_MESSAGES/discord.po | 64 +- .../locale/ja/LC_MESSAGES/ext/commands/api.po | 277 +- .../ja/LC_MESSAGES/ext/commands/cogs.po | 4 +- .../ja/LC_MESSAGES/ext/commands/commands.po | 54 +- .../ja/LC_MESSAGES/ext/commands/extensions.po | 8 +- .../ja/LC_MESSAGES/ext/commands/index.po | 4 +- docs/locale/ja/LC_MESSAGES/ext/tasks/index.po | 4 +- docs/locale/ja/LC_MESSAGES/faq.po | 4 +- docs/locale/ja/LC_MESSAGES/index.po | 4 +- docs/locale/ja/LC_MESSAGES/intents.po | 4 +- .../locale/ja/LC_MESSAGES/interactions/api.po | 138 +- docs/locale/ja/LC_MESSAGES/intro.po | 14 +- docs/locale/ja/LC_MESSAGES/logging.po | 4 +- docs/locale/ja/LC_MESSAGES/migrating.po | 608 +-- .../ja/LC_MESSAGES/migrating_to_async.po | 4 +- docs/locale/ja/LC_MESSAGES/migrating_to_v1.po | 4 +- docs/locale/ja/LC_MESSAGES/quickstart.po | 4 +- docs/locale/ja/LC_MESSAGES/sphinx.po | 4 +- .../ja/LC_MESSAGES/version_guarantees.po | 4 +- docs/locale/ja/LC_MESSAGES/whats_new.po | 2002 +++++---- 21 files changed, 4020 insertions(+), 2946 deletions(-) diff --git a/docs/locale/ja/LC_MESSAGES/api.po b/docs/locale/ja/LC_MESSAGES/api.po index a240547dd..98c0eb88f 100644 --- a/docs/locale/ja/LC_MESSAGES/api.po +++ b/docs/locale/ja/LC_MESSAGES/api.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: discordpy\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-29 20:45+0000\n" -"PO-Revision-Date: 2023-01-30 13:48\n" +"POT-Creation-Date: 2023-06-21 01:17+0000\n" +"PO-Revision-Date: 2023-06-21 01:20\n" "Last-Translator: \n" "Language-Team: Japanese\n" "MIME-Version: 1.0\n" @@ -309,7 +309,7 @@ msgstr "これが ``__init__`` で渡されなかった場合、データを含 #: ../../../discord/client.py:docstring of discord.Client.application_id:10 #: ../../../discord/appinfo.py:docstring of discord.appinfo.AppInfo:72 #: ../../../discord/appinfo.py:docstring of discord.appinfo.AppInfo:82 -#: ../../api.rst:1430 +#: ../../api.rst:1431 #: ../../../discord/audit_logs.py:docstring of discord.audit_logs.AuditLogEntry:41 msgid "Optional[:class:`int`]" msgstr "Optional[:class:`int`]" @@ -659,6 +659,7 @@ msgid "Optional[:class:`~discord.User`]" msgstr "Optional[:class:`~discord.User`]" #: ../../../discord/client.py:docstring of discord.client.Client.get_emoji:1 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.get_emoji:1 msgid "Returns an emoji with the given ID." msgstr "与えられたIDの絵文字を返します。" @@ -748,7 +749,7 @@ msgid "This function returns the **first event that meets the requirements**." msgstr "この関数は **条件を満たす最初のイベント** を返します。" #: ../../../discord/client.py:docstring of discord.client.Client.wait_for:22 -#: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:13 +#: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:14 #: ../../../discord/player.py:docstring of discord.player.FFmpegOpusAudio.from_probe:7 #: ../../../discord/utils.py:docstring of discord.utils.get:24 #: ../../../discord/abc.py:docstring of discord.abc.GuildChannel.set_permissions:25 @@ -823,14 +824,14 @@ msgid "Retrieves an :term:`asynchronous iterator` that enables receiving your gu msgstr "Botが所属するGuildを取得できる、 :term:`asynchronous iterator` を取得します。" #: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:5 -msgid "Using this, you will only receive :attr:`.Guild.owner`, :attr:`.Guild.icon`, :attr:`.Guild.id`, and :attr:`.Guild.name` per :class:`.Guild`." -msgstr "これを使った場合、各 :class:`Guild` の :attr:`Guild.owner` 、 :attr:`Guild.icon` 、 :attr:`Guild.id` 、 :attr:`Guild.name` のみ取得できます。" +msgid "Using this, you will only receive :attr:`.Guild.owner`, :attr:`.Guild.icon`, :attr:`.Guild.id`, :attr:`.Guild.name`, :attr:`.Guild.approximate_member_count`, and :attr:`.Guild.approximate_presence_count` per :class:`.Guild`." +msgstr "" -#: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:10 +#: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:11 msgid "This method is an API call. For general usage, consider :attr:`guilds` instead." msgstr "これはAPIを呼び出します。通常は :attr:`guilds` を代わりに使用してください。" -#: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:14 +#: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:15 #: ../../../discord/abc.py:docstring of discord.abc.Messageable.history:7 #: ../../../discord/user.py:docstring of discord.abc.Messageable.history:7 #: ../../../discord/reaction.py:docstring of discord.reaction.Reaction.users:12 @@ -838,12 +839,12 @@ msgstr "これはAPIを呼び出します。通常は :attr:`guilds` を代わ msgid "Usage ::" msgstr "使い方 ::" -#: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:19 +#: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:20 #: ../../../discord/guild.py:docstring of discord.guild.Guild.bans:15 msgid "Flattening into a list ::" msgstr "リストへフラット化 ::" -#: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:24 +#: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:25 #: ../../../discord/abc.py:docstring of discord.abc.Messageable.history:19 #: ../../../discord/user.py:docstring of discord.abc.Messageable.history:19 #: ../../../discord/guild.py:docstring of discord.guild.Guild.fetch_members:10 @@ -851,27 +852,31 @@ msgstr "リストへフラット化 ::" msgid "All parameters are optional." msgstr "すべてのパラメータがオプションです。" -#: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:26 +#: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:27 msgid "The number of guilds to retrieve. If ``None``, it retrieves every guild you have access to. Note, however, that this would make it a slow operation. Defaults to ``200``." msgstr "取得するギルドの数。 ``None`` の場合、Botがアクセスできるギルドすべてを取得します。ただし、これには時間が掛かることに注意してください。デフォルトは200です。" -#: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:33 +#: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:34 msgid "The default has been changed to 200." msgstr "デフォルトが200に変更されました。" -#: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:35 +#: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:36 msgid "Retrieves guilds before this date or object. If a datetime is provided, it is recommended to use a UTC aware datetime. If the datetime is naive, it is assumed to be local time." msgstr "渡された日付、またはギルドより前のギルドを取得します。日付を指定する場合、UTC aware datetimeを利用することを推奨します。naive datetimeである場合、これはローカル時間であるとみなされます。" -#: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:39 +#: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:40 msgid "Retrieve guilds after this date or object. If a datetime is provided, it is recommended to use a UTC aware datetime. If the datetime is naive, it is assumed to be local time." msgstr "渡された日付、またはギルドより後のギルドを取得します。日付を指定する場合、UTC aware datetimeを利用することを推奨します。naive datetimeである場合、これはローカル時間であるとみなされます。" #: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:44 +msgid "Whether to include count information in the guilds. This fills the :attr:`.Guild.approximate_member_count` and :attr:`.Guild.approximate_presence_count` attributes without needing any privileged intents. Defaults to ``True``." +msgstr "" + +#: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:51 msgid "Getting the guilds failed." msgstr "ギルドの取得に失敗した場合。" -#: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:46 +#: ../../../discord/client.py:docstring of discord.client.Client.fetch_guilds:53 msgid ":class:`.Guild` -- The guild with the guild data parsed." msgstr ":class:`.Guild` -- データを解析したGuild。" @@ -1178,7 +1183,7 @@ msgstr "あなたがリクエストしたユーザー。" #: ../../../discord/client.py:docstring of discord.client.Client.fetch_user:22 #: ../../../discord/abc.py:docstring of discord.abc.User:5 -#: ../../../discord/abc.py:docstring of discord.abc.Messageable:10 +#: ../../../discord/abc.py:docstring of discord.abc.Messageable:11 msgid ":class:`~discord.User`" msgstr ":class:`~discord.User`" @@ -1338,8 +1343,8 @@ msgid "A view was not passed." msgstr "ビューが渡されない場合。" #: ../../../discord/client.py:docstring of discord.client.Client.add_view:16 -msgid "The view is not persistent. A persistent view has no timeout and all their components have an explicitly provided custom_id." -msgstr "ビューが永続しない場合。永続するビューにはタイムアウトがなく、すべてのコンポーネントに明示的に渡された custom_id があります。" +msgid "The view is not persistent or is already finished. A persistent view has no timeout and all their components have an explicitly provided custom_id." +msgstr "" #: ../../../discord/client.py:docstring of discord.Client.persistent_views:1 msgid "A sequence of persistent views added to the client." @@ -1461,9 +1466,9 @@ msgstr "アプリケーションID。" #: ../../../discord/appinfo.py:docstring of discord.appinfo.AppInfo:8 #: ../../../discord/appinfo.py:docstring of discord.appinfo.PartialAppInfo:9 +#: ../../../discord/appinfo.py:docstring of discord.appinfo.PartialAppInfo:54 #: ../../../discord/team.py:docstring of discord.team.Team:7 #: ../../../discord/team.py:docstring of discord.team.Team:19 -#: ../../../discord/team.py:docstring of discord.team.TeamMember:33 msgid ":class:`int`" msgstr ":class:`int`" @@ -1485,7 +1490,7 @@ msgid "The application owner." msgstr "アプリケーションの所有者。" #: ../../../discord/appinfo.py:docstring of discord.appinfo.AppInfo:20 -#: ../../api.rst:4148 +#: ../../api.rst:4277 #: ../../../discord/integrations.py:docstring of discord.integrations.Integration:45 #: ../../../discord/integrations.py:docstring of discord.integrations.BotIntegration:39 #: ../../../discord/integrations.py:docstring of discord.integrations.StreamIntegration:63 @@ -1512,7 +1517,7 @@ msgstr "ボットの招待がアプリケーション所有者に限定されて #: ../../../discord/appinfo.py:docstring of discord.appinfo.AppInfo:41 #: ../../../discord/appinfo.py:docstring of discord.appinfo.AppInfo:48 -#: ../../../discord/team.py:docstring of discord.team.TeamMember:45 +#: ../../../discord/team.py:docstring of discord.team.TeamMember:53 #: ../../../discord/team.py:docstring of discord.user.BaseUser.mentioned_in:7 #: ../../../discord/opus.py:docstring of discord.opus.is_loaded:7 msgid ":class:`bool`" @@ -1573,9 +1578,9 @@ msgstr "アプリケーションの機能を説明するタグのリスト。" #: ../../../discord/appinfo.py:docstring of discord.appinfo.AppInfo:115 #: ../../../discord/appinfo.py:docstring of discord.appinfo.AppInfo:123 +#: ../../../discord/appinfo.py:docstring of discord.appinfo.PartialAppInfo:62 #: ../../../discord/appinfo.py:docstring of discord.appinfo.AppInstallParams:10 -#: ../../../discord/guild.py:docstring of discord.guild.Guild:139 -#: ../../../discord/activity.py:docstring of discord.Spotify.artists:3 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:133 msgid "List[:class:`str`]" msgstr "List[:class:`str`]" @@ -1592,6 +1597,7 @@ msgid "Optional[:class:`AppInstallParams`]" msgstr "Optional[:class:`AppInstallParams`]" #: ../../../discord/appinfo.py:docstring of discord.appinfo.AppInfo:135 +#: ../../../discord/appinfo.py:docstring of discord.appinfo.PartialAppInfo:75 msgid "The application's connection verification URL which will render the application as a verification method in the guild's role verification configuration." msgstr "アプリケーションをギルドのロール紐づけ設定にて紐づけ方法として扱うようにするための、アプリケーションの接続確認URL。" @@ -1603,8 +1609,8 @@ msgstr "存在する場合は、アプリケーションのアイコンアセッ #: ../../../discord/appinfo.py:docstring of discord.AppInfo.icon:3 #: ../../../discord/appinfo.py:docstring of discord.AppInfo.cover_image:5 #: ../../../discord/appinfo.py:docstring of discord.PartialAppInfo.icon:3 +#: ../../../discord/appinfo.py:docstring of discord.PartialAppInfo.cover_image:7 #: ../../../discord/team.py:docstring of discord.Team.icon:3 -#: ../../../discord/role.py:docstring of discord.Role.icon:11 msgid "Optional[:class:`.Asset`]" msgstr "Optional[:class:`.Asset`]" @@ -1613,6 +1619,7 @@ msgid "Retrieves the cover image on a store embed, if any." msgstr "存在する場合は、ストアの埋め込みのカバー画像を取得します。" #: ../../../discord/appinfo.py:docstring of discord.AppInfo.cover_image:3 +#: ../../../discord/appinfo.py:docstring of discord.PartialAppInfo.cover_image:3 msgid "This is only available if the application is a game sold on Discord." msgstr "これはアプリケーションがDiscordで販売されているゲームの場合にのみ利用できます。" @@ -1646,6 +1653,22 @@ msgstr "PartialAppInfo" msgid "Represents a partial AppInfo given by :func:`~discord.abc.GuildChannel.create_invite`" msgstr ":func:`~discord.abc.GuildChannel.create_invite` により与えられた部分的なAppInfo。" +#: ../../../discord/appinfo.py:docstring of discord.appinfo.PartialAppInfo:50 +msgid "The approximate count of the guilds the bot was added to." +msgstr "" + +#: ../../../discord/appinfo.py:docstring of discord.appinfo.PartialAppInfo:58 +msgid "A list of authentication redirect URIs." +msgstr "" + +#: ../../../discord/appinfo.py:docstring of discord.appinfo.PartialAppInfo:66 +msgid "The interactions endpoint url of the application to receive interactions over this endpoint rather than over the gateway, if configured." +msgstr "" + +#: ../../../discord/appinfo.py:docstring of discord.PartialAppInfo.cover_image:1 +msgid "Retrieves the cover image of the application's default rich presence." +msgstr "" + #: ../../api.rst:76 msgid "AppInstallParams" msgstr "AppInstallParams" @@ -1663,8 +1686,8 @@ msgid "The permissions to give to application in the guild." msgstr "ギルドに追加するアプリケーションに与える権限。" #: ../../../discord/appinfo.py:docstring of discord.appinfo.AppInstallParams:16 -#: ../../api.rst:3598 -#: ../../api.rst:3687 +#: ../../api.rst:3659 +#: ../../api.rst:3748 #: ../../../discord/member.py:docstring of discord.Member.guild_permissions:14 #: ../../../discord/role.py:docstring of discord.Role.permissions:3 msgid ":class:`Permissions`" @@ -1731,8 +1754,8 @@ msgid "Return the team member's hash." msgstr "チームメンバーのハッシュ値を返します。" #: ../../../discord/team.py:docstring of discord.team.TeamMember:19 -msgid "Returns the team member's name with discriminator." -msgstr "チームメンバーの名前とタグを返します。" +msgid "Returns the team member's handle (e.g. ``name`` or ``name#discriminator``)." +msgstr "" #: ../../../discord/team.py:docstring of discord.team.TeamMember:25 msgid "The team member's username." @@ -1743,28 +1766,32 @@ msgid "The team member's unique ID." msgstr "チームメンバーの一意のID。" #: ../../../discord/team.py:docstring of discord.team.TeamMember:37 -msgid "The team member's discriminator. This is given when the username has conflicts." -msgstr "チームメンバーのタグ。これはユーザー名が重複している場合に付与されます。" +msgid "The team member's discriminator. This is a legacy concept that is no longer used." +msgstr "" #: ../../../discord/team.py:docstring of discord.team.TeamMember:43 -#: ../../../discord/user.py:docstring of discord.user.ClientUser:41 -#: ../../../discord/user.py:docstring of discord.user.User:41 +msgid "The team member's global nickname, taking precedence over the username in display." +msgstr "" + +#: ../../../discord/team.py:docstring of discord.team.TeamMember:51 +#: ../../../discord/user.py:docstring of discord.user.ClientUser:49 +#: ../../../discord/user.py:docstring of discord.user.User:49 msgid "Specifies if the user is a bot account." msgstr "ユーザーがBotアカウントであるかを表します。" -#: ../../../discord/team.py:docstring of discord.team.TeamMember:49 +#: ../../../discord/team.py:docstring of discord.team.TeamMember:57 msgid "The team that the member is from." msgstr "メンバーの出身チーム。" -#: ../../../discord/team.py:docstring of discord.team.TeamMember:51 +#: ../../../discord/team.py:docstring of discord.team.TeamMember:59 msgid ":class:`Team`" msgstr ":class:`Team`" -#: ../../../discord/team.py:docstring of discord.team.TeamMember:55 +#: ../../../discord/team.py:docstring of discord.team.TeamMember:63 msgid "The membership state of the member (e.g. invited or accepted)" msgstr "メンバーの参加状態((例:招待されたか、承認されたか)" -#: ../../../discord/team.py:docstring of discord.team.TeamMember:57 +#: ../../../discord/team.py:docstring of discord.team.TeamMember:65 msgid ":class:`TeamMembershipState`" msgstr ":class:`TeamMembershipState`" @@ -1870,7 +1897,7 @@ msgstr ":attr:`colour` という名前のエイリアスが存在します。" #: ../../../discord/team.py:docstring of discord.TeamMember.color:6 #: ../../../discord/team.py:docstring of discord.TeamMember.colour:6 -#: ../../api.rst:3607 +#: ../../api.rst:3668 #: ../../../discord/user.py:docstring of discord.ClientUser.color:6 #: ../../../discord/user.py:docstring of discord.ClientUser.colour:6 msgid ":class:`Colour`" @@ -1918,14 +1945,14 @@ msgstr ":class:`datetime.datetime`" #: ../../../discord/user.py:docstring of discord.ClientUser.default_avatar:1 #: ../../../discord/user.py:docstring of discord.User.default_avatar:1 #: ../../../discord/widget.py:docstring of discord.WidgetMember.default_avatar:1 -msgid "Returns the default avatar for a given user. This is calculated by the user's discriminator." -msgstr "ユーザーのデフォルトのアバターを返します。これはユーザーのタグから算出されます。" +msgid "Returns the default avatar for a given user." +msgstr "" #: ../../../discord/team.py:docstring of discord.TeamMember.default_avatar:3 #: ../../../discord/team.py:docstring of discord.TeamMember.display_avatar:7 -#: ../../api.rst:3381 -#: ../../api.rst:3387 -#: ../../api.rst:3393 +#: ../../api.rst:3442 +#: ../../api.rst:3448 +#: ../../api.rst:3454 msgid ":class:`Asset`" msgstr ":class:`Asset`" @@ -1957,8 +1984,8 @@ msgstr "ユーザーの表示名を返します。" #: ../../../discord/user.py:docstring of discord.ClientUser.display_name:3 #: ../../../discord/user.py:docstring of discord.User.display_name:3 #: ../../../discord/member.py:docstring of discord.Member.display_name:3 -msgid "For regular users this is just their username, but if they have a guild specific nickname then that is returned instead." -msgstr "通常であれば、これはユーザー名がそのまま返りますが、ギルドにてニックネームを設定している場合は、代替としてニックネームが返ります。" +msgid "For regular users this is just their global name or their username, but if they have a guild specific nickname then that is returned instead." +msgstr "" #: ../../../discord/team.py:docstring of discord.TeamMember.mention:1 #: ../../../discord/abc.py:docstring of discord.abc.User.mention:1 @@ -2052,9 +2079,9 @@ msgstr "接続しているギルド。" #: ../../../discord/voice_client.py:docstring of discord.VoiceClient.guild:3 #: ../../../discord/audit_logs.py:docstring of discord.audit_logs.AuditLogEntry:53 +#: ../../api.rst:3436 #: ../../../discord/automod.py:docstring of discord.automod.AutoModRule:15 #: ../../../discord/automod.py:docstring of discord.AutoModAction.guild:3 -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:103 msgid ":class:`Guild`" msgstr ":class:`Guild`" @@ -2663,9 +2690,9 @@ msgstr "アプリケーションコマンドの権限が更新されたときに #: ../../api.rst:215 #: ../../api.rst:370 -#: ../../api.rst:735 -#: ../../api.rst:793 -#: ../../api.rst:978 +#: ../../api.rst:736 +#: ../../api.rst:794 +#: ../../api.rst:979 msgid "The raw event payload data." msgstr "生のイベントペイロードデータ。" @@ -2682,7 +2709,7 @@ msgid "The command that completed successfully" msgstr "正常に実行されたコマンド。" #: ../../api.rst:231 -#: ../../api.rst:4072 +#: ../../api.rst:4201 msgid "AutoMod" msgstr "AutoMod" @@ -2743,8 +2770,8 @@ msgstr "ギルドは :attr:`~abc.GuildChannel.guild` で取得できます。" #: ../../api.rst:291 #: ../../api.rst:300 #: ../../api.rst:311 -#: ../../api.rst:545 -#: ../../api.rst:554 +#: ../../api.rst:546 +#: ../../api.rst:555 msgid "This requires :attr:`Intents.guilds` to be enabled." msgstr ":attr:`Intents.guilds` を有効にする必要があります。" @@ -2782,10 +2809,10 @@ msgid "Called whenever a private group DM is updated. e.g. changed name or topic msgstr "プライベートグループDMが更新されたとき呼び出されます。 例: 名前やトピックの変更。" #: ../../api.rst:322 -#: ../../api.rst:884 -#: ../../api.rst:918 -#: ../../api.rst:935 -#: ../../api.rst:952 +#: ../../api.rst:885 +#: ../../api.rst:919 +#: ../../api.rst:936 +#: ../../api.rst:953 msgid "This requires :attr:`Intents.messages` to be enabled." msgstr ":attr:`Intents.messages` を有効にする必要があります。" @@ -2961,192 +2988,192 @@ msgstr "これはクライアントのWebSocketから受信したメッセージ msgid "The message that is about to be passed on to the WebSocket library. It can be :class:`bytes` to denote a binary message or :class:`str` to denote a regular text message." msgstr "WebSocketライブラリから渡されるメッセージ。バイナリメッセージの場合は :class:`bytes` 、通常のメッセージの場合は :class:`str` です。" -#: ../../api.rst:499 +#: ../../api.rst:500 msgid "Gateway" msgstr "Gateway" -#: ../../api.rst:503 +#: ../../api.rst:504 msgid "Called when the client is done preparing the data received from Discord. Usually after login is successful and the :attr:`Client.guilds` and co. are filled up." msgstr "クライアントがDiscordから受信したデータの準備を完了した際に呼び出されます。通常はログインが成功したあと、 :attr:`Client.guilds` とそれに関連するものの準備が完了したときです。" -#: ../../api.rst:508 +#: ../../api.rst:509 msgid "This function is not guaranteed to be the first event called. Likewise, this function is **not** guaranteed to only be called once. This library implements reconnection logic and thus will end up calling this event whenever a RESUME request fails." msgstr "このイベントは、最初に呼び出されるイベントとは限りません。同時に、このイベントは **一度だけ呼ばれるという保証もできません** 。このライブラリは、再接続ロジックを実装しているためリジューム要求が失敗するたびにこのイベントが呼び出されることになります。" -#: ../../api.rst:515 +#: ../../api.rst:516 msgid "Called when the client has resumed a session." msgstr "クライアントがセッションを再開したときに呼び出されます。" -#: ../../api.rst:519 +#: ../../api.rst:520 msgid "Similar to :func:`on_ready` except used by :class:`AutoShardedClient` to denote when a particular shard ID has become ready." msgstr "特定の Shard IDが準備完了になったかを確認するために :class:`AutoShardedClient` で使用される以外は :func:`on_ready` とほとんど同じです。" -#: ../../api.rst:522 +#: ../../api.rst:523 msgid "The shard ID that is ready." msgstr "準備が完了したShard ID。" -#: ../../api.rst:528 +#: ../../api.rst:529 msgid "Similar to :func:`on_resumed` except used by :class:`AutoShardedClient` to denote when a particular shard ID has resumed a session." msgstr "特定のシャードIDを持つシャードがセッションを再開したかどうかを確認するために :class:`AutoShardedClient` で使用されることを除けば :func:`on_resumed` とほとんど同じです。" -#: ../../api.rst:533 +#: ../../api.rst:534 msgid "The shard ID that has resumed." msgstr "セッションが再開したシャードのID。" -#: ../../api.rst:537 +#: ../../api.rst:538 msgid "Guilds" msgstr "Guilds" -#: ../../api.rst:542 +#: ../../api.rst:543 msgid "Called when a guild becomes available or unavailable. The guild must have existed in the :attr:`Client.guilds` cache." msgstr "ギルドが利用可能・不可能になったときに呼び出されます。ギルドは :attr:`Client.guilds` キャッシュに存在していないといけません。" -#: ../../api.rst:547 +#: ../../api.rst:548 msgid "The :class:`Guild` that has changed availability." msgstr "利用状況が変わった :class:`Guild` 。" -#: ../../api.rst:551 +#: ../../api.rst:552 msgid "Called when a :class:`Guild` is either created by the :class:`Client` or when the :class:`Client` joins a guild." msgstr ":class:`Client` によって :class:`Guild` が作成された。または :class:`Client` がギルドに参加したときに呼び出されます。" -#: ../../api.rst:556 +#: ../../api.rst:557 msgid "The guild that was joined." msgstr "参加したギルド。" -#: ../../api.rst:561 +#: ../../api.rst:562 msgid "Called when a :class:`Guild` is removed from the :class:`Client`." msgstr ":class:`Client` が :class:`Guild` から削除されたときに呼び出されます。" -#: ../../api.rst:563 +#: ../../api.rst:564 msgid "This happens through, but not limited to, these circumstances:" msgstr "これは以下の状況時に呼び出されますが、これに限ったものではありません:" -#: ../../api.rst:565 +#: ../../api.rst:566 msgid "The client got banned." msgstr "クライアントがBANされた。" -#: ../../api.rst:566 +#: ../../api.rst:567 msgid "The client got kicked." msgstr "クライアントがキックされた。" -#: ../../api.rst:567 +#: ../../api.rst:568 msgid "The client left the guild." msgstr "クライアントがギルドから脱退した。" -#: ../../api.rst:568 +#: ../../api.rst:569 msgid "The client or the guild owner deleted the guild." msgstr "クライアント、またはギルドオーナーがギルドを削除した。" -#: ../../api.rst:570 +#: ../../api.rst:571 msgid "In order for this event to be invoked then the :class:`Client` must have been part of the guild to begin with. (i.e. it is part of :attr:`Client.guilds`)" msgstr "このイベントが呼び出されるためには、 :class:`Client` がギルドに参加している必要があります。(つまり、 :attr:`Client.guilds` にギルドが存在しなければならない)" -#: ../../api.rst:575 +#: ../../api.rst:576 msgid "The guild that got removed." msgstr "削除されたギルド。" -#: ../../api.rst:580 +#: ../../api.rst:581 msgid "Called when a :class:`Guild` updates, for example:" msgstr ":class:`Guild` が更新されたときに呼び出されます。例えば:" -#: ../../api.rst:582 +#: ../../api.rst:583 msgid "Changed name" msgstr "名前が変更された" -#: ../../api.rst:583 +#: ../../api.rst:584 msgid "Changed AFK channel" msgstr "AFKチャンネルが変更された" -#: ../../api.rst:584 +#: ../../api.rst:585 msgid "Changed AFK timeout" msgstr "AFKのタイムアウト時間が変更された" -#: ../../api.rst:585 +#: ../../api.rst:586 msgid "etc" msgstr "その他" -#: ../../api.rst:589 +#: ../../api.rst:590 msgid "The guild prior to being updated." msgstr "更新される前のギルド。" -#: ../../api.rst:591 +#: ../../api.rst:592 msgid "The guild after being updated." msgstr "更新された後のギルド。" -#: ../../api.rst:596 +#: ../../api.rst:597 msgid "Called when a :class:`Guild` adds or removes :class:`Emoji`." msgstr ":class:`Guild` に :class:`Emoji` が追加、または削除されたときに呼び出されます。" -#: ../../api.rst:598 -#: ../../api.rst:611 +#: ../../api.rst:599 +#: ../../api.rst:612 msgid "This requires :attr:`Intents.emojis_and_stickers` to be enabled." msgstr ":attr:`Intents.emojis_and_stickers` を有効にする必要があります。" -#: ../../api.rst:600 +#: ../../api.rst:601 msgid "The guild who got their emojis updated." msgstr "絵文字が更新されたギルド。" -#: ../../api.rst:602 +#: ../../api.rst:603 msgid "A list of emojis before the update." msgstr "更新前の絵文字のリスト。" -#: ../../api.rst:604 +#: ../../api.rst:605 msgid "A list of emojis after the update." msgstr "更新後の絵文字のリスト。" -#: ../../api.rst:609 +#: ../../api.rst:610 msgid "Called when a :class:`Guild` updates its stickers." msgstr ":class:`Guild` のスタンプが更新されたときに呼び出されます。" -#: ../../api.rst:615 +#: ../../api.rst:616 msgid "The guild who got their stickers updated." msgstr "スタンプが更新されたギルド。" -#: ../../api.rst:617 +#: ../../api.rst:618 msgid "A list of stickers before the update." msgstr "更新前のスタンプのリスト。" -#: ../../api.rst:619 +#: ../../api.rst:620 msgid "A list of stickers after the update." msgstr "更新後のスタンプのリスト。" -#: ../../api.rst:624 +#: ../../api.rst:625 msgid "Called when a :class:`Guild` gets a new audit log entry. You must have :attr:`~Permissions.view_audit_log` to receive this." msgstr ":class:`Guild` に新しい監査ログ項目が追加されたときに呼び出されます。これを受け取るには :attr:`~Permissions.view_audit_log` が必要です。" -#: ../../api.rst:627 -#: ../../api.rst:839 -#: ../../api.rst:852 +#: ../../api.rst:628 +#: ../../api.rst:840 +#: ../../api.rst:853 msgid "This requires :attr:`Intents.moderation` to be enabled." msgstr ":attr:`Intents.moderation` を有効にする必要があります。" -#: ../../api.rst:633 +#: ../../api.rst:634 msgid "Audit log entries received through the gateway are subject to data retrieval from cache rather than REST. This means that some data might not be present when you expect it to be. For example, the :attr:`AuditLogEntry.target` attribute will usually be a :class:`discord.Object` and the :attr:`AuditLogEntry.user` attribute will depend on user and member cache." msgstr "ゲートウェイ経由で取得した監査ログ項目はデータをRESTではなくキャッシュから取得します。このため、一部のデータが不足している場合があります。例えば、 :attr:`AuditLogEntry.target` 属性は多くの場合 :class:`discord.Object` になり、 :attr:`AuditLogEntry.user` 属性はユーザーとメンバーキャッシュに依存します。" -#: ../../api.rst:639 +#: ../../api.rst:640 msgid "To get the user ID of entry, :attr:`AuditLogEntry.user_id` can be used instead." msgstr "項目のユーザーIDを取得するには、代わりに :attr:`AuditLogEntry.user_id` を使用できます。" -#: ../../api.rst:641 +#: ../../api.rst:642 msgid "The audit log entry that was created." msgstr "作成された監査ログの項目。" -#: ../../api.rst:646 +#: ../../api.rst:647 msgid "Called when an :class:`Invite` is created. You must have :attr:`~Permissions.manage_channels` to receive this." msgstr ":class:`Invite` が作成されたときに呼び出されます。 受け取るには :attr:`~Permissions.manage_channels` が必要です。" -#: ../../api.rst:653 -#: ../../api.rst:670 +#: ../../api.rst:654 +#: ../../api.rst:671 msgid "There is a rare possibility that the :attr:`Invite.guild` and :attr:`Invite.channel` attributes will be of :class:`Object` rather than the respective models." msgstr "まれに :attr:`Invite.guild` と :attr:`Invite.channel` 属性がそれぞれの本来のモデルではなく :class:`Object` になることがあります。" -#: ../../api.rst:656 -#: ../../api.rst:676 +#: ../../api.rst:657 +#: ../../api.rst:677 msgid "This requires :attr:`Intents.invites` to be enabled." msgstr ":attr:`Intents.invites` を有効にする必要があります。" -#: ../../api.rst:658 +#: ../../api.rst:659 #: ../../../discord/abc.py:docstring of discord.abc.GuildChannel.create_invite:37 #: ../../../discord/channel.py:docstring of discord.abc.GuildChannel.create_invite:37 #: ../../../discord/channel.py:docstring of discord.abc.GuildChannel.create_invite:37 @@ -3154,704 +3181,704 @@ msgstr ":attr:`Intents.invites` を有効にする必要があります。" msgid "The invite that was created." msgstr "作成された招待。" -#: ../../api.rst:663 +#: ../../api.rst:664 msgid "Called when an :class:`Invite` is deleted. You must have :attr:`~Permissions.manage_channels` to receive this." msgstr ":class:`Invite` が削除されたときに呼び出されます。 受け取るには :attr:`~Permissions.manage_channels` が必要です。" -#: ../../api.rst:673 +#: ../../api.rst:674 msgid "Outside of those two attributes, the only other attribute guaranteed to be filled by the Discord gateway for this event is :attr:`Invite.code`." msgstr "これらの属性以外では、Discordゲートウェイによってこのイベントに与えられているのが保証されている属性は :attr:`Invite.code` のみです。" -#: ../../api.rst:678 +#: ../../api.rst:679 msgid "The invite that was deleted." msgstr "削除された招待。" -#: ../../api.rst:683 +#: ../../api.rst:684 msgid "Integrations" msgstr "Integrations" -#: ../../api.rst:687 +#: ../../api.rst:688 msgid "Called when an integration is created." msgstr "連携サービスが作成されたときに呼び出されます。" -#: ../../api.rst:689 -#: ../../api.rst:700 -#: ../../api.rst:711 -#: ../../api.rst:731 +#: ../../api.rst:690 +#: ../../api.rst:701 +#: ../../api.rst:712 +#: ../../api.rst:732 msgid "This requires :attr:`Intents.integrations` to be enabled." msgstr ":attr:`Intents.integrations` を有効にする必要があります。" -#: ../../api.rst:693 +#: ../../api.rst:694 msgid "The integration that was created." msgstr "作成された連携サービス。" -#: ../../api.rst:698 +#: ../../api.rst:699 msgid "Called when an integration is updated." msgstr "連携サービスが更新されたときに呼び出されます。" -#: ../../api.rst:704 +#: ../../api.rst:705 msgid "The integration that was updated." msgstr "更新された連携サービス。" -#: ../../api.rst:709 +#: ../../api.rst:710 msgid "Called whenever an integration is created, modified, or removed from a guild." msgstr "ギルドの連携サービスが作成、更新、削除されるたびに呼び出されます。" -#: ../../api.rst:715 +#: ../../api.rst:716 msgid "The guild that had its integrations updated." msgstr "連携サービスが更新されたギルド。" -#: ../../api.rst:720 +#: ../../api.rst:721 msgid "Called whenever a webhook is created, modified, or removed from a guild channel." msgstr "ギルドチャンネルのWebhookが作成、更新、削除されたときに呼び出されます。" -#: ../../api.rst:722 +#: ../../api.rst:723 msgid "This requires :attr:`Intents.webhooks` to be enabled." msgstr ":attr:`Intents.webhooks` を有効にする必要があります。" -#: ../../api.rst:724 +#: ../../api.rst:725 msgid "The channel that had its webhooks updated." msgstr "Webhookが更新されたチャンネル。" -#: ../../api.rst:729 +#: ../../api.rst:730 msgid "Called when an integration is deleted." msgstr "連携サービスが削除されたときに呼び出されます。" -#: ../../api.rst:739 +#: ../../api.rst:740 msgid "Interactions" msgstr "Interactions" -#: ../../api.rst:743 +#: ../../api.rst:744 msgid "Called when an interaction happened." msgstr "インタラクションが発生したときに呼び出されます。" -#: ../../api.rst:745 +#: ../../api.rst:746 msgid "This currently happens due to slash command invocations or components being used." msgstr "これは、現在はスラッシュコマンドの呼び出しやコンポーネントの使用により起こります。" -#: ../../api.rst:749 +#: ../../api.rst:750 msgid "This is a low level function that is not generally meant to be used. If you are working with components, consider using the callbacks associated with the :class:`~discord.ui.View` instead as it provides a nicer user experience." msgstr "これは、一般的な使用を意図していない低レベル関数です。コンポーネントを使用している場合は、よりよいユーザーエクスペリエンスを提供する :class:`~discord.ui.View` のコールバックの使用を検討してください。" -#: ../../api.rst:755 +#: ../../api.rst:756 msgid "The interaction data." msgstr "インタラクションデータ。" -#: ../../api.rst:759 +#: ../../api.rst:760 msgid "Members" msgstr "Members" -#: ../../api.rst:763 +#: ../../api.rst:764 msgid "Called when a :class:`Member` joins a :class:`Guild`." msgstr ":class:`Member` が :class:`Guild` に参加したときに呼び出されます。" -#: ../../api.rst:765 -#: ../../api.rst:777 -#: ../../api.rst:789 -#: ../../api.rst:811 -#: ../../api.rst:828 +#: ../../api.rst:766 +#: ../../api.rst:778 +#: ../../api.rst:790 +#: ../../api.rst:812 +#: ../../api.rst:829 msgid "This requires :attr:`Intents.members` to be enabled." msgstr ":attr:`Intents.members` を有効にする必要があります。" -#: ../../api.rst:767 +#: ../../api.rst:768 msgid "The member who joined." msgstr "参加したメンバー。" -#: ../../api.rst:772 -#: ../../api.rst:784 +#: ../../api.rst:773 +#: ../../api.rst:785 msgid "Called when a :class:`Member` leaves a :class:`Guild`." msgstr ":class:`Member` が :class:`Guild` から脱退したときに呼び出されます。" -#: ../../api.rst:774 +#: ../../api.rst:775 msgid "If the guild or member could not be found in the internal cache this event will not be called, you may use :func:`on_raw_member_remove` instead." msgstr "ギルドまたはメンバーが内部キャッシュで見つからない場合、このイベントは呼び出されません。代わりに :func:`on_raw_member_remove` を使用してください。" -#: ../../api.rst:779 +#: ../../api.rst:780 msgid "The member who left." msgstr "脱退したメンバー。" -#: ../../api.rst:786 +#: ../../api.rst:787 msgid "Unlike :func:`on_member_remove` this is called regardless of the guild or member being in the internal cache." msgstr ":func:`on_member_remove` とは異なり、ギルドやメンバーが内部キャッシュに存在するかどうかに関係なく呼び出されます。" -#: ../../api.rst:798 +#: ../../api.rst:799 msgid "Called when a :class:`Member` updates their profile." msgstr ":class:`Member` のプロフィールが更新されたときに呼び出されます。" -#: ../../api.rst:800 -#: ../../api.rst:822 -#: ../../api.rst:863 +#: ../../api.rst:801 +#: ../../api.rst:823 +#: ../../api.rst:864 msgid "This is called when one or more of the following things change:" msgstr "これらのうちひとつ以上が変更されたとき呼び出されます:" -#: ../../api.rst:802 +#: ../../api.rst:803 msgid "nickname" msgstr "ニックネーム" -#: ../../api.rst:803 +#: ../../api.rst:804 #: ../../../discord/member.py:docstring of discord.member.Member.edit:16 msgid "roles" msgstr "roles" -#: ../../api.rst:804 +#: ../../api.rst:805 msgid "pending" msgstr "ペンディング状態" -#: ../../api.rst:805 +#: ../../api.rst:806 msgid "timeout" msgstr "タイムアウト" -#: ../../api.rst:806 +#: ../../api.rst:807 msgid "guild avatar" msgstr "ギルドアバター" -#: ../../api.rst:807 +#: ../../api.rst:808 msgid "flags" msgstr "flags" -#: ../../api.rst:809 +#: ../../api.rst:810 msgid "Due to a Discord limitation, this event is not dispatched when a member's timeout expires." msgstr "Discordの制限により、このイベントはメンバーのタイムアウト期間が満了した場合には発生しません。" -#: ../../api.rst:813 -#: ../../api.rst:872 +#: ../../api.rst:814 +#: ../../api.rst:873 msgid "The updated member's old info." msgstr "更新されたメンバーの更新前情報。" -#: ../../api.rst:815 -#: ../../api.rst:874 +#: ../../api.rst:816 +#: ../../api.rst:875 msgid "The updated member's updated info." msgstr "更新されたメンバーの更新後情報。" -#: ../../api.rst:820 +#: ../../api.rst:821 msgid "Called when a :class:`User` updates their profile." msgstr ":class:`User` がプロフィールを編集したとき呼び出されます。" -#: ../../api.rst:824 +#: ../../api.rst:825 msgid "avatar" msgstr "アバター" -#: ../../api.rst:825 +#: ../../api.rst:826 msgid "username" msgstr "ユーザー名" -#: ../../api.rst:826 +#: ../../api.rst:827 msgid "discriminator" msgstr "タグ" -#: ../../api.rst:830 +#: ../../api.rst:831 msgid "The updated user's old info." msgstr "更新されたユーザーの更新前情報。" -#: ../../api.rst:832 +#: ../../api.rst:833 msgid "The updated user's updated info." msgstr "更新されたユーザーの更新後情報。" -#: ../../api.rst:837 +#: ../../api.rst:838 msgid "Called when user gets banned from a :class:`Guild`." msgstr "ユーザーが :class:`Guild` からBANされたとき呼び出されます。" -#: ../../api.rst:841 +#: ../../api.rst:842 msgid "The guild the user got banned from." msgstr "ユーザーがBANされたギルド。" -#: ../../api.rst:843 +#: ../../api.rst:844 msgid "The user that got banned. Can be either :class:`User` or :class:`Member` depending if the user was in the guild or not at the time of removal." msgstr "BANされたユーザー。BAN時にユーザーがギルドにいたかによって、 :class:`User` か :class:`Member` になります。" -#: ../../api.rst:850 +#: ../../api.rst:851 msgid "Called when a :class:`User` gets unbanned from a :class:`Guild`." msgstr ":class:`User` が :class:`Guild` のBANを解除されたとき呼び出されます。" -#: ../../api.rst:854 +#: ../../api.rst:855 msgid "The guild the user got unbanned from." msgstr "ユーザーのBANが解除されたギルド。" -#: ../../api.rst:856 +#: ../../api.rst:857 msgid "The user that got unbanned." msgstr "Banが解除されたユーザー。" -#: ../../api.rst:861 +#: ../../api.rst:862 msgid "Called when a :class:`Member` updates their presence." msgstr ":class:`Member` がプレゼンスを変更したとき呼び出されます。" -#: ../../api.rst:865 +#: ../../api.rst:866 msgid "status" msgstr "ステータス" -#: ../../api.rst:866 +#: ../../api.rst:867 msgid "activity" msgstr "アクティビティ" -#: ../../api.rst:868 +#: ../../api.rst:869 msgid "This requires :attr:`Intents.presences` and :attr:`Intents.members` to be enabled." msgstr "これを使用するには :attr:`Intents.presences` と :attr:`Intents.members` を有効にしないといけません。" -#: ../../api.rst:878 +#: ../../api.rst:879 msgid "Messages" msgstr "Messages" -#: ../../api.rst:882 +#: ../../api.rst:883 msgid "Called when a :class:`Message` is created and sent." msgstr ":class:`Message` が作成され送信されたときに呼び出されます。" -#: ../../api.rst:888 +#: ../../api.rst:889 msgid "Your bot's own messages and private messages are sent through this event. This can lead cases of 'recursion' depending on how your bot was programmed. If you want the bot to not reply to itself, consider checking the user IDs. Note that :class:`~ext.commands.Bot` does not have this problem." msgstr "Botのメッセージとプライベートメッセージはこのイベントを通して送信されます。Botのプログラムによっては「再帰呼び出し」を続けることになります。Botが自分自身に返信しないようにするためにはユーザーIDを確認する方法が考えられます。 :class:`~ext.commands.Bot` にはこの問題は存在しません。" -#: ../../api.rst:894 +#: ../../api.rst:895 msgid "The current message." msgstr "現在のメッセージ。" -#: ../../api.rst:899 +#: ../../api.rst:900 msgid "Called when a :class:`Message` receives an update event. If the message is not found in the internal message cache, then these events will not be called. Messages might not be in cache if the message is too old or the client is participating in high traffic guilds." msgstr ":class:`Message` が更新イベントを受け取ったときに呼び出されます。メッセージが内部のメッセージキャッシュに見つからない場合、このイベントは呼び出されません。これはメッセージが古すぎるか、クライアントが通信の多いギルドに参加している場合に発生します。" -#: ../../api.rst:904 +#: ../../api.rst:905 msgid "If this occurs increase the :class:`max_messages ` parameter or use the :func:`on_raw_message_edit` event instead." msgstr "発生する場合は :class:`max_messages ` パラメータの値を増加させるか :func:`on_raw_message_edit` イベントを使用してください。" -#: ../../api.rst:907 +#: ../../api.rst:908 msgid "The following non-exhaustive cases trigger this event:" msgstr "以下の非網羅的ケースがこのイベントを発生させます:" -#: ../../api.rst:909 +#: ../../api.rst:910 msgid "A message has been pinned or unpinned." msgstr "メッセージをピン留め、または解除した。" -#: ../../api.rst:910 +#: ../../api.rst:911 msgid "The message content has been changed." msgstr "メッセージの内容を変更した。" -#: ../../api.rst:911 +#: ../../api.rst:912 msgid "The message has received an embed." msgstr "メッセージが埋め込みを受け取った。" -#: ../../api.rst:913 +#: ../../api.rst:914 msgid "For performance reasons, the embed server does not do this in a \"consistent\" manner." msgstr "パフォーマンス上の理由から、埋め込みのサーバーはこれを「一貫した」方法では行いません。" -#: ../../api.rst:915 +#: ../../api.rst:916 msgid "The message's embeds were suppressed or unsuppressed." msgstr "メッセージの埋め込みが削除されたり、復元されたりした。" -#: ../../api.rst:916 +#: ../../api.rst:917 msgid "A call message has received an update to its participants or ending time." msgstr "通話呼び出しメッセージの参加者や終了時刻が変わった。" -#: ../../api.rst:920 +#: ../../api.rst:921 msgid "The previous version of the message." msgstr "更新前のメッセージ。" -#: ../../api.rst:922 +#: ../../api.rst:923 msgid "The current version of the message." msgstr "更新後のメッセージ。" -#: ../../api.rst:927 +#: ../../api.rst:928 msgid "Called when a message is deleted. If the message is not found in the internal message cache, then this event will not be called. Messages might not be in cache if the message is too old or the client is participating in high traffic guilds." msgstr "メッセージが削除された際に呼び出されます。メッセージが内部のメッセージキャッシュに見つからない場合、このイベントは呼び出されません。これはメッセージが古すぎるか、クライアントが通信の多いギルドに参加している場合に発生します。" -#: ../../api.rst:932 +#: ../../api.rst:933 msgid "If this occurs increase the :class:`max_messages ` parameter or use the :func:`on_raw_message_delete` event instead." msgstr "発生する場合は :class:`max_messages ` パラメータの値を増加させるか :func:`on_raw_message_delete` イベントを使用してください。" -#: ../../api.rst:937 +#: ../../api.rst:938 msgid "The deleted message." msgstr "削除されたメッセージ。" -#: ../../api.rst:942 +#: ../../api.rst:943 msgid "Called when messages are bulk deleted. If none of the messages deleted are found in the internal message cache, then this event will not be called. If individual messages were not found in the internal message cache, this event will still be called, but the messages not found will not be included in the messages list. Messages might not be in cache if the message is too old or the client is participating in high traffic guilds." msgstr "メッセージが一括削除されたときに呼び出されます。メッセージが内部のメッセージキャッシュに見つからない場合、このイベントは呼び出されません。個々のメッセージが見つからない場合でも、このイベントは呼び出されますが、見つからなかったメッセージはメッセージのリストに含まれません。これはメッセージが古すぎるか、クライアントが通信の多いギルドに参加している場合に発生します。" -#: ../../api.rst:949 +#: ../../api.rst:950 msgid "If this occurs increase the :class:`max_messages ` parameter or use the :func:`on_raw_bulk_message_delete` event instead." msgstr "発生する場合は :class:`max_messages ` パラメータの値を増加させるか :func:`on_raw_bulk_message_delete` イベントを使用してください。" -#: ../../api.rst:954 +#: ../../api.rst:955 msgid "The messages that have been deleted." msgstr "削除されたメッセージのリスト。" -#: ../../api.rst:959 +#: ../../api.rst:960 msgid "Called when a message is edited. Unlike :func:`on_message_edit`, this is called regardless of the state of the internal message cache." msgstr "メッセージが編集されたときに呼び出されます。 :func:`on_message_edit` とは異なり、これは内部のメッセージキャッシュの状態に関係なく呼び出されます。" -#: ../../api.rst:962 +#: ../../api.rst:963 msgid "If the message is found in the message cache, it can be accessed via :attr:`RawMessageUpdateEvent.cached_message`. The cached message represents the message before it has been edited. For example, if the content of a message is modified and triggers the :func:`on_raw_message_edit` coroutine, the :attr:`RawMessageUpdateEvent.cached_message` will return a :class:`Message` object that represents the message before the content was modified." msgstr "メッセージがメッセージキャッシュに存在した場合、 :attr:`RawMessageUpdateEvent.cached_message` を介してそのメッセージにアクセスすることができます。キャッシュされていたメッセージは編集前のメッセージです。たとえば、メッセージの内容が編集され、 :func:`on_raw_message_edit` が発火された場合、 :attr:`RawMessageUpdateEvent.cached_message` は内容が編集される前の情報を持つ :class:`Message` オブジェクトを返します。" -#: ../../api.rst:968 +#: ../../api.rst:969 msgid "Due to the inherently raw nature of this event, the data parameter coincides with the raw data given by the :ddocs:`gateway `." msgstr "このイベントの性質は、本質的に生表現のため、データのパラメータは :ddocs:`ゲートウェイ ` によって与えられた生データと一致します。" -#: ../../api.rst:971 +#: ../../api.rst:972 msgid "Since the data payload can be partial, care must be taken when accessing stuff in the dictionary. One example of a common case of partial data is when the ``'content'`` key is inaccessible. This denotes an \"embed\" only edit, which is an edit in which only the embeds are updated by the Discord embed server." msgstr "データのペイロードが部分的であるため、データにアクセスするときは気をつけてください。部分的なデータの主な場合のひとつは、``'content'`` にアクセスできない場合です。Discordの埋め込みサーバーによって、埋め込みが更新される、\"埋め込み\"しか変わっていない編集がそうです。" -#: ../../api.rst:984 +#: ../../api.rst:985 msgid "Called when a message is deleted. Unlike :func:`on_message_delete`, this is called regardless of the message being in the internal message cache or not." msgstr "メッセージが削除されたときに呼び出されます。 :func:`on_message_delete` とは異なり、削除されたメッセージが内部キャッシュに存在するか否かにかかわらず呼び出されます。" -#: ../../api.rst:987 +#: ../../api.rst:988 msgid "If the message is found in the message cache, it can be accessed via :attr:`RawMessageDeleteEvent.cached_message`" msgstr "メッセージがメッセージキャッシュ内に見つかった場合、 :attr:`RawMessageDeleteEvent.cached_message` を介してアクセスすることができます。" -#: ../../api.rst:997 +#: ../../api.rst:998 msgid "Called when a bulk delete is triggered. Unlike :func:`on_bulk_message_delete`, this is called regardless of the messages being in the internal message cache or not." msgstr "メッセージが一括削除されたときに呼び出されます。 :func:`on_bulk_message_delete` とは異なり、削除されたメッセージが内部キャッシュに存在するか否かにかかわらず呼び出されます。" -#: ../../api.rst:1000 +#: ../../api.rst:1001 msgid "If the messages are found in the message cache, they can be accessed via :attr:`RawBulkMessageDeleteEvent.cached_messages`" msgstr "メッセージがメッセージキャッシュ内に見つかった場合、 :attr:`RawBulkMessageDeleteEvent.cached_messages` を介してアクセスすることができます。" -#: ../../api.rst:1009 +#: ../../api.rst:1010 msgid "Reactions" msgstr "Reactions" -#: ../../api.rst:1013 +#: ../../api.rst:1014 msgid "Called when a message has a reaction added to it. Similar to :func:`on_message_edit`, if the message is not found in the internal message cache, then this event will not be called. Consider using :func:`on_raw_reaction_add` instead." msgstr "メッセージにリアクションが追加されたときに呼び出されます。 :func:`on_message_edit` と同様に内部メッセージキャッシュにメッセージが見つからない場合は、このイベントは呼び出されません。代わりに :func:`on_raw_reaction_add` の利用を検討してください。" -#: ../../api.rst:1019 +#: ../../api.rst:1020 msgid "To get the :class:`Message` being reacted, access it via :attr:`Reaction.message`." msgstr "リアクションの付いた :class:`Message` を取得するには、 :attr:`Reaction.message` を使ってください。" -#: ../../api.rst:1021 -#: ../../api.rst:1064 -#: ../../api.rst:1077 -#: ../../api.rst:1090 -#: ../../api.rst:1100 +#: ../../api.rst:1022 +#: ../../api.rst:1065 +#: ../../api.rst:1078 +#: ../../api.rst:1091 +#: ../../api.rst:1101 msgid "This requires :attr:`Intents.reactions` to be enabled." msgstr ":attr:`Intents.reactions` を有効にする必要があります。" -#: ../../api.rst:1025 +#: ../../api.rst:1026 msgid "This doesn't require :attr:`Intents.members` within a guild context, but due to Discord not providing updated user information in a direct message it's required for direct messages to receive this event. Consider using :func:`on_raw_reaction_add` if you need this and do not otherwise want to enable the members intent." msgstr "ギルド内では :attr:`Intents.members` は有効にしなくてもよいですが、DiscordがDM内では更新されたユーザーの情報を提供しないため、DMではこのインテントが必要です。 このイベントが必要でメンバーインテントを有効化したくない場合は :func:`on_raw_reaction_add` の使用を検討してください。" -#: ../../api.rst:1031 -#: ../../api.rst:1053 +#: ../../api.rst:1032 +#: ../../api.rst:1054 msgid "The current state of the reaction." msgstr "リアクションの現在の状態。" -#: ../../api.rst:1033 +#: ../../api.rst:1034 msgid "The user who added the reaction." msgstr "リアクションを追加したユーザー。" -#: ../../api.rst:1038 +#: ../../api.rst:1039 msgid "Called when a message has a reaction removed from it. Similar to on_message_edit, if the message is not found in the internal message cache, then this event will not be called." msgstr "メッセージのリアクションが取り除かれたときに呼び出されます。on_message_editのように、内部のメッセージキャッシュにメッセージがないときには、このイベントは呼び出されません。" -#: ../../api.rst:1044 +#: ../../api.rst:1045 msgid "To get the message being reacted, access it via :attr:`Reaction.message`." msgstr "リアクションの付いたメッセージを取得するには、 :attr:`Reaction.message` を使ってください。" -#: ../../api.rst:1046 +#: ../../api.rst:1047 msgid "This requires both :attr:`Intents.reactions` and :attr:`Intents.members` to be enabled." msgstr "これを使用するには :attr:`Intents.reactions` と :attr:`Intents.members` の両方を有効にしないといけません。" -#: ../../api.rst:1050 +#: ../../api.rst:1051 msgid "Consider using :func:`on_raw_reaction_remove` if you need this and do not want to enable the members intent." msgstr "このイベントが必要でメンバーインテントを有効化したくない場合は :func:`on_raw_reaction_remove` の使用を検討してください。" -#: ../../api.rst:1055 +#: ../../api.rst:1056 msgid "The user whose reaction was removed." msgstr "リアクションが除去されたユーザー。" -#: ../../api.rst:1060 +#: ../../api.rst:1061 msgid "Called when a message has all its reactions removed from it. Similar to :func:`on_message_edit`, if the message is not found in the internal message cache, then this event will not be called. Consider using :func:`on_raw_reaction_clear` instead." msgstr "メッセージからすべてのリアクションが削除されたときに呼び出されます。 :func:`on_message_edit` と同様に内部メッセージキャッシュにメッセージが見つからない場合は、このイベントは呼び出されません。代わりに :func:`on_raw_reaction_clear` の利用を検討してください。" -#: ../../api.rst:1066 +#: ../../api.rst:1067 msgid "The message that had its reactions cleared." msgstr "リアクションが削除されたメッセージ。" -#: ../../api.rst:1068 +#: ../../api.rst:1069 msgid "The reactions that were removed." msgstr "除去されたリアクション。" -#: ../../api.rst:1073 +#: ../../api.rst:1074 msgid "Called when a message has a specific reaction removed from it. Similar to :func:`on_message_edit`, if the message is not found in the internal message cache, then this event will not be called. Consider using :func:`on_raw_reaction_clear_emoji` instead." msgstr "メッセージから特定の絵文字のリアクションが除去されたときに呼び出されます。 :func:`on_message_edit` と同様に内部メッセージキャッシュにメッセージが見つからない場合は、このイベントは呼び出されません。代わりに :func:`on_raw_reaction_clear_emoji` の利用を検討してください。" -#: ../../api.rst:1081 +#: ../../api.rst:1082 msgid "The reaction that got cleared." msgstr "除去されたリアクション。" -#: ../../api.rst:1087 +#: ../../api.rst:1088 msgid "Called when a message has a reaction added. Unlike :func:`on_reaction_add`, this is called regardless of the state of the internal message cache." msgstr "メッセージにリアクションが追加されたときに呼び出されます。 :func:`on_reaction_add` とは異なり、これは内部のメッセージキャッシュの状態に関係なく呼び出されます。" -#: ../../api.rst:1097 +#: ../../api.rst:1098 msgid "Called when a message has a reaction removed. Unlike :func:`on_reaction_remove`, this is called regardless of the state of the internal message cache." msgstr "メッセージからリアクションが削除されたときに呼び出されます。 :func:`on_reaction_remove` とは異なり、これは内部メッセージキャッシュの状態に関係なく呼び出されます。" -#: ../../api.rst:1107 +#: ../../api.rst:1108 msgid "Called when a message has all its reactions removed. Unlike :func:`on_reaction_clear`, this is called regardless of the state of the internal message cache." msgstr "メッセージからリアクションがすべて削除されたときに呼び出されます。 :func:`on_reaction_clear` とは異なり、これは内部メッセージキャッシュの状態に関係なく呼び出されます。" -#: ../../api.rst:1117 +#: ../../api.rst:1118 msgid "Called when a message has a specific reaction removed from it. Unlike :func:`on_reaction_clear_emoji` this is called regardless of the state of the internal message cache." msgstr "メッセージから特定の絵文字のリアクションがすべて除去されたときに呼び出されます。 :func:`on_reaction_clear_emoji` とは異なり、これは内部メッセージキャッシュの状態に関係なく呼び出されます。" -#: ../../api.rst:1129 +#: ../../api.rst:1130 msgid "Roles" msgstr "Roles" -#: ../../api.rst:1134 +#: ../../api.rst:1135 msgid "Called when a :class:`Guild` creates or deletes a new :class:`Role`." msgstr ":class:`Guild` で :class:`Role` が新しく作成されたか、削除されたときに呼び出されます。" -#: ../../api.rst:1136 +#: ../../api.rst:1137 msgid "To get the guild it belongs to, use :attr:`Role.guild`." msgstr "ギルドを取得するには :attr:`Role.guild` を使用してください。" -#: ../../api.rst:1140 +#: ../../api.rst:1141 msgid "The role that was created or deleted." msgstr "作成、または削除されたロール。" -#: ../../api.rst:1145 +#: ../../api.rst:1146 msgid "Called when a :class:`Role` is changed guild-wide." msgstr ":class:`Role` がギルド全体で変更されたときに呼び出されます。" -#: ../../api.rst:1149 +#: ../../api.rst:1150 msgid "The updated role's old info." msgstr "更新されたロールの更新前情報。" -#: ../../api.rst:1151 +#: ../../api.rst:1152 msgid "The updated role's updated info." msgstr "更新されたロールの更新後情報。" -#: ../../api.rst:1156 +#: ../../api.rst:1157 msgid "Scheduled Events" msgstr "Scheduled Events" -#: ../../api.rst:1161 +#: ../../api.rst:1162 msgid "Called when a :class:`ScheduledEvent` is created or deleted." msgstr ":class:`ScheduledEvent` が作成または削除されたときに呼び出されます。" -#: ../../api.rst:1163 -#: ../../api.rst:1174 -#: ../../api.rst:1196 +#: ../../api.rst:1164 +#: ../../api.rst:1175 +#: ../../api.rst:1197 msgid "This requires :attr:`Intents.guild_scheduled_events` to be enabled." msgstr ":attr:`Intents.guild_scheduled_events` を有効にする必要があります。" -#: ../../api.rst:1167 +#: ../../api.rst:1168 msgid "The scheduled event that was created or deleted." msgstr "作成、または削除されたスケジュールイベント。" -#: ../../api.rst:1172 +#: ../../api.rst:1173 msgid "Called when a :class:`ScheduledEvent` is updated." msgstr ":class:`ScheduledEvent` が変更されたときに呼び出されます。" -#: ../../api.rst:1176 -#: ../../api.rst:1223 -#: ../../api.rst:1375 +#: ../../api.rst:1177 +#: ../../api.rst:1224 +#: ../../api.rst:1376 msgid "The following, but not limited to, examples illustrate when this event is called:" msgstr "これらの場合に限りませんが、例を挙げると、以下の場合に呼び出されます:" -#: ../../api.rst:1178 +#: ../../api.rst:1179 msgid "The scheduled start/end times are changed." msgstr "スケジュールされた開始・終了時刻が変更された。" -#: ../../api.rst:1179 +#: ../../api.rst:1180 msgid "The channel is changed." msgstr "チャンネルが変更された時。" -#: ../../api.rst:1180 +#: ../../api.rst:1181 msgid "The description is changed." msgstr "説明が変更された時。" -#: ../../api.rst:1181 +#: ../../api.rst:1182 msgid "The status is changed." msgstr "ステータスが変更された時。" -#: ../../api.rst:1182 +#: ../../api.rst:1183 msgid "The image is changed." msgstr "画像が変更された時。" -#: ../../api.rst:1186 +#: ../../api.rst:1187 msgid "The scheduled event before the update." msgstr "変更前のスケジュールイベント。" -#: ../../api.rst:1188 +#: ../../api.rst:1189 msgid "The scheduled event after the update." msgstr "変更後のスケジュールイベント。" -#: ../../api.rst:1194 +#: ../../api.rst:1195 msgid "Called when a user is added or removed from a :class:`ScheduledEvent`." msgstr ":class:`ScheduledEvent` からユーザーが追加または削除されたときに呼び出されます。" -#: ../../api.rst:1200 +#: ../../api.rst:1201 msgid "The scheduled event that the user was added or removed from." msgstr "ユーザーが追加または削除されたスケジュールイベント。" -#: ../../api.rst:1202 +#: ../../api.rst:1203 msgid "The user that was added or removed." msgstr "追加・削除されたユーザー。" -#: ../../api.rst:1207 +#: ../../api.rst:1208 msgid "Stages" msgstr "Stages" -#: ../../api.rst:1212 +#: ../../api.rst:1213 msgid "Called when a :class:`StageInstance` is created or deleted for a :class:`StageChannel`." msgstr ":class:`StageChannel` の :class:`StageInstance` が作成または削除されたときに呼び出されます。" -#: ../../api.rst:1216 +#: ../../api.rst:1217 msgid "The stage instance that was created or deleted." msgstr "作成、または削除されたステージインスタンス。" -#: ../../api.rst:1221 +#: ../../api.rst:1222 msgid "Called when a :class:`StageInstance` is updated." msgstr ":class:`StageInstance` が変更されたときに呼び出されます。" -#: ../../api.rst:1225 +#: ../../api.rst:1226 msgid "The topic is changed." msgstr "トピックが変更された時。" -#: ../../api.rst:1226 +#: ../../api.rst:1227 msgid "The privacy level is changed." msgstr "プライバシーレベルが変更された時。" -#: ../../api.rst:1230 +#: ../../api.rst:1231 msgid "The stage instance before the update." msgstr "更新前のステージインスタンス。" -#: ../../api.rst:1232 +#: ../../api.rst:1233 msgid "The stage instance after the update." msgstr "更新後のステージインスタンス。" -#: ../../api.rst:1236 +#: ../../api.rst:1237 msgid "Threads" msgstr "Threads" -#: ../../api.rst:1240 +#: ../../api.rst:1241 msgid "Called whenever a thread is created." msgstr "スレッドが作成されたときに発生します。" -#: ../../api.rst:1242 -#: ../../api.rst:1255 -#: ../../api.rst:1285 -#: ../../api.rst:1309 +#: ../../api.rst:1243 +#: ../../api.rst:1256 +#: ../../api.rst:1286 +#: ../../api.rst:1310 msgid "Note that you can get the guild from :attr:`Thread.guild`." msgstr "ギルドは :attr:`Thread.guild` から取得できます。" -#: ../../api.rst:1248 +#: ../../api.rst:1249 msgid "The thread that was created." msgstr "作成されたスレッド。" -#: ../../api.rst:1253 +#: ../../api.rst:1254 msgid "Called whenever a thread is joined." msgstr "スレッドに参加したときに呼び出されます。" -#: ../../api.rst:1261 +#: ../../api.rst:1262 msgid "The thread that got joined." msgstr "参加したスレッド。" -#: ../../api.rst:1266 +#: ../../api.rst:1267 msgid "Called whenever a thread is updated. If the thread could not be found in the internal cache this event will not be called. Threads will not be in the cache if they are archived." msgstr "スレッドが更新されたときに呼び出されます。スレッドが内部キャッシュに見つからなかった場合、このイベントは呼び出されません。 スレッドがアーカイブされている場合、キャッシュには含まれません。" -#: ../../api.rst:1270 +#: ../../api.rst:1271 msgid "If you need this information use :func:`on_raw_thread_update` instead." msgstr "この情報が必要な場合は、代わりに :func:`on_raw_thread_update` を使用してください。" -#: ../../api.rst:1276 +#: ../../api.rst:1277 msgid "The updated thread's old info." msgstr "古いスレッドの情報。" -#: ../../api.rst:1278 +#: ../../api.rst:1279 msgid "The updated thread's new info." msgstr "新しいスレッドの情報。" -#: ../../api.rst:1283 +#: ../../api.rst:1284 msgid "Called whenever a thread is removed. This is different from a thread being deleted." msgstr "スレッドが除去されたときに呼び出されます。これはスレッドの削除とは異なります。" -#: ../../api.rst:1291 +#: ../../api.rst:1292 msgid "Due to technical limitations, this event might not be called as soon as one expects. Since the library tracks thread membership locally, the API only sends updated thread membership status upon being synced by joining a thread." msgstr "技術的な制約のためこのイベントは期待通りの早さで呼び出されない場合があります。ライブラリーがスレッドの参加をローカルで追跡するため、APIは更新されたスレッドの参加状態をスレッドの参加時にのみ同期します。" -#: ../../api.rst:1298 +#: ../../api.rst:1299 msgid "The thread that got removed." msgstr "削除されたスレッド。" -#: ../../api.rst:1303 +#: ../../api.rst:1304 msgid "Called whenever a thread is deleted. If the thread could not be found in the internal cache this event will not be called. Threads will not be in the cache if they are archived." msgstr "スレッドが削除されたときに呼び出されます。スレッドが内部キャッシュに見つからなかった場合、このイベントは呼び出されません。 スレッドがアーカイブされている場合、キャッシュには含まれません。" -#: ../../api.rst:1307 +#: ../../api.rst:1308 msgid "If you need this information use :func:`on_raw_thread_delete` instead." msgstr "この情報が必要な場合は、代わりに :func:`on_raw_thread_delete` を使用してください。" -#: ../../api.rst:1315 +#: ../../api.rst:1316 msgid "The thread that got deleted." msgstr "削除されたスレッド。" -#: ../../api.rst:1320 +#: ../../api.rst:1321 msgid "Called whenever a thread is updated. Unlike :func:`on_thread_update` this is called regardless of the thread being in the internal thread cache or not." msgstr "スレッドが更新されたときに呼び出されます。 :func:`on_thread_update` とは異なり、更新されたスレッドが内部キャッシュに存在するか否かにかかわらず呼び出されます。" -#: ../../api.rst:1332 +#: ../../api.rst:1333 msgid "Called whenever a thread is deleted. Unlike :func:`on_thread_delete` this is called regardless of the thread being in the internal thread cache or not." msgstr "スレッドが削除されたときに呼び出されます。 :func:`on_thread_delete` とは異なり、削除されたスレッドが内部キャッシュに存在するか否かにかかわらず呼び出されます。" -#: ../../api.rst:1345 +#: ../../api.rst:1346 msgid "Called when a :class:`ThreadMember` leaves or joins a :class:`Thread`." msgstr ":class:`ThreadMember` が :class:`Thread` に参加したり退出したりしたときに呼び出されます。" -#: ../../api.rst:1347 +#: ../../api.rst:1348 msgid "You can get the thread a member belongs in by accessing :attr:`ThreadMember.thread`." msgstr "メンバーが所属するスレッドは :attr:`ThreadMember.thread` から取得できます。" -#: ../../api.rst:1353 +#: ../../api.rst:1354 msgid "The member who joined or left." msgstr "参加、または脱退したメンバー。" -#: ../../api.rst:1358 +#: ../../api.rst:1359 msgid "Called when a :class:`ThreadMember` leaves a :class:`Thread`. Unlike :func:`on_thread_member_remove` this is called regardless of the member being in the internal thread's members cache or not." msgstr ":class:`ThreadMember` が :class:`Thread` を退出したときに呼び出されます。 :func:`on_thread_member_remove` とは異なり、メンバーが内部スレッドメンバーキャッシュに存在するかどうかに関係なく呼び出されます。" -#: ../../api.rst:1369 +#: ../../api.rst:1370 msgid "Voice" msgstr "Voice" -#: ../../api.rst:1373 +#: ../../api.rst:1374 msgid "Called when a :class:`Member` changes their :class:`VoiceState`." msgstr ":class:`Member` が :class:`VoiceState` を変更したとき呼び出されます。" -#: ../../api.rst:1377 +#: ../../api.rst:1378 msgid "A member joins a voice or stage channel." msgstr "メンバーがボイスチャンネルやステージチャンネルに参加したとき。" -#: ../../api.rst:1378 +#: ../../api.rst:1379 msgid "A member leaves a voice or stage channel." msgstr "メンバーがボイスチャンネルやステージチャンネルから退出したとき。" -#: ../../api.rst:1379 +#: ../../api.rst:1380 msgid "A member is muted or deafened by their own accord." msgstr "メンバーが自身でマイクやスピーカーをミュートしたとき。" -#: ../../api.rst:1380 +#: ../../api.rst:1381 msgid "A member is muted or deafened by a guild administrator." msgstr "メンバーがギルドの管理者によってマイクやスピーカーをミュートされたとき。" -#: ../../api.rst:1382 +#: ../../api.rst:1383 msgid "This requires :attr:`Intents.voice_states` to be enabled." msgstr ":attr:`Intents.voice_states` を有効にする必要があります。" -#: ../../api.rst:1384 +#: ../../api.rst:1385 msgid "The member whose voice states changed." msgstr "ボイスの状態が変わった `Member` 。" -#: ../../api.rst:1386 +#: ../../api.rst:1387 msgid "The voice state prior to the changes." msgstr "更新前のボイス状態。" -#: ../../api.rst:1388 +#: ../../api.rst:1389 msgid "The voice state after the changes." msgstr "更新後のボイス状態。" -#: ../../api.rst:1394 +#: ../../api.rst:1395 msgid "Utility Functions" msgstr "ユーティリティ関数" @@ -4125,15 +4152,15 @@ msgstr "メンションをエスケープするテキスト。" msgid "The text with the mentions removed." msgstr "メンションが削除されたテキスト。" -#: ../../api.rst:1418 +#: ../../api.rst:1419 msgid "A data class which represents a resolved invite returned from :func:`discord.utils.resolve_invite`." msgstr ":func:`discord.utils.resolve_invite` から返された解決済みの招待を表すデータクラス。" -#: ../../api.rst:1422 +#: ../../api.rst:1423 msgid "The invite code." msgstr "招待コード。" -#: ../../api.rst:1428 +#: ../../api.rst:1429 msgid "The id of the scheduled event that the invite refers to." msgstr "招待が参照するスケジュールイベントのID。" @@ -4215,8 +4242,8 @@ msgid "Example Output" msgstr "出力例" #: ../../../discord/utils.py:docstring of discord.utils.format_dt:6 -#: ../../api.rst:3315 -#: ../../api.rst:3335 +#: ../../api.rst:3370 +#: ../../api.rst:3390 msgid "Description" msgstr "説明" @@ -4344,1872 +4371,1934 @@ msgstr "指定されたサイズのチャンクを生成する新しいイテレ msgid "Union[:class:`Iterator`, :class:`AsyncIterator`]" msgstr "Union[:class:`Iterator`, :class:`AsyncIterator`]" -#: ../../api.rst:1447 +#: ../../api.rst:1448 msgid "A type safe sentinel used in the library to represent something as missing. Used to distinguish from ``None`` values." msgstr "ライブラリで見つからないものを表現するために使用されるタイプセーフなセンチネル型。 ``None`` 値と区別するために使用されます。" -#: ../../api.rst:1454 +#: ../../api.rst:1455 msgid "Enumerations" msgstr "列挙型" -#: ../../api.rst:1456 +#: ../../api.rst:1457 msgid "The API provides some enumerations for certain types of strings to avoid the API from being stringly typed in case the strings change in the future." msgstr "APIは、文字列が将来変わることに備え、文字列を直書きするのを防ぐために、いくらかの文字列の列挙型を提供します。" -#: ../../api.rst:1459 +#: ../../api.rst:1460 msgid "All enumerations are subclasses of an internal class which mimics the behaviour of :class:`enum.Enum`." msgstr "列挙型はすべて :class:`enum.Enum` の動作を模倣した内部クラスのサブクラスです。" -#: ../../api.rst:1464 +#: ../../api.rst:1465 msgid "Specifies the type of channel." msgstr "特定チャンネルのチャンネルタイプ。" -#: ../../api.rst:1468 +#: ../../api.rst:1469 msgid "A text channel." msgstr "テキストチャンネル。" -#: ../../api.rst:1471 +#: ../../api.rst:1472 msgid "A voice channel." msgstr "ボイスチャンネル。" -#: ../../api.rst:1474 +#: ../../api.rst:1475 msgid "A private text channel. Also called a direct message." msgstr "プライベートのテキストチャンネル。ダイレクトメッセージとも呼ばれています。" -#: ../../api.rst:1477 +#: ../../api.rst:1478 msgid "A private group text channel." msgstr "プライベートのグループDM。" -#: ../../api.rst:1480 +#: ../../api.rst:1481 msgid "A category channel." msgstr "カテゴリチャンネル。" -#: ../../api.rst:1483 +#: ../../api.rst:1484 msgid "A guild news channel." msgstr "ギルドのニュースチャンネル。" -#: ../../api.rst:1487 +#: ../../api.rst:1488 msgid "A guild stage voice channel." msgstr "ギルドのステージボイスチャンネル。" -#: ../../api.rst:1493 +#: ../../api.rst:1494 msgid "A news thread" msgstr "ニューススレッド。" -#: ../../api.rst:1499 +#: ../../api.rst:1500 msgid "A public thread" msgstr "パブリックスレッド。" -#: ../../api.rst:1505 +#: ../../api.rst:1506 msgid "A private thread" msgstr "プライベートスレッド。" -#: ../../api.rst:1511 +#: ../../api.rst:1512 msgid "A forum channel." msgstr "フォーラムチャンネル。" -#: ../../api.rst:1517 +#: ../../api.rst:1518 msgid "Specifies the type of :class:`Message`. This is used to denote if a message is to be interpreted as a system message or a regular message." msgstr ":class:`Message` のタイプを指定します。これは、メッセージが通常のものかシステムメッセージかを判断するのに使用できます。" -#: ../../api.rst:1524 +#: ../../api.rst:1525 #: ../../../discord/message.py:docstring of discord.message.Message:7 msgid "Checks if two messages are equal." msgstr "二つのメッセージが等しいかを比較します。" -#: ../../api.rst:1527 +#: ../../api.rst:1528 #: ../../../discord/message.py:docstring of discord.message.Message:11 msgid "Checks if two messages are not equal." msgstr "二つのメッセージが等しくないかを比較します。" -#: ../../api.rst:1531 +#: ../../api.rst:1532 msgid "The default message type. This is the same as regular messages." msgstr "デフォルトのメッセージ。これは通常のメッセージと同じです。" -#: ../../api.rst:1534 +#: ../../api.rst:1535 msgid "The system message when a user is added to a group private message or a thread." msgstr "ユーザーがグループプライベートメッセージまたはスレッドに追加されたときのシステムメッセージ。" -#: ../../api.rst:1538 +#: ../../api.rst:1539 msgid "The system message when a user is removed from a group private message or a thread." msgstr "ユーザーがグループプライベートメッセージまたはスレッドから削除されたときのシステムメッセージ。" -#: ../../api.rst:1542 +#: ../../api.rst:1543 msgid "The system message denoting call state, e.g. missed call, started call, etc." msgstr "通話の状態を示すシステムメッセージ。例: 不在着信、通話の開始、その他。" -#: ../../api.rst:1546 +#: ../../api.rst:1547 msgid "The system message denoting that a channel's name has been changed." msgstr "チャンネル名の変更を示すシステムメッセージ。" -#: ../../api.rst:1549 +#: ../../api.rst:1550 msgid "The system message denoting that a channel's icon has been changed." msgstr "チャンネルのアイコンの変更を示すシステムメッセージ。" -#: ../../api.rst:1552 +#: ../../api.rst:1553 msgid "The system message denoting that a pinned message has been added to a channel." msgstr "ピン留めの追加を示すシステムメッセージ。" -#: ../../api.rst:1555 +#: ../../api.rst:1556 msgid "The system message denoting that a new member has joined a Guild." msgstr "ギルドの新規メンバーの参加を示すシステムメッセージ。" -#: ../../api.rst:1559 +#: ../../api.rst:1560 msgid "The system message denoting that a member has \"nitro boosted\" a guild." msgstr "メンバーがギルドを「ニトロブースト」したことを表すシステムメッセージ。" -#: ../../api.rst:1562 +#: ../../api.rst:1563 msgid "The system message denoting that a member has \"nitro boosted\" a guild and it achieved level 1." msgstr "メンバーがギルドを「ニトロブースト」し、それによってギルドがレベル1に到達したことを表すシステムメッセージ。" -#: ../../api.rst:1566 +#: ../../api.rst:1567 msgid "The system message denoting that a member has \"nitro boosted\" a guild and it achieved level 2." msgstr "メンバーがギルドを「ニトロブースト」し、それによってギルドがレベル2に到達したことを表すシステムメッセージ。" -#: ../../api.rst:1570 +#: ../../api.rst:1571 msgid "The system message denoting that a member has \"nitro boosted\" a guild and it achieved level 3." msgstr "メンバーがギルドを「ニトロブースト」し、それによってギルドがレベル3に到達したことを表すシステムメッセージ。" -#: ../../api.rst:1574 +#: ../../api.rst:1575 msgid "The system message denoting that an announcement channel has been followed." msgstr "アナウンスチャンネルがフォローされたことを表すシステムメッセージ。" -#: ../../api.rst:1579 +#: ../../api.rst:1580 msgid "The system message denoting that a member is streaming in the guild." msgstr "メンバーがギルドでストリーミングしていることを表すシステムメッセージ。" -#: ../../api.rst:1584 +#: ../../api.rst:1585 msgid "The system message denoting that the guild is no longer eligible for Server Discovery." msgstr "ギルドがサーバー発見の資格を持たなくなったことを示すシステムメッセージ。" -#: ../../api.rst:1590 +#: ../../api.rst:1591 msgid "The system message denoting that the guild has become eligible again for Server Discovery." msgstr "ギルドがサーバー発見の資格を再び持ったことを示すシステムメッセージ。" -#: ../../api.rst:1596 +#: ../../api.rst:1597 msgid "The system message denoting that the guild has failed to meet the Server Discovery requirements for one week." msgstr "ギルドが1週間サーバー発見の要件を満たすことに失敗したことを示すシステムメッセージ。" -#: ../../api.rst:1602 +#: ../../api.rst:1603 msgid "The system message denoting that the guild has failed to meet the Server Discovery requirements for 3 weeks in a row." msgstr "ギルドが連続で3週間サーバー発見の要件を満たすことに失敗したというシステムメッセージ。" -#: ../../api.rst:1608 +#: ../../api.rst:1609 msgid "The system message denoting that a thread has been created. This is only sent if the thread has been created from an older message. The period of time required for a message to be considered old cannot be relied upon and is up to Discord." msgstr "スレッドが作成されたことを示すシステムメッセージ。これはスレッドが古いメッセージから作成されたときにのみ送信されます。メッセージが古いものとされる時間の閾値は信頼できずDiscord次第です。" -#: ../../api.rst:1616 +#: ../../api.rst:1617 msgid "The system message denoting that the author is replying to a message." msgstr "送信者がメッセージに返信したことを示すシステムメッセージ。" -#: ../../api.rst:1621 +#: ../../api.rst:1622 msgid "The system message denoting that a slash command was executed." msgstr "スラッシュコマンドを実行したことを示すシステムメッセージ。" -#: ../../api.rst:1626 +#: ../../api.rst:1627 msgid "The system message sent as a reminder to invite people to the guild." msgstr "人々をギルドに招待することのリマインダーとして送信されたシステムメッセージ。" -#: ../../api.rst:1631 +#: ../../api.rst:1632 msgid "The system message denoting the message in the thread that is the one that started the thread's conversation topic." msgstr "スレッドの会話を始めたメッセージであるスレッド内のメッセージを示すシステムメッセージ。" -#: ../../api.rst:1637 +#: ../../api.rst:1638 msgid "The system message denoting that a context menu command was executed." msgstr "コンテキストメニューコマンドを実行したことを示すシステムメッセージ。" -#: ../../api.rst:1642 +#: ../../api.rst:1643 msgid "The system message sent when an AutoMod rule is triggered. This is only sent if the rule is configured to sent an alert when triggered." msgstr "自動管理ルールが発動されたときに送信されるシステムメッセージ。ルールが発動されたときにアラートを送信するように設定されている場合にのみ送信されます。" -#: ../../api.rst:1648 +#: ../../api.rst:1649 msgid "The system message sent when a user purchases or renews a role subscription." msgstr "ユーザーがロールサブスクリプションを購入または更新したときに送信されるシステムメッセージ。" -#: ../../api.rst:1653 +#: ../../api.rst:1654 msgid "The system message sent when a user is given an advertisement to purchase a premium tier for an application during an interaction." msgstr "ユーザーに対し、インタラクション中にアプリケーションのプレミアム版を購入する広告を表示するときに送信されるシステムメッセージ。" -#: ../../api.rst:1659 +#: ../../api.rst:1660 +msgid "The system message sent when the stage starts." +msgstr "" + +#: ../../api.rst:1665 +msgid "The system message sent when the stage ends." +msgstr "" + +#: ../../api.rst:1670 +msgid "The system message sent when the stage speaker changes." +msgstr "" + +#: ../../api.rst:1675 +msgid "The system message sent when a user is requesting to speak by raising their hands." +msgstr "" + +#: ../../api.rst:1680 +msgid "The system message sent when the stage topic changes." +msgstr "" + +#: ../../api.rst:1685 msgid "The system message sent when an application's premium subscription is purchased for the guild." msgstr "アプリケーションのプレミアムサブスクリプションがギルドで購入されたときに送信されるシステムメッセージ。" -#: ../../api.rst:1665 +#: ../../api.rst:1691 msgid "Represents Discord User flags." msgstr "Discordユーザーフラグを表します。" -#: ../../api.rst:1669 +#: ../../api.rst:1695 msgid "The user is a Discord Employee." msgstr "ユーザーはDiscordの従業員です。" -#: ../../api.rst:1672 +#: ../../api.rst:1698 msgid "The user is a Discord Partner." msgstr "ユーザーはDiscordパートナーです。" -#: ../../api.rst:1675 +#: ../../api.rst:1701 msgid "The user is a HypeSquad Events member." msgstr "ユーザーはHypeSquad Eventsメンバーです。" -#: ../../api.rst:1678 +#: ../../api.rst:1704 msgid "The user is a Bug Hunter." msgstr "ユーザーはバグハンターです。" -#: ../../api.rst:1681 +#: ../../api.rst:1707 msgid "The user has SMS recovery for Multi Factor Authentication enabled." msgstr "ユーザーの多要素認証のSMSリカバリーが有効になっています。" -#: ../../api.rst:1684 +#: ../../api.rst:1710 msgid "The user has dismissed the Discord Nitro promotion." msgstr "ユーザーはDiscord Nitroプロモーションを無視しました。" -#: ../../api.rst:1687 +#: ../../api.rst:1713 msgid "The user is a HypeSquad Bravery member." msgstr "ユーザーはHypeSquad Braveryのメンバーです。" -#: ../../api.rst:1690 +#: ../../api.rst:1716 msgid "The user is a HypeSquad Brilliance member." msgstr "ユーザーはHypeSquad Brillianceのメンバーです。" -#: ../../api.rst:1693 +#: ../../api.rst:1719 msgid "The user is a HypeSquad Balance member." msgstr "ユーザーはHypeSquad Balanceのメンバーです。" -#: ../../api.rst:1696 +#: ../../api.rst:1722 msgid "The user is an Early Supporter." msgstr "ユーザーは早期サポーターです。" -#: ../../api.rst:1699 +#: ../../api.rst:1725 msgid "The user is a Team User." msgstr "ユーザーはチームユーザーです。" -#: ../../api.rst:1702 +#: ../../api.rst:1728 msgid "The user is a system user (i.e. represents Discord officially)." msgstr "ユーザーはシステムユーザーです。(つまり、Discord公式を表しています)" -#: ../../api.rst:1705 +#: ../../api.rst:1731 msgid "The user has an unread system message." msgstr "ユーザーに未読のシステムメッセージがあります。" -#: ../../api.rst:1708 +#: ../../api.rst:1734 msgid "The user is a Bug Hunter Level 2." msgstr "ユーザーはバグハンターレベル2です。" -#: ../../api.rst:1711 +#: ../../api.rst:1737 msgid "The user is a Verified Bot." msgstr "ユーザーは認証済みボットです。" -#: ../../api.rst:1714 +#: ../../api.rst:1740 msgid "The user is an Early Verified Bot Developer." msgstr "ユーザーは早期認証Botデベロッパーです。" -#: ../../api.rst:1717 +#: ../../api.rst:1743 msgid "The user is a Moderator Programs Alumni." msgstr "ユーザーはモデレータープログラム卒業生です。" -#: ../../api.rst:1720 +#: ../../api.rst:1746 msgid "The user is a bot that only uses HTTP interactions and is shown in the online member list." msgstr "ユーザーはHTTPインタラクションのみを使用し、オンラインメンバーのリストに表示されるボットです。" -#: ../../api.rst:1725 +#: ../../api.rst:1751 msgid "The user is flagged as a spammer by Discord." msgstr "ユーザーはDiscordよりスパマーとフラグ付けされました。" -#: ../../api.rst:1731 +#: ../../api.rst:1757 msgid "The user is an active developer." msgstr "ユーザーはアクティブな開発者です。" -#: ../../api.rst:1737 +#: ../../api.rst:1763 msgid "Specifies the type of :class:`Activity`. This is used to check how to interpret the activity itself." msgstr ":class:`Activity` のタイプを指定します。これはアクティビティをどう解釈するか確認するために使われます。" -#: ../../api.rst:1742 +#: ../../api.rst:1768 msgid "An unknown activity type. This should generally not happen." msgstr "不明なアクティビティタイプ。これは通常起こらないはずです。" -#: ../../api.rst:1745 +#: ../../api.rst:1771 msgid "A \"Playing\" activity type." msgstr "プレイ中のアクティビティタイプ。" -#: ../../api.rst:1748 +#: ../../api.rst:1774 msgid "A \"Streaming\" activity type." msgstr "放送中のアクティビティタイプ。" -#: ../../api.rst:1751 +#: ../../api.rst:1777 msgid "A \"Listening\" activity type." msgstr "再生中のアクティビティタイプ。" -#: ../../api.rst:1754 +#: ../../api.rst:1780 msgid "A \"Watching\" activity type." msgstr "視聴中のアクティビティタイプ。" -#: ../../api.rst:1757 +#: ../../api.rst:1783 msgid "A custom activity type." msgstr "カスタムのアクティビティタイプ。" -#: ../../api.rst:1760 +#: ../../api.rst:1786 msgid "A competing activity type." msgstr "競争中のアクティビティタイプ。" -#: ../../api.rst:1766 +#: ../../api.rst:1792 msgid "Specifies a :class:`Guild`\\'s verification level, which is the criteria in which a member must meet before being able to send messages to the guild." msgstr ":class:`Guild` の認証レベルを指定します。これは、メンバーがギルドにメッセージを送信できるようになるまでの条件です。" -#: ../../api.rst:1775 +#: ../../api.rst:1801 msgid "Checks if two verification levels are equal." msgstr "認証レベルが等しいか確認します。" -#: ../../api.rst:1778 +#: ../../api.rst:1804 msgid "Checks if two verification levels are not equal." msgstr "認証レベルが等しくないか確認します。" -#: ../../api.rst:1781 +#: ../../api.rst:1807 msgid "Checks if a verification level is higher than another." msgstr "認証レベルがあるレベルより厳しいか確認します。" -#: ../../api.rst:1784 +#: ../../api.rst:1810 msgid "Checks if a verification level is lower than another." msgstr "認証レベルがあるレベルより緩いか確認します。" -#: ../../api.rst:1787 +#: ../../api.rst:1813 msgid "Checks if a verification level is higher or equal to another." msgstr "認証レベルがあるレベルと同じ、又は厳しいか確認します。" -#: ../../api.rst:1790 +#: ../../api.rst:1816 msgid "Checks if a verification level is lower or equal to another." msgstr "認証レベルがあるレベルと同じ、又は緩いか確認します。" -#: ../../api.rst:1794 +#: ../../api.rst:1820 msgid "No criteria set." msgstr "無制限。" -#: ../../api.rst:1797 +#: ../../api.rst:1823 msgid "Member must have a verified email on their Discord account." msgstr "メンバーはDiscordアカウントのメール認証を済ませないといけません。" -#: ../../api.rst:1800 +#: ../../api.rst:1826 msgid "Member must have a verified email and be registered on Discord for more than five minutes." msgstr "メンバーはメール認証をし、かつアカウント登録から5分経過しないといけません。" -#: ../../api.rst:1804 +#: ../../api.rst:1830 msgid "Member must have a verified email, be registered on Discord for more than five minutes, and be a member of the guild itself for more than ten minutes." msgstr "メンバーはメール認証をし、Discordのアカウント登録から5分経過し、かつ10分以上ギルドに所属していないといけません。" -#: ../../api.rst:1809 +#: ../../api.rst:1835 msgid "Member must have a verified phone on their Discord account." msgstr "メンバーはDiscordアカウントの電話番号認証を済ませないといけません。" -#: ../../api.rst:1813 +#: ../../api.rst:1839 msgid "Specifies whether a :class:`Guild` has notifications on for all messages or mentions only by default." msgstr ":class:`Guild` の通知対象のデフォルト設定をすべてのメッセージ、またはメンションのみに指定します。" -#: ../../api.rst:1821 +#: ../../api.rst:1847 msgid "Checks if two notification levels are equal." msgstr "通知レベルが等しいか確認します。" -#: ../../api.rst:1824 +#: ../../api.rst:1850 msgid "Checks if two notification levels are not equal." msgstr "通知レベルが等しくないか確認します。" -#: ../../api.rst:1827 +#: ../../api.rst:1853 msgid "Checks if a notification level is higher than another." msgstr "通知レベルがあるレベルより高いか確認します。" -#: ../../api.rst:1830 +#: ../../api.rst:1856 msgid "Checks if a notification level is lower than another." msgstr "通知レベルがあるレベルより低いか確認します。" -#: ../../api.rst:1833 +#: ../../api.rst:1859 msgid "Checks if a notification level is higher or equal to another." msgstr "通知レベルがあるレベルと同じ、又は高いか確認します。" -#: ../../api.rst:1836 +#: ../../api.rst:1862 msgid "Checks if a notification level is lower or equal to another." msgstr "通知レベルがあるレベルと同じ、又は低いか確認します。" -#: ../../api.rst:1840 +#: ../../api.rst:1866 msgid "Members receive notifications for every message regardless of them being mentioned." msgstr "メンバーは、メンションされているかどうかに関わらず、すべてのメッセージの通知を受け取ります。" -#: ../../api.rst:1843 +#: ../../api.rst:1869 msgid "Members receive notifications for messages they are mentioned in." msgstr "メンバーは自分がメンションされているメッセージの通知のみ受け取ります。" -#: ../../api.rst:1847 +#: ../../api.rst:1873 msgid "Specifies a :class:`Guild`\\'s explicit content filter, which is the machine learning algorithms that Discord uses to detect if an image contains pornography or otherwise explicit content." msgstr ":class:`Guild` の不適切な表現のフィルターを指定します。これはDiscordがポルノ画像や不適切な表現を検出するために使用している機械学習アルゴリズムです。" -#: ../../api.rst:1857 +#: ../../api.rst:1883 msgid "Checks if two content filter levels are equal." msgstr "表現のフィルターのレベルが等しいか確認します。" -#: ../../api.rst:1860 +#: ../../api.rst:1886 msgid "Checks if two content filter levels are not equal." msgstr "表現のフィルターのレベルが等しくないか確認します。" -#: ../../api.rst:1863 +#: ../../api.rst:1889 msgid "Checks if a content filter level is higher than another." msgstr "表現のフィルターのレベルが他のレベルより大きいか確認します。" -#: ../../api.rst:1866 +#: ../../api.rst:1892 msgid "Checks if a content filter level is lower than another." msgstr "表現のフィルターのレベルが他のレベルより小さいか確認します。" -#: ../../api.rst:1869 +#: ../../api.rst:1895 msgid "Checks if a content filter level is higher or equal to another." msgstr "表現のフィルターのレベルが他のレベルより大きい、または等しいか確認します。" -#: ../../api.rst:1872 +#: ../../api.rst:1898 msgid "Checks if a content filter level is lower or equal to another." msgstr "表現のフィルターのレベルが他のレベルより小さい、または等しいか確認します。" -#: ../../api.rst:1876 +#: ../../api.rst:1902 msgid "The guild does not have the content filter enabled." msgstr "ギルドで表現のフィルターが有効ではない。" -#: ../../api.rst:1879 +#: ../../api.rst:1905 msgid "The guild has the content filter enabled for members without a role." msgstr "ギルドでロールを持たないメンバーに対して表現のフィルターが有効化されている。" -#: ../../api.rst:1882 +#: ../../api.rst:1908 msgid "The guild has the content filter enabled for every member." msgstr "ギルドで、すべてのメンバーに対して表現のフィルターが有効化されている。" -#: ../../api.rst:1886 +#: ../../api.rst:1912 msgid "Specifies a :class:`Member` 's status." msgstr ":class:`Member` のステータスを指定します。" -#: ../../api.rst:1890 +#: ../../api.rst:1916 msgid "The member is online." msgstr "メンバーがオンライン。" -#: ../../api.rst:1893 +#: ../../api.rst:1919 msgid "The member is offline." msgstr "メンバーがオフライン。" -#: ../../api.rst:1896 +#: ../../api.rst:1922 msgid "The member is idle." msgstr "メンバーが退席中。" -#: ../../api.rst:1899 +#: ../../api.rst:1925 msgid "The member is \"Do Not Disturb\"." msgstr "メンバーが取り込み中。" -#: ../../api.rst:1902 +#: ../../api.rst:1928 msgid "An alias for :attr:`dnd`." msgstr ":attr:`dnd` のエイリアス。" -#: ../../api.rst:1905 +#: ../../api.rst:1931 msgid "The member is \"invisible\". In reality, this is only used when sending a presence a la :meth:`Client.change_presence`. When you receive a user's presence this will be :attr:`offline` instead." msgstr "メンバーがオンライン状態を隠す。実際には、これは :meth:`Client.change_presence` でプレゼンスを送信する時のみ使用します。ユーザーのプレゼンスを受け取った場合、これは :attr:`offline` に置き換えられます。" -#: ../../api.rst:1912 +#: ../../api.rst:1938 msgid "Represents the type of action being done for a :class:`AuditLogEntry`\\, which is retrievable via :meth:`Guild.audit_logs`." msgstr ":class:`AuditLogEntry` で行われた動作の種類を取得します。AuditLogEntryは :meth:`Guild.audit_logs` で取得可能です。" -#: ../../api.rst:1917 +#: ../../api.rst:1943 msgid "The guild has updated. Things that trigger this include:" msgstr "ギルドの更新。このトリガーとなるものは以下のとおりです。" -#: ../../api.rst:1919 +#: ../../api.rst:1945 msgid "Changing the guild vanity URL" msgstr "ギルドのvanity URLの変更" -#: ../../api.rst:1920 +#: ../../api.rst:1946 msgid "Changing the guild invite splash" msgstr "ギルドの招待時のスプラッシュ画像の変更" -#: ../../api.rst:1921 +#: ../../api.rst:1947 msgid "Changing the guild AFK channel or timeout" msgstr "ギルドのAFKチャンネル、またはタイムアウトの変更" -#: ../../api.rst:1922 +#: ../../api.rst:1948 msgid "Changing the guild voice server region" msgstr "ギルドの音声通話のサーバーリージョンの変更" -#: ../../api.rst:1923 +#: ../../api.rst:1949 msgid "Changing the guild icon, banner, or discovery splash" msgstr "ギルドのアイコン、バナー、ディスカバリースプラッシュの変更" -#: ../../api.rst:1924 +#: ../../api.rst:1950 msgid "Changing the guild moderation settings" msgstr "ギルドの管理設定の変更" -#: ../../api.rst:1925 +#: ../../api.rst:1951 msgid "Changing things related to the guild widget" msgstr "ギルドのウィジェットに関連するものの変更" -#: ../../api.rst:1927 +#: ../../api.rst:1953 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`Guild`." msgstr "これが上記のactionならば、:attr:`~AuditLogEntry.target` の型は :class:`Guild` になります。" -#: ../../api.rst:1930 -#: ../../api.rst:1964 -#: ../../api.rst:1983 -#: ../../api.rst:2005 -#: ../../api.rst:2024 +#: ../../api.rst:1956 +#: ../../api.rst:1992 +#: ../../api.rst:2011 +#: ../../api.rst:2036 +#: ../../api.rst:2058 msgid "Possible attributes for :class:`AuditLogDiff`:" msgstr ":class:`AuditLogDiff` から、以下の属性を参照できます:" -#: ../../api.rst:1932 +#: ../../api.rst:1958 msgid ":attr:`~AuditLogDiff.afk_channel`" msgstr ":attr:`~AuditLogDiff.afk_channel`" -#: ../../api.rst:1933 +#: ../../api.rst:1959 msgid ":attr:`~AuditLogDiff.system_channel`" msgstr ":attr:`~AuditLogDiff.system_channel`" -#: ../../api.rst:1934 +#: ../../api.rst:1960 msgid ":attr:`~AuditLogDiff.afk_timeout`" msgstr ":attr:`~AuditLogDiff.afk_timeout`" -#: ../../api.rst:1935 +#: ../../api.rst:1961 msgid ":attr:`~AuditLogDiff.default_notifications`" msgstr ":attr:`~AuditLogDiff.default_notifications`" -#: ../../api.rst:1936 +#: ../../api.rst:1962 msgid ":attr:`~AuditLogDiff.explicit_content_filter`" msgstr ":attr:`~AuditLogDiff.explicit_content_filter`" -#: ../../api.rst:1937 +#: ../../api.rst:1963 msgid ":attr:`~AuditLogDiff.mfa_level`" msgstr ":attr:`~AuditLogDiff.mfa_level`" -#: ../../api.rst:1938 -#: ../../api.rst:1966 -#: ../../api.rst:1985 -#: ../../api.rst:2007 -#: ../../api.rst:2181 +#: ../../api.rst:1964 +#: ../../api.rst:1994 +#: ../../api.rst:2013 +#: ../../api.rst:2038 +#: ../../api.rst:2215 msgid ":attr:`~AuditLogDiff.name`" msgstr ":attr:`~AuditLogDiff.name`" -#: ../../api.rst:1939 +#: ../../api.rst:1965 msgid ":attr:`~AuditLogDiff.owner`" msgstr ":attr:`~AuditLogDiff.owner`" -#: ../../api.rst:1940 +#: ../../api.rst:1966 msgid ":attr:`~AuditLogDiff.splash`" msgstr ":attr:`~AuditLogDiff.splash`" -#: ../../api.rst:1941 +#: ../../api.rst:1967 msgid ":attr:`~AuditLogDiff.discovery_splash`" msgstr ":attr:`~AuditLogDiff.discovery_splash`" -#: ../../api.rst:1942 -#: ../../api.rst:2179 -#: ../../api.rst:2202 +#: ../../api.rst:1968 +#: ../../api.rst:2213 +#: ../../api.rst:2236 msgid ":attr:`~AuditLogDiff.icon`" msgstr ":attr:`~AuditLogDiff.icon`" -#: ../../api.rst:1943 +#: ../../api.rst:1969 msgid ":attr:`~AuditLogDiff.banner`" msgstr ":attr:`~AuditLogDiff.banner`" -#: ../../api.rst:1944 +#: ../../api.rst:1970 msgid ":attr:`~AuditLogDiff.vanity_url_code`" msgstr ":attr:`~AuditLogDiff.vanity_url_code`" -#: ../../api.rst:1945 -#: ../../api.rst:2476 -#: ../../api.rst:2495 -#: ../../api.rst:2514 +#: ../../api.rst:1971 +#: ../../api.rst:2510 +#: ../../api.rst:2529 +#: ../../api.rst:2548 msgid ":attr:`~AuditLogDiff.description`" msgstr ":attr:`~AuditLogDiff.description`" -#: ../../api.rst:1946 +#: ../../api.rst:1972 msgid ":attr:`~AuditLogDiff.preferred_locale`" msgstr ":attr:`~AuditLogDiff.preferred_locale`" -#: ../../api.rst:1947 +#: ../../api.rst:1973 msgid ":attr:`~AuditLogDiff.prune_delete_days`" msgstr ":attr:`~AuditLogDiff.prune_delete_days`" -#: ../../api.rst:1948 +#: ../../api.rst:1974 msgid ":attr:`~AuditLogDiff.public_updates_channel`" msgstr ":attr:`~AuditLogDiff.public_updates_channel`" -#: ../../api.rst:1949 +#: ../../api.rst:1975 msgid ":attr:`~AuditLogDiff.rules_channel`" msgstr ":attr:`~AuditLogDiff.rules_channel`" -#: ../../api.rst:1950 +#: ../../api.rst:1976 msgid ":attr:`~AuditLogDiff.verification_level`" msgstr ":attr:`~AuditLogDiff.verification_level`" -#: ../../api.rst:1951 +#: ../../api.rst:1977 msgid ":attr:`~AuditLogDiff.widget_channel`" msgstr ":attr:`~AuditLogDiff.widget_channel`" -#: ../../api.rst:1952 +#: ../../api.rst:1978 msgid ":attr:`~AuditLogDiff.widget_enabled`" msgstr ":attr:`~AuditLogDiff.widget_enabled`" -#: ../../api.rst:1956 +#: ../../api.rst:1979 +msgid ":attr:`~AuditLogDiff.premium_progress_bar_enabled`" +msgstr "" + +#: ../../api.rst:1980 +msgid ":attr:`~AuditLogDiff.system_channel_flags`" +msgstr "" + +#: ../../api.rst:1984 msgid "A new channel was created." msgstr "チャンネルの作成。" -#: ../../api.rst:1958 +#: ../../api.rst:1986 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is either a :class:`abc.GuildChannel` or :class:`Object` with an ID." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、IDが設定されている :class:`abc.GuildChannel` か、 :class:`Object` のいずれかになります。" -#: ../../api.rst:1961 +#: ../../api.rst:1989 msgid "A more filled out object in the :class:`Object` case can be found by using :attr:`~AuditLogEntry.after`." msgstr ":class:`Object` の場合、 :attr:`~AuditLogEntry.after` を使用して、より詳細な情報を持つオブジェクトを見つけることができます。" -#: ../../api.rst:1967 -#: ../../api.rst:1986 -#: ../../api.rst:2008 -#: ../../api.rst:2029 -#: ../../api.rst:2045 +#: ../../api.rst:1995 +#: ../../api.rst:2014 +#: ../../api.rst:2039 +#: ../../api.rst:2063 +#: ../../api.rst:2079 msgid ":attr:`~AuditLogDiff.type`" msgstr ":attr:`~AuditLogDiff.type`" -#: ../../api.rst:1968 -#: ../../api.rst:1988 -#: ../../api.rst:2009 +#: ../../api.rst:1996 +#: ../../api.rst:2016 +#: ../../api.rst:2040 msgid ":attr:`~AuditLogDiff.overwrites`" msgstr ":attr:`~AuditLogDiff.overwrites`" -#: ../../api.rst:1972 +#: ../../api.rst:2000 msgid "A channel was updated. Things that trigger this include:" msgstr "チャンネルの更新。これのトリガーとなるものは以下の通りです。" -#: ../../api.rst:1974 +#: ../../api.rst:2002 msgid "The channel name or topic was changed" msgstr "チャンネルのチャンネルトピックの変更、または名前の変更。" -#: ../../api.rst:1975 +#: ../../api.rst:2003 msgid "The channel bitrate was changed" msgstr "チャンネルのビットレートの変更。" -#: ../../api.rst:1977 -#: ../../api.rst:2015 +#: ../../api.rst:2005 +#: ../../api.rst:2049 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`abc.GuildChannel` or :class:`Object` with an ID." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、IDが設定されている :class:`abc.GuildChannel` か、 :class:`Object` のいずれかになります。" -#: ../../api.rst:1980 +#: ../../api.rst:2008 msgid "A more filled out object in the :class:`Object` case can be found by using :attr:`~AuditLogEntry.after` or :attr:`~AuditLogEntry.before`." msgstr ":class:`Object` の場合、 :attr:`~AuditLogEntry.after` または :attr:`~AuditLogEntry.before` を使用して、より詳細な情報を持つオブジェクトを見つけることができます。" -#: ../../api.rst:1987 +#: ../../api.rst:2015 msgid ":attr:`~AuditLogDiff.position`" msgstr ":attr:`~AuditLogDiff.position`" -#: ../../api.rst:1989 -#: ../../api.rst:2436 -#: ../../api.rst:2451 +#: ../../api.rst:2017 +#: ../../api.rst:2470 +#: ../../api.rst:2485 msgid ":attr:`~AuditLogDiff.topic`" msgstr ":attr:`~AuditLogDiff.topic`" -#: ../../api.rst:1990 +#: ../../api.rst:2018 msgid ":attr:`~AuditLogDiff.bitrate`" msgstr ":attr:`~AuditLogDiff.bitrate`" -#: ../../api.rst:1991 +#: ../../api.rst:2019 msgid ":attr:`~AuditLogDiff.rtc_region`" msgstr ":attr:`~AuditLogDiff.rtc_region`" -#: ../../api.rst:1992 +#: ../../api.rst:2020 msgid ":attr:`~AuditLogDiff.video_quality_mode`" msgstr ":attr:`~AuditLogDiff.video_quality_mode`" -#: ../../api.rst:1993 +#: ../../api.rst:2021 msgid ":attr:`~AuditLogDiff.default_auto_archive_duration`" msgstr ":attr:`~AuditLogDiff.default_auto_archive_duration`" -#: ../../api.rst:1997 +#: ../../api.rst:2022 +#: ../../api.rst:2042 +msgid ":attr:`~AuditLogDiff.nsfw`" +msgstr "" + +#: ../../api.rst:2023 +#: ../../api.rst:2043 +msgid ":attr:`~AuditLogDiff.slowmode_delay`" +msgstr "" + +#: ../../api.rst:2024 +msgid ":attr:`~AuditLogDiff.user_limit`" +msgstr "" + +#: ../../api.rst:2028 msgid "A channel was deleted." msgstr "チャンネルの削除。" -#: ../../api.rst:1999 +#: ../../api.rst:2030 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is an :class:`Object` with an ID." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、IDが設定されている :class:`Object` になります。" -#: ../../api.rst:2002 +#: ../../api.rst:2033 msgid "A more filled out object can be found by using the :attr:`~AuditLogEntry.before` object." msgstr ":attr:`~AuditLogEntry.before` オブジェクトを使用すると、より詳細な情報が見つかります。" -#: ../../api.rst:2013 +#: ../../api.rst:2041 +msgid ":attr:`~AuditLogDiff.flags`" +msgstr "" + +#: ../../api.rst:2047 msgid "A channel permission overwrite was created." msgstr "チャンネルにおける権限の上書き設定の作成。" -#: ../../api.rst:2018 +#: ../../api.rst:2052 msgid "When this is the action, the type of :attr:`~AuditLogEntry.extra` is either a :class:`Role` or :class:`Member`. If the object is not found then it is a :class:`Object` with an ID being filled, a name, and a ``type`` attribute set to either ``'role'`` or ``'member'`` to help dictate what type of ID it is." msgstr "この場合には、 :attr:`~AuditLogEntry.extra` は :class:`Role` か :class:`Member` です。もしオブジェクトが見つからない場合はid、name、 ``'role'`` か ``'member'`` である ``type`` 属性がある :class:`Object` です。" -#: ../../api.rst:2026 -#: ../../api.rst:2042 -#: ../../api.rst:2057 +#: ../../api.rst:2060 +#: ../../api.rst:2076 +#: ../../api.rst:2091 msgid ":attr:`~AuditLogDiff.deny`" msgstr ":attr:`~AuditLogDiff.deny`" -#: ../../api.rst:2027 -#: ../../api.rst:2043 -#: ../../api.rst:2058 +#: ../../api.rst:2061 +#: ../../api.rst:2077 +#: ../../api.rst:2092 msgid ":attr:`~AuditLogDiff.allow`" msgstr ":attr:`~AuditLogDiff.allow`" -#: ../../api.rst:2028 -#: ../../api.rst:2044 -#: ../../api.rst:2059 +#: ../../api.rst:2062 +#: ../../api.rst:2078 +#: ../../api.rst:2093 msgid ":attr:`~AuditLogDiff.id`" msgstr ":attr:`~AuditLogDiff.id`" -#: ../../api.rst:2033 +#: ../../api.rst:2067 msgid "A channel permission overwrite was changed, this is typically when the permission values change." msgstr "チャンネルの権限の上書きの変更。典型的な例は、権限が変更された場合です。" -#: ../../api.rst:2036 -#: ../../api.rst:2051 +#: ../../api.rst:2070 +#: ../../api.rst:2085 msgid "See :attr:`overwrite_create` for more information on how the :attr:`~AuditLogEntry.target` and :attr:`~AuditLogEntry.extra` fields are set." msgstr ":attr:`overwrite_create` に、 :attr:`~AuditLogEntry.target` と :attr:`~AuditLogEntry.extra` についての説明があります。" -#: ../../api.rst:2049 +#: ../../api.rst:2083 msgid "A channel permission overwrite was deleted." msgstr "チャンネルにおける権限の上書き設定の削除。" -#: ../../api.rst:2064 +#: ../../api.rst:2098 msgid "A member was kicked." msgstr "メンバーのキック。" -#: ../../api.rst:2066 +#: ../../api.rst:2100 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`User` or :class:`Object` who got kicked." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、キックされた :class:`User` あるいは :class:`Object` になります。" -#: ../../api.rst:2069 -#: ../../api.rst:2084 -#: ../../api.rst:2093 -#: ../../api.rst:2102 +#: ../../api.rst:2103 +#: ../../api.rst:2118 +#: ../../api.rst:2127 +#: ../../api.rst:2136 msgid "When this is the action, :attr:`~AuditLogEntry.changes` is empty." msgstr "これが上記のactionなら、:attr:`~AuditLogEntry.changes` は空になります。" -#: ../../api.rst:2073 +#: ../../api.rst:2107 msgid "A member prune was triggered." msgstr "非アクティブメンバーの一括キック。" -#: ../../api.rst:2075 +#: ../../api.rst:2109 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is set to ``None``." msgstr "これが上記のactionならば、:attr:`~AuditLogEntry.target` の型は ``None`` に設定されます。" -#: ../../api.rst:2078 -#: ../../api.rst:2138 -#: ../../api.rst:2346 -#: ../../api.rst:2373 -#: ../../api.rst:2388 +#: ../../api.rst:2112 +#: ../../api.rst:2172 +#: ../../api.rst:2380 +#: ../../api.rst:2407 +#: ../../api.rst:2422 msgid "When this is the action, the type of :attr:`~AuditLogEntry.extra` is set to an unspecified proxy object with two attributes:" msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.extra` は以下の属性を持つプロキシオブジェクトになります:" -#: ../../api.rst:2081 -msgid "``delete_members_days``: An integer specifying how far the prune was." -msgstr "``delete_members_days`` : 一括キック対象の期間を示す整数。" +#: ../../api.rst:2115 +msgid "``delete_member_days``: An integer specifying how far the prune was." +msgstr "" -#: ../../api.rst:2082 +#: ../../api.rst:2116 msgid "``members_removed``: An integer specifying how many members were removed." msgstr "``members_removed`` : 除去されたメンバーの数を示す整数。" -#: ../../api.rst:2088 +#: ../../api.rst:2122 msgid "A member was banned." msgstr "メンバーのBAN。" -#: ../../api.rst:2090 +#: ../../api.rst:2124 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`User` or :class:`Object` who got banned." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、BANされた :class:`User` あるいは :class:`Object` になります。" -#: ../../api.rst:2097 +#: ../../api.rst:2131 msgid "A member was unbanned." msgstr "メンバーのBANの解除。" -#: ../../api.rst:2099 +#: ../../api.rst:2133 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`User` or :class:`Object` who got unbanned." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、BAN解除された :class:`User` あるいは :class:`Object` になります。" -#: ../../api.rst:2106 +#: ../../api.rst:2140 msgid "A member has updated. This triggers in the following situations:" msgstr "メンバーの何らかの更新。これのトリガーとなるのは以下の場合です:" -#: ../../api.rst:2108 +#: ../../api.rst:2142 msgid "A nickname was changed" msgstr "メンバーのニックネームの変更。" -#: ../../api.rst:2109 +#: ../../api.rst:2143 msgid "They were server muted or deafened (or it was undo'd)" msgstr "サーバー側でミュートやスピーカーミュートされた(あるいは解除された)場合。" -#: ../../api.rst:2111 +#: ../../api.rst:2145 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`Member`, :class:`User`, or :class:`Object` who got updated." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、更新の行われた :class:`Member` 、 :class:`User` 、または :class:`Object` になります。" -#: ../../api.rst:2116 +#: ../../api.rst:2150 msgid ":attr:`~AuditLogDiff.nick`" msgstr ":attr:`~AuditLogDiff.nick`" -#: ../../api.rst:2117 +#: ../../api.rst:2151 msgid ":attr:`~AuditLogDiff.mute`" msgstr ":attr:`~AuditLogDiff.mute`" -#: ../../api.rst:2118 +#: ../../api.rst:2152 msgid ":attr:`~AuditLogDiff.deaf`" msgstr ":attr:`~AuditLogDiff.deaf`" -#: ../../api.rst:2119 +#: ../../api.rst:2153 msgid ":attr:`~AuditLogDiff.timed_out_until`" msgstr ":attr:`~AuditLogDiff.timed_out_until`" -#: ../../api.rst:2123 +#: ../../api.rst:2157 msgid "A member's role has been updated. This triggers when a member either gains a role or loses a role." msgstr "メンバーのロールの更新。これは、メンバーがロールを得たり、失った場合に発生します。" -#: ../../api.rst:2126 +#: ../../api.rst:2160 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`Member`, :class:`User`, or :class:`Object` who got the role." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、ロールの更新が行われた :class:`Member` 、 :class:`User` 、または :class:`Object` になります。" -#: ../../api.rst:2131 +#: ../../api.rst:2165 msgid ":attr:`~AuditLogDiff.roles`" msgstr ":attr:`~AuditLogDiff.roles`" -#: ../../api.rst:2135 +#: ../../api.rst:2169 msgid "A member's voice channel has been updated. This triggers when a member is moved to a different voice channel." msgstr "メンバーのボイスチャンネルの更新。これは、メンバーが他のボイスチャンネルに移動させられた時に発生します。" -#: ../../api.rst:2141 +#: ../../api.rst:2175 msgid "``channel``: A :class:`TextChannel` or :class:`Object` with the channel ID where the members were moved." msgstr "``channel`` : メンバーの移動先の :class:`TextChannel` か チャンネルIDを持つ :class:`Object` 。" -#: ../../api.rst:2142 +#: ../../api.rst:2176 msgid "``count``: An integer specifying how many members were moved." msgstr "``count`` : 移動されたメンバーの数を示す整数。" -#: ../../api.rst:2148 +#: ../../api.rst:2182 msgid "A member's voice state has changed. This triggers when a member is force disconnected from voice." msgstr "メンバーのボイス状態の変更。これはメンバーがボイスから強制的に切断された場合に発生します。" -#: ../../api.rst:2151 -#: ../../api.rst:2359 +#: ../../api.rst:2185 +#: ../../api.rst:2393 msgid "When this is the action, the type of :attr:`~AuditLogEntry.extra` is set to an unspecified proxy object with one attribute:" msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.extra` は以下の属性を持つプロキシオブジェクトになります:" -#: ../../api.rst:2154 +#: ../../api.rst:2188 msgid "``count``: An integer specifying how many members were disconnected." msgstr "``count`` : 切断されたメンバーの数を示す整数。" -#: ../../api.rst:2160 +#: ../../api.rst:2194 msgid "A bot was added to the guild." msgstr "ボットのギルドへの追加。" -#: ../../api.rst:2162 +#: ../../api.rst:2196 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`Member`, :class:`User`, or :class:`Object` which was added to the guild." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、ギルドに追加された :class:`Member` 、 :class:`User` 、または :class:`Object` になります。" -#: ../../api.rst:2169 +#: ../../api.rst:2203 msgid "A new role was created." msgstr "新しいロールの作成。" -#: ../../api.rst:2171 -#: ../../api.rst:2194 -#: ../../api.rst:2211 +#: ../../api.rst:2205 +#: ../../api.rst:2228 +#: ../../api.rst:2245 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`Role` or a :class:`Object` with the ID." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、IDが設定されている :class:`Role` か、 :class:`Object` のいずれかになります。" -#: ../../api.rst:2176 -#: ../../api.rst:2199 -#: ../../api.rst:2216 +#: ../../api.rst:2210 +#: ../../api.rst:2233 +#: ../../api.rst:2250 msgid ":attr:`~AuditLogDiff.colour`" msgstr ":attr:`~AuditLogDiff.colour`" -#: ../../api.rst:2177 -#: ../../api.rst:2200 -#: ../../api.rst:2217 +#: ../../api.rst:2211 +#: ../../api.rst:2234 +#: ../../api.rst:2251 msgid ":attr:`~AuditLogDiff.mentionable`" msgstr ":attr:`~AuditLogDiff.mentionable`" -#: ../../api.rst:2178 -#: ../../api.rst:2201 -#: ../../api.rst:2218 +#: ../../api.rst:2212 +#: ../../api.rst:2235 +#: ../../api.rst:2252 msgid ":attr:`~AuditLogDiff.hoist`" msgstr ":attr:`~AuditLogDiff.hoist`" -#: ../../api.rst:2180 -#: ../../api.rst:2203 +#: ../../api.rst:2214 +#: ../../api.rst:2237 msgid ":attr:`~AuditLogDiff.unicode_emoji`" msgstr ":attr:`~AuditLogDiff.unicode_emoji`" -#: ../../api.rst:2182 -#: ../../api.rst:2205 -#: ../../api.rst:2220 +#: ../../api.rst:2216 +#: ../../api.rst:2239 +#: ../../api.rst:2254 msgid ":attr:`~AuditLogDiff.permissions`" msgstr ":attr:`~AuditLogDiff.permissions`" -#: ../../api.rst:2186 +#: ../../api.rst:2220 msgid "A role was updated. This triggers in the following situations:" msgstr "ロールの何らかの更新。これのトリガーとなるのは以下の場合です:" -#: ../../api.rst:2188 +#: ../../api.rst:2222 msgid "The name has changed" msgstr "名前の更新。" -#: ../../api.rst:2189 +#: ../../api.rst:2223 msgid "The permissions have changed" msgstr "権限の更新。" -#: ../../api.rst:2190 +#: ../../api.rst:2224 msgid "The colour has changed" msgstr "色の更新。" -#: ../../api.rst:2191 +#: ../../api.rst:2225 msgid "The role icon (or unicode emoji) has changed" msgstr "ロールアイコン (または Unicode 絵文字)の変更。" -#: ../../api.rst:2192 +#: ../../api.rst:2226 msgid "Its hoist/mentionable state has changed" msgstr "ロールメンバーのオンライン表示、ロールへのメンションの許可の変更。" -#: ../../api.rst:2209 +#: ../../api.rst:2243 msgid "A role was deleted." msgstr "ロールの削除。" -#: ../../api.rst:2224 +#: ../../api.rst:2258 msgid "An invite was created." msgstr "招待の作成。" -#: ../../api.rst:2226 +#: ../../api.rst:2260 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`Invite` that was created." msgstr "これが上記のactionならば、:attr:`~AuditLogEntry.target` の型は作成された招待に該当する :class:`Invite` になります。" -#: ../../api.rst:2231 -#: ../../api.rst:2255 +#: ../../api.rst:2265 +#: ../../api.rst:2289 msgid ":attr:`~AuditLogDiff.max_age`" msgstr ":attr:`~AuditLogDiff.max_age`" -#: ../../api.rst:2232 -#: ../../api.rst:2256 +#: ../../api.rst:2266 +#: ../../api.rst:2290 msgid ":attr:`~AuditLogDiff.code`" msgstr ":attr:`~AuditLogDiff.code`" -#: ../../api.rst:2233 -#: ../../api.rst:2257 +#: ../../api.rst:2267 +#: ../../api.rst:2291 msgid ":attr:`~AuditLogDiff.temporary`" msgstr ":attr:`~AuditLogDiff.temporary`" -#: ../../api.rst:2234 -#: ../../api.rst:2258 +#: ../../api.rst:2268 +#: ../../api.rst:2292 msgid ":attr:`~AuditLogDiff.inviter`" msgstr ":attr:`~AuditLogDiff.inviter`" -#: ../../api.rst:2235 -#: ../../api.rst:2259 -#: ../../api.rst:2272 -#: ../../api.rst:2288 -#: ../../api.rst:2301 +#: ../../api.rst:2269 +#: ../../api.rst:2293 +#: ../../api.rst:2306 +#: ../../api.rst:2322 +#: ../../api.rst:2335 msgid ":attr:`~AuditLogDiff.channel`" msgstr ":attr:`~AuditLogDiff.channel`" -#: ../../api.rst:2236 -#: ../../api.rst:2260 +#: ../../api.rst:2270 +#: ../../api.rst:2294 msgid ":attr:`~AuditLogDiff.uses`" msgstr ":attr:`~AuditLogDiff.uses`" -#: ../../api.rst:2237 -#: ../../api.rst:2261 +#: ../../api.rst:2271 +#: ../../api.rst:2295 msgid ":attr:`~AuditLogDiff.max_uses`" msgstr ":attr:`~AuditLogDiff.max_uses`" -#: ../../api.rst:2241 +#: ../../api.rst:2275 msgid "An invite was updated." msgstr "招待の更新。" -#: ../../api.rst:2243 +#: ../../api.rst:2277 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`Invite` that was updated." msgstr "これが上記のactionならば、:attr:`~AuditLogEntry.target` の型は更新された招待に該当する :class:`Invite` になります。" -#: ../../api.rst:2248 +#: ../../api.rst:2282 msgid "An invite was deleted." msgstr "招待の削除。" -#: ../../api.rst:2250 +#: ../../api.rst:2284 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`Invite` that was deleted." msgstr "これが上記のactionならば、:attr:`~AuditLogEntry.target` のタイプは削除された招待に該当する :class:`Invite` になります。" -#: ../../api.rst:2265 +#: ../../api.rst:2299 msgid "A webhook was created." msgstr "Webhookの作成。" -#: ../../api.rst:2267 -#: ../../api.rst:2283 -#: ../../api.rst:2296 +#: ../../api.rst:2301 +#: ../../api.rst:2317 +#: ../../api.rst:2330 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`Object` with the webhook ID." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` のタイプは、webhook IDが設定されている :class:`Object` になります。" -#: ../../api.rst:2274 -#: ../../api.rst:2303 +#: ../../api.rst:2308 +#: ../../api.rst:2337 msgid ":attr:`~AuditLogDiff.type` (always set to ``1`` if so)" msgstr ":attr:`~AuditLogDiff.type` (その場合は常に ``1`` です。)" -#: ../../api.rst:2278 +#: ../../api.rst:2312 msgid "A webhook was updated. This trigger in the following situations:" msgstr "Webhookの更新。これのトリガーとなるのは以下の場合です。" -#: ../../api.rst:2280 +#: ../../api.rst:2314 msgid "The webhook name changed" msgstr "Webhook名が変更されたとき" -#: ../../api.rst:2281 +#: ../../api.rst:2315 msgid "The webhook channel changed" msgstr "Webhookチャンネルが変更されたとき" -#: ../../api.rst:2290 +#: ../../api.rst:2324 msgid ":attr:`~AuditLogDiff.avatar`" msgstr ":attr:`~AuditLogDiff.avatar`" -#: ../../api.rst:2294 +#: ../../api.rst:2328 msgid "A webhook was deleted." msgstr "Webhookの削除。" -#: ../../api.rst:2307 +#: ../../api.rst:2341 msgid "An emoji was created." msgstr "絵文字の作成。" -#: ../../api.rst:2309 -#: ../../api.rst:2320 +#: ../../api.rst:2343 +#: ../../api.rst:2354 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`Emoji` or :class:`Object` with the emoji ID." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、 :class:`Emoji` または 絵文字IDが設定された :class:`Object` です。" -#: ../../api.rst:2318 +#: ../../api.rst:2352 msgid "An emoji was updated. This triggers when the name has changed." msgstr "絵文字に対する何らかの更新。これは名前が変更されたときに発生します。" -#: ../../api.rst:2329 +#: ../../api.rst:2363 msgid "An emoji was deleted." msgstr "絵文字の削除。" -#: ../../api.rst:2331 +#: ../../api.rst:2365 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`Object` with the emoji ID." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、絵文字IDが設定されている :class:`Object` になります。" -#: ../../api.rst:2340 +#: ../../api.rst:2374 msgid "A message was deleted by a moderator. Note that this only triggers if the message was deleted by someone other than the author." msgstr "管理者によるメッセージの削除。なお、これのトリガーとなるのは、メッセージが投稿者以外によって削除された場合のみです。" -#: ../../api.rst:2343 +#: ../../api.rst:2377 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`Member`, :class:`User`, or :class:`Object` who had their message deleted." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、削除されたメッセージの送信者である :class:`Member` 、 :class:`User` 、または :class:`Object` になります。" -#: ../../api.rst:2349 -#: ../../api.rst:2362 +#: ../../api.rst:2383 +#: ../../api.rst:2396 msgid "``count``: An integer specifying how many messages were deleted." msgstr "``count`` : 削除されたメッセージの数を示す整数。" -#: ../../api.rst:2350 +#: ../../api.rst:2384 msgid "``channel``: A :class:`TextChannel` or :class:`Object` with the channel ID where the message got deleted." msgstr "``channel`` : メッセージが削除された :class:`TextChannel` か チャンネルIDを持つ :class:`Object` 。" -#: ../../api.rst:2354 +#: ../../api.rst:2388 msgid "Messages were bulk deleted by a moderator." msgstr "管理者によるメッセージの一括削除。" -#: ../../api.rst:2356 +#: ../../api.rst:2390 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`TextChannel` or :class:`Object` with the ID of the channel that was purged." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、 :class:`TextChannel` またはメッセージが一括削除されたチャンネルIDが設定された :class:`Object` です。" -#: ../../api.rst:2368 +#: ../../api.rst:2402 msgid "A message was pinned in a channel." msgstr "チャンネルへのメッセージのピン留め。" -#: ../../api.rst:2370 +#: ../../api.rst:2404 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`Member`, :class:`User`, or :class:`Object` who had their message pinned." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、ピン留めされたメッセージの送信者である :class:`Member` 、 :class:`User` 、または :class:`Object` になります。" -#: ../../api.rst:2376 +#: ../../api.rst:2410 msgid "``channel``: A :class:`TextChannel` or :class:`Object` with the channel ID where the message was pinned." msgstr "``channel`` : メッセージがピン留めされた :class:`TextChannel` か チャンネルIDを持つ :class:`Object` 。" -#: ../../api.rst:2377 +#: ../../api.rst:2411 msgid "``message_id``: the ID of the message which was pinned." msgstr "``message_id`` : ピン留めされたメッセージのID。" -#: ../../api.rst:2383 +#: ../../api.rst:2417 msgid "A message was unpinned in a channel." msgstr "チャンネルからのメッセージのピン留め解除。" -#: ../../api.rst:2385 +#: ../../api.rst:2419 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`Member`, :class:`User`, or :class:`Object` who had their message unpinned." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、ピン留めが外されたメッセージの送信者である :class:`Member` 、 :class:`User` 、または :class:`Object` になります。" -#: ../../api.rst:2391 +#: ../../api.rst:2425 msgid "``channel``: A :class:`TextChannel` or :class:`Object` with the channel ID where the message was unpinned." msgstr "``channel`` : メッセージのピン留めが外された :class:`TextChannel` か チャンネルIDを持つ :class:`Object` 。" -#: ../../api.rst:2392 +#: ../../api.rst:2426 msgid "``message_id``: the ID of the message which was unpinned." msgstr "``message_id`` : ピン留めが外されたメッセージのID。" -#: ../../api.rst:2398 +#: ../../api.rst:2432 msgid "A guild integration was created." msgstr "ギルドの連携サービスの作成。" -#: ../../api.rst:2400 +#: ../../api.rst:2434 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is a :class:`PartialIntegration` or :class:`Object` with the integration ID of the integration which was created." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、 :class:`PartialIntegration` または作成されたインテグレーションのIDを持つ :class:`Object` になります。" -#: ../../api.rst:2408 +#: ../../api.rst:2442 msgid "A guild integration was updated." msgstr "ギルド連携サービスの更新。" -#: ../../api.rst:2410 +#: ../../api.rst:2444 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is a :class:`PartialIntegration` or :class:`Object` with the integration ID of the integration which was updated." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、 :class:`PartialIntegration` または更新されたインテグレーションのIDを持つ :class:`Object` になります。" -#: ../../api.rst:2418 +#: ../../api.rst:2452 msgid "A guild integration was deleted." msgstr "ギルド連携サービスの削除。" -#: ../../api.rst:2420 +#: ../../api.rst:2454 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is a :class:`PartialIntegration` or :class:`Object` with the integration ID of the integration which was deleted." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、 :class:`PartialIntegration` または削除されたインテグレーションのIDを持つ :class:`Object` になります。" -#: ../../api.rst:2428 +#: ../../api.rst:2462 msgid "A stage instance was started." msgstr "ステージインスタンスの開始。" -#: ../../api.rst:2430 +#: ../../api.rst:2464 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`StageInstance` or :class:`Object` with the ID of the stage instance which was created." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、 :class:`StageInstance` または作成されたステージインスタンスのIDが設定された :class:`Object` です。" -#: ../../api.rst:2437 -#: ../../api.rst:2452 +#: ../../api.rst:2471 +#: ../../api.rst:2486 msgid ":attr:`~AuditLogDiff.privacy_level`" msgstr ":attr:`~AuditLogDiff.privacy_level`" -#: ../../api.rst:2443 +#: ../../api.rst:2477 msgid "A stage instance was updated." msgstr "ステージインスタンスの更新。" -#: ../../api.rst:2445 +#: ../../api.rst:2479 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`StageInstance` or :class:`Object` with the ID of the stage instance which was updated." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、 :class:`StageInstance` または更新されたステージインスタンスのIDが設定された :class:`Object` です。" -#: ../../api.rst:2458 +#: ../../api.rst:2492 msgid "A stage instance was ended." msgstr "ステージインスタンスの終了。" -#: ../../api.rst:2464 +#: ../../api.rst:2498 msgid "A sticker was created." msgstr "スタンプの作成。" -#: ../../api.rst:2466 +#: ../../api.rst:2500 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`GuildSticker` or :class:`Object` with the ID of the sticker which was created." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、 :class:`GuildSticker` または作成されたスタンプのIDが設定された :class:`Object` です。" -#: ../../api.rst:2473 -#: ../../api.rst:2492 -#: ../../api.rst:2511 +#: ../../api.rst:2507 +#: ../../api.rst:2526 +#: ../../api.rst:2545 msgid ":attr:`~AuditLogDiff.emoji`" msgstr ":attr:`~AuditLogDiff.emoji`" -#: ../../api.rst:2475 -#: ../../api.rst:2494 -#: ../../api.rst:2513 +#: ../../api.rst:2509 +#: ../../api.rst:2528 +#: ../../api.rst:2547 msgid ":attr:`~AuditLogDiff.format_type`" msgstr ":attr:`~AuditLogDiff.format_type`" -#: ../../api.rst:2477 -#: ../../api.rst:2496 -#: ../../api.rst:2515 +#: ../../api.rst:2511 +#: ../../api.rst:2530 +#: ../../api.rst:2549 msgid ":attr:`~AuditLogDiff.available`" msgstr ":attr:`~AuditLogDiff.available`" -#: ../../api.rst:2483 +#: ../../api.rst:2517 msgid "A sticker was updated." msgstr "スタンプの更新。" -#: ../../api.rst:2485 -#: ../../api.rst:2504 +#: ../../api.rst:2519 +#: ../../api.rst:2538 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`GuildSticker` or :class:`Object` with the ID of the sticker which was updated." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、 :class:`GuildSticker` または更新されたスタンプのIDが設定された :class:`Object` です。" -#: ../../api.rst:2502 +#: ../../api.rst:2536 msgid "A sticker was deleted." msgstr "スタンプの削除。" -#: ../../api.rst:2521 -#: ../../api.rst:2540 -#: ../../api.rst:2559 +#: ../../api.rst:2555 +#: ../../api.rst:2574 +#: ../../api.rst:2593 msgid "A scheduled event was created." msgstr "スケジュールイベントの作成。" -#: ../../api.rst:2523 +#: ../../api.rst:2557 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`ScheduledEvent` or :class:`Object` with the ID of the event which was created." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、 :class:`ScheduledEvent` または作成されたスケジュールイベントのIDが設定された :class:`Object` です。" -#: ../../api.rst:2527 -#: ../../api.rst:2546 -#: ../../api.rst:2565 +#: ../../api.rst:2561 +#: ../../api.rst:2580 +#: ../../api.rst:2599 msgid "Possible attributes for :class:`AuditLogDiff`: - :attr:`~AuditLogDiff.name` - :attr:`~AuditLogDiff.channel` - :attr:`~AuditLogDiff.description` - :attr:`~AuditLogDiff.privacy_level` - :attr:`~AuditLogDiff.status` - :attr:`~AuditLogDiff.entity_type` - :attr:`~AuditLogDiff.cover_image`" msgstr ":class:`AuditLogDiff` の可能な属性: - :attr:`~AuditLogDiff.name` - :attr:`~AuditLogDiff.channel` - :attr:`~AuditLogDiff.description` - :attr:`~AuditLogDiff.privacy_level` - :attr:`~AuditLogDiff.status` - :attr:`~AuditLogDiff.entity_type` - :attr:`~AuditLogDiff.cover_image`" -#: ../../api.rst:2542 +#: ../../api.rst:2576 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`ScheduledEvent` or :class:`Object` with the ID of the event which was updated." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、 :class:`ScheduledEvent` または更新されたスケジュールイベントのIDが設定された :class:`Object` です。" -#: ../../api.rst:2561 +#: ../../api.rst:2595 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`ScheduledEvent` or :class:`Object` with the ID of the event which was deleted." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、 :class:`ScheduledEvent` または削除されたスケジュールイベントのIDが設定された :class:`Object` です。" -#: ../../api.rst:2578 +#: ../../api.rst:2612 msgid "A thread was created." msgstr "スレッドの作成。" -#: ../../api.rst:2580 +#: ../../api.rst:2614 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`Thread` or :class:`Object` with the ID of the thread which was created." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、 :class:`Thread` または作成されたスレッドのIDが設定された :class:`Object` です。" -#: ../../api.rst:2587 -#: ../../api.rst:2605 -#: ../../api.rst:2623 +#: ../../api.rst:2621 +#: ../../api.rst:2639 +#: ../../api.rst:2657 msgid ":attr:`~AuditLogDiff.archived`" msgstr ":attr:`~AuditLogDiff.archived`" -#: ../../api.rst:2588 -#: ../../api.rst:2606 -#: ../../api.rst:2624 +#: ../../api.rst:2622 +#: ../../api.rst:2640 +#: ../../api.rst:2658 msgid ":attr:`~AuditLogDiff.locked`" msgstr ":attr:`~AuditLogDiff.locked`" -#: ../../api.rst:2589 -#: ../../api.rst:2607 -#: ../../api.rst:2625 +#: ../../api.rst:2623 +#: ../../api.rst:2641 +#: ../../api.rst:2659 msgid ":attr:`~AuditLogDiff.auto_archive_duration`" msgstr ":attr:`~AuditLogDiff.auto_archive_duration`" -#: ../../api.rst:2590 -#: ../../api.rst:2608 -#: ../../api.rst:2626 +#: ../../api.rst:2624 +#: ../../api.rst:2642 +#: ../../api.rst:2660 msgid ":attr:`~AuditLogDiff.invitable`" msgstr ":attr:`~AuditLogDiff.invitable`" -#: ../../api.rst:2596 +#: ../../api.rst:2630 msgid "A thread was updated." msgstr "スレッドの更新。" -#: ../../api.rst:2598 +#: ../../api.rst:2632 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`Thread` or :class:`Object` with the ID of the thread which was updated." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、 :class:`Thread` または更新されたスレッドのIDが設定された :class:`Object` です。" -#: ../../api.rst:2614 +#: ../../api.rst:2648 msgid "A thread was deleted." msgstr "スレッドの削除。" -#: ../../api.rst:2616 +#: ../../api.rst:2650 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is the :class:`Thread` or :class:`Object` with the ID of the thread which was deleted." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、 :class:`Thread` または削除されたスレッドのIDが設定された :class:`Object` です。" -#: ../../api.rst:2632 +#: ../../api.rst:2666 msgid "An application command or integrations application command permissions were updated." msgstr "アプリケーションコマンドまたはインテグレーションアプリケーションコマンドの権限の更新。" -#: ../../api.rst:2635 +#: ../../api.rst:2669 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is a :class:`PartialIntegration` for an integrations general permissions, :class:`~discord.app_commands.AppCommand` for a specific commands permissions, or :class:`Object` with the ID of the command or integration which was updated." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` の型は、 インテグレーション一般の権限の場合 :class:`PartialIntegration` 、特定のコマンドの権限の場合 :class:`~discord.app_commands.AppCommand` 、あるいは更新されたコマンドまたはインテグレーションのIDが設定された :class:`Object` です。" -#: ../../api.rst:2641 +#: ../../api.rst:2675 msgid "When this is the action, the type of :attr:`~AuditLogEntry.extra` is set to an :class:`PartialIntegration` or :class:`Object` with the ID of application that command or integration belongs to." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.extra` の型は、 :class:`PartialIntegration` またはコマンドまたはインテグレーションが属するアプリケーションのIDを持つ :class:`Object` になります。" -#: ../../api.rst:2647 +#: ../../api.rst:2681 msgid ":attr:`~AuditLogDiff.app_command_permissions`" msgstr ":attr:`~AuditLogDiff.app_command_permissions`" -#: ../../api.rst:2653 +#: ../../api.rst:2687 msgid "An automod rule was created." msgstr "自動管理ルールの作成。" -#: ../../api.rst:2655 -#: ../../api.rst:2676 -#: ../../api.rst:2697 +#: ../../api.rst:2689 +#: ../../api.rst:2710 +#: ../../api.rst:2731 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is a :class:`AutoModRule` or :class:`Object` with the ID of the automod rule that was created." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` のtypeは、 :class:`AutoModRule` または作成された自動管理ルールのIDが設定された :class:`Object` です。" -#: ../../api.rst:2662 -#: ../../api.rst:2683 -#: ../../api.rst:2704 +#: ../../api.rst:2696 +#: ../../api.rst:2717 +#: ../../api.rst:2738 msgid ":attr:`~AuditLogDiff.enabled`" msgstr ":attr:`~AuditLogDiff.enabled`" -#: ../../api.rst:2663 -#: ../../api.rst:2684 -#: ../../api.rst:2705 +#: ../../api.rst:2697 +#: ../../api.rst:2718 +#: ../../api.rst:2739 msgid ":attr:`~AuditLogDiff.event_type`" msgstr ":attr:`~AuditLogDiff.event_type`" -#: ../../api.rst:2664 -#: ../../api.rst:2685 -#: ../../api.rst:2706 +#: ../../api.rst:2698 +#: ../../api.rst:2719 +#: ../../api.rst:2740 msgid ":attr:`~AuditLogDiff.trigger_type`" msgstr ":attr:`~AuditLogDiff.trigger_type`" -#: ../../api.rst:2665 -#: ../../api.rst:2686 -#: ../../api.rst:2707 +#: ../../api.rst:2699 +#: ../../api.rst:2720 +#: ../../api.rst:2741 msgid ":attr:`~AuditLogDiff.trigger`" msgstr ":attr:`~AuditLogDiff.trigger`" -#: ../../api.rst:2666 -#: ../../api.rst:2687 -#: ../../api.rst:2708 +#: ../../api.rst:2700 +#: ../../api.rst:2721 +#: ../../api.rst:2742 msgid ":attr:`~AuditLogDiff.actions`" msgstr ":attr:`~AuditLogDiff.actions`" -#: ../../api.rst:2667 -#: ../../api.rst:2688 -#: ../../api.rst:2709 +#: ../../api.rst:2701 +#: ../../api.rst:2722 +#: ../../api.rst:2743 msgid ":attr:`~AuditLogDiff.exempt_roles`" msgstr ":attr:`~AuditLogDiff.exempt_roles`" -#: ../../api.rst:2668 -#: ../../api.rst:2689 -#: ../../api.rst:2710 +#: ../../api.rst:2702 +#: ../../api.rst:2723 +#: ../../api.rst:2744 msgid ":attr:`~AuditLogDiff.exempt_channels`" msgstr ":attr:`~AuditLogDiff.exempt_channels`" -#: ../../api.rst:2674 +#: ../../api.rst:2708 msgid "An automod rule was updated." msgstr "自動管理ルールの更新。" -#: ../../api.rst:2695 +#: ../../api.rst:2729 msgid "An automod rule was deleted." msgstr "自動管理ルールの削除。" -#: ../../api.rst:2716 +#: ../../api.rst:2750 msgid "An automod rule blocked a message from being sent." msgstr "自動管理ルールによる送信されたメッセージのブロック。" -#: ../../api.rst:2718 -#: ../../api.rst:2736 -#: ../../api.rst:2754 +#: ../../api.rst:2752 +#: ../../api.rst:2770 +#: ../../api.rst:2788 msgid "When this is the action, the type of :attr:`~AuditLogEntry.target` is a :class:`Member` with the ID of the person who triggered the automod rule." msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.target` のtypeは、自動管理ルールを発動させた :class:`Member` になります。" -#: ../../api.rst:2721 -#: ../../api.rst:2739 -#: ../../api.rst:2757 +#: ../../api.rst:2755 +#: ../../api.rst:2773 +#: ../../api.rst:2791 msgid "When this is the action, the type of :attr:`~AuditLogEntry.extra` is set to an unspecified proxy object with 3 attributes:" msgstr "これが上記のactionならば、 :attr:`~AuditLogEntry.extra` は以下の3つの属性を持つプロキシオブジェクトになります:" -#: ../../api.rst:2724 -#: ../../api.rst:2742 -#: ../../api.rst:2760 +#: ../../api.rst:2758 +#: ../../api.rst:2776 +#: ../../api.rst:2794 msgid "``automod_rule_name``: The name of the automod rule that was triggered." msgstr "``automod_rule_name`` : 発動した自動管理ルールの名前。" -#: ../../api.rst:2725 -#: ../../api.rst:2743 -#: ../../api.rst:2761 +#: ../../api.rst:2759 +#: ../../api.rst:2777 +#: ../../api.rst:2795 msgid "``automod_rule_trigger``: A :class:`AutoModRuleTriggerType` representation of the rule type that was triggered." msgstr "``automod_rule_trigger`` : 発動されたルールの :class:`AutoModRuleTriggerType` 。" -#: ../../api.rst:2726 -#: ../../api.rst:2744 -#: ../../api.rst:2762 +#: ../../api.rst:2760 +#: ../../api.rst:2778 +#: ../../api.rst:2796 msgid "``channel``: The channel in which the automod rule was triggered." msgstr "``channel`` : 自動管理ルールが発動されたチャンネル。" -#: ../../api.rst:2728 -#: ../../api.rst:2746 -#: ../../api.rst:2764 +#: ../../api.rst:2762 +#: ../../api.rst:2780 +#: ../../api.rst:2798 msgid "When this is the action, :attr:`AuditLogEntry.changes` is empty." msgstr "これが上記のactionなら、 :attr:`~AuditLogEntry.changes` は空になります。" -#: ../../api.rst:2734 +#: ../../api.rst:2768 msgid "An automod rule flagged a message." msgstr "自動管理ルールによる送信されたメッセージのフラグ付け。" -#: ../../api.rst:2752 +#: ../../api.rst:2786 msgid "An automod rule timed-out a member." msgstr "自動管理ルールによるメンバーのタイムアウト。" -#: ../../api.rst:2770 +#: ../../api.rst:2804 msgid "Represents the category that the :class:`AuditLogAction` belongs to." msgstr ":class:`AuditLogAction` が属するカテゴリ。" -#: ../../api.rst:2772 +#: ../../api.rst:2806 msgid "This can be retrieved via :attr:`AuditLogEntry.category`." msgstr "これは :attr:`AuditLogEntry.category` で取得できます。" -#: ../../api.rst:2776 +#: ../../api.rst:2810 msgid "The action is the creation of something." msgstr "アクションは何かの作成です。" -#: ../../api.rst:2780 +#: ../../api.rst:2814 msgid "The action is the deletion of something." msgstr "アクションは何かの削除です。" -#: ../../api.rst:2784 +#: ../../api.rst:2818 msgid "The action is the update of something." msgstr "アクションは何かの更新です。" -#: ../../api.rst:2788 +#: ../../api.rst:2822 msgid "Represents the membership state of a team member retrieved through :func:`Client.application_info`." msgstr ":func:`Client.application_info` で取得したチームメンバーのメンバーシップ状態。" -#: ../../api.rst:2794 +#: ../../api.rst:2828 msgid "Represents an invited member." msgstr "招待されたメンバー。" -#: ../../api.rst:2798 +#: ../../api.rst:2832 msgid "Represents a member currently in the team." msgstr "現在チームにいるメンバー。" -#: ../../api.rst:2802 +#: ../../api.rst:2836 msgid "Represents the type of webhook that can be received." msgstr "受け取れるWebhookの種類。" -#: ../../api.rst:2808 +#: ../../api.rst:2842 msgid "Represents a webhook that can post messages to channels with a token." msgstr "トークンでチャンネルにメッセージを投稿できるWebhook。" -#: ../../api.rst:2812 +#: ../../api.rst:2846 msgid "Represents a webhook that is internally managed by Discord, used for following channels." msgstr "チャンネルのフォローのためDiscord内部で管理されるWebhook。" -#: ../../api.rst:2816 +#: ../../api.rst:2850 msgid "Represents a webhook that is used for interactions or applications." msgstr "インタラクションやアプリケーションに用いられるWebhook。" -#: ../../api.rst:2822 +#: ../../api.rst:2856 msgid "Represents the behaviour the :class:`Integration` should perform when a user's subscription has finished." msgstr "ユーザーのサブスクリプションが終了した後の :class:`Integration` の動作。" -#: ../../api.rst:2825 +#: ../../api.rst:2859 msgid "There is an alias for this called ``ExpireBehavior``." msgstr "``ExpireBehavior`` という名のエイリアスがあります。" -#: ../../api.rst:2831 +#: ../../api.rst:2865 msgid "This will remove the :attr:`StreamIntegration.role` from the user when their subscription is finished." msgstr "サブスクリプションが終了したユーザーから :attr:`StreamIntegration.role` を除去します。" -#: ../../api.rst:2836 +#: ../../api.rst:2870 msgid "This will kick the user when their subscription is finished." msgstr "サブスクリプションが終了したユーザーをキックします。" -#: ../../api.rst:2840 +#: ../../api.rst:2874 msgid "Represents the default avatar of a Discord :class:`User`" msgstr "Discord :class:`User` のデフォルトのアバター。" -#: ../../api.rst:2844 -msgid "Represents the default avatar with the color blurple. See also :attr:`Colour.blurple`" -msgstr "ブループル色のデフォルトのアバター。 :attr:`Colour.blurple` も参照してください。" +#: ../../api.rst:2878 +msgid "Represents the default avatar with the colour blurple. See also :attr:`Colour.blurple`" +msgstr "" -#: ../../api.rst:2848 -msgid "Represents the default avatar with the color grey. See also :attr:`Colour.greyple`" -msgstr "灰色のデフォルトのアバター。 :attr:`Colour.greyple` も参照してください。" +#: ../../api.rst:2882 +msgid "Represents the default avatar with the colour grey. See also :attr:`Colour.greyple`" +msgstr "" -#: ../../api.rst:2852 +#: ../../api.rst:2886 msgid "An alias for :attr:`grey`." msgstr ":attr:`grey` のエイリアス。" -#: ../../api.rst:2855 -msgid "Represents the default avatar with the color green. See also :attr:`Colour.green`" -msgstr "緑色のデフォルトのアバター。 :attr:`Colour.green` も参照してください。" +#: ../../api.rst:2889 +msgid "Represents the default avatar with the colour green. See also :attr:`Colour.green`" +msgstr "" -#: ../../api.rst:2859 -msgid "Represents the default avatar with the color orange. See also :attr:`Colour.orange`" -msgstr "オレンジ色のデフォルトのアバター。 :attr:`Colour.orange` も参照してください。" +#: ../../api.rst:2893 +msgid "Represents the default avatar with the colour orange. See also :attr:`Colour.orange`" +msgstr "" -#: ../../api.rst:2863 -msgid "Represents the default avatar with the color red. See also :attr:`Colour.red`" -msgstr "赤色のデフォルトのアバター。 :attr:`Colour.red` も参照してください。" +#: ../../api.rst:2897 +msgid "Represents the default avatar with the colour red. See also :attr:`Colour.red`" +msgstr "" -#: ../../api.rst:2868 +#: ../../api.rst:2901 +msgid "Represents the default avatar with the colour pink. See also :attr:`Colour.pink`" +msgstr "" + +#: ../../api.rst:2908 msgid "Represents the type of sticker." msgstr "スタンプの種類。" -#: ../../api.rst:2874 +#: ../../api.rst:2914 msgid "Represents a standard sticker that all Nitro users can use." msgstr "Nitroユーザー全員が使用できる標準スタンプ。" -#: ../../api.rst:2878 +#: ../../api.rst:2918 msgid "Represents a custom sticker created in a guild." msgstr "ギルドで作成されたカスタムスタンプ。" -#: ../../api.rst:2882 +#: ../../api.rst:2922 msgid "Represents the type of sticker images." msgstr "スタンプ画像の種類。" -#: ../../api.rst:2888 +#: ../../api.rst:2928 msgid "Represents a sticker with a png image." msgstr "PNG画像のスタンプ。" -#: ../../api.rst:2892 +#: ../../api.rst:2932 msgid "Represents a sticker with an apng image." msgstr "APNG画像のスタンプ。" -#: ../../api.rst:2896 +#: ../../api.rst:2936 msgid "Represents a sticker with a lottie image." msgstr "ロッティー画像のスタンプ。" -#: ../../api.rst:2900 +#: ../../api.rst:2940 msgid "Represents a sticker with a gif image." msgstr "GIF画像のスタンプ。" -#: ../../api.rst:2906 +#: ../../api.rst:2946 msgid "Represents the invite type for voice channel invites." msgstr "ボイスチャンネル招待の招待タイプ。" -#: ../../api.rst:2912 +#: ../../api.rst:2952 msgid "The invite doesn't target anyone or anything." msgstr "招待の対象がないもの。" -#: ../../api.rst:2916 +#: ../../api.rst:2956 msgid "A stream invite that targets a user." msgstr "ユーザーを対象とするもの。" -#: ../../api.rst:2920 +#: ../../api.rst:2960 msgid "A stream invite that targets an embedded application." msgstr "埋め込まれたアプリケーションを対象とするもの。" -#: ../../api.rst:2924 +#: ../../api.rst:2964 msgid "Represents the camera video quality mode for voice channel participants." msgstr "ボイスチャンネル参加者のカメラビデオの画質モード。" -#: ../../api.rst:2930 +#: ../../api.rst:2970 msgid "Represents auto camera video quality." msgstr "自動のカメラビデオ画質。" -#: ../../api.rst:2934 +#: ../../api.rst:2974 msgid "Represents full camera video quality." msgstr "フルのカメラビデオ画質。" -#: ../../api.rst:2938 +#: ../../api.rst:2978 msgid "Represents the privacy level of a stage instance or scheduled event." msgstr "ステージインスタンスやスケジュールイベントのプライバシーレベル。" -#: ../../api.rst:2944 +#: ../../api.rst:2984 msgid "The stage instance or scheduled event is only accessible within the guild." msgstr "ステージインスタンスやスケジュールイベントはギルド内でのみアクセスできます。" -#: ../../api.rst:2948 +#: ../../api.rst:2988 msgid "Represents the NSFW level of a guild." msgstr "ギルドの年齢制限レベル。" -#: ../../api.rst:2956 +#: ../../api.rst:2996 msgid "Checks if two NSFW levels are equal." msgstr "二つの年齢制限レベルが等しいかを比較します。" -#: ../../api.rst:2959 +#: ../../api.rst:2999 msgid "Checks if two NSFW levels are not equal." msgstr "二つの年齢制限レベルが等しくないかを比較します。" -#: ../../api.rst:2962 +#: ../../api.rst:3002 msgid "Checks if a NSFW level is higher than another." msgstr "年齢制限レベルがあるレベルより高いか確認します。" -#: ../../api.rst:2965 +#: ../../api.rst:3005 msgid "Checks if a NSFW level is lower than another." msgstr "年齢制限レベルがあるレベルより低いか確認します。" -#: ../../api.rst:2968 +#: ../../api.rst:3008 msgid "Checks if a NSFW level is higher or equal to another." msgstr "年齢制限レベルがあるレベルと同じ、又は高いか確認します。" -#: ../../api.rst:2971 +#: ../../api.rst:3011 msgid "Checks if a NSFW level is lower or equal to another." msgstr "年齢制限レベルがあるレベルと同じ、又は低いか確認します。" -#: ../../api.rst:2975 +#: ../../api.rst:3015 msgid "The guild has not been categorised yet." msgstr "未分類のギルド。" -#: ../../api.rst:2979 +#: ../../api.rst:3019 msgid "The guild contains NSFW content." msgstr "年齢制限されたコンテンツを含むギルド。" -#: ../../api.rst:2983 +#: ../../api.rst:3023 msgid "The guild does not contain any NSFW content." msgstr "年齢制限されたコンテンツを一切含まないギルド。" -#: ../../api.rst:2987 +#: ../../api.rst:3027 msgid "The guild may contain NSFW content." msgstr "年齢制限されたコンテンツを含む可能性のあるギルド。" -#: ../../api.rst:2991 +#: ../../api.rst:3031 msgid "Supported locales by Discord. Mainly used for application command localisation." msgstr "Discordでサポートされているロケール。主にアプリケーションコマンドの多言語化に使用されます。" -#: ../../api.rst:2997 +#: ../../api.rst:3037 msgid "The ``en-US`` locale." msgstr "``en-US`` ロケール。" -#: ../../api.rst:3001 +#: ../../api.rst:3041 msgid "The ``en-GB`` locale." msgstr "``en-GB`` ロケール。" -#: ../../api.rst:3005 +#: ../../api.rst:3045 msgid "The ``bg`` locale." msgstr "``bg`` ロケール。" -#: ../../api.rst:3009 +#: ../../api.rst:3049 msgid "The ``zh-CN`` locale." msgstr "``zh-CN`` ロケール。" -#: ../../api.rst:3013 +#: ../../api.rst:3053 msgid "The ``zh-TW`` locale." msgstr "``zh-TW`` ロケール。" -#: ../../api.rst:3017 +#: ../../api.rst:3057 msgid "The ``hr`` locale." msgstr "``hr`` ロケール。" -#: ../../api.rst:3021 +#: ../../api.rst:3061 msgid "The ``cs`` locale." msgstr "``cs`` ロケール。" -#: ../../api.rst:3025 +#: ../../api.rst:3065 msgid "The ``id`` locale." msgstr "``id`` ロケール。" -#: ../../api.rst:3031 +#: ../../api.rst:3071 msgid "The ``da`` locale." msgstr "``da`` ロケール。" -#: ../../api.rst:3035 +#: ../../api.rst:3075 msgid "The ``nl`` locale." msgstr "``nl`` ロケール。" -#: ../../api.rst:3039 +#: ../../api.rst:3079 msgid "The ``fi`` locale." msgstr "``fi`` ロケール。" -#: ../../api.rst:3043 +#: ../../api.rst:3083 msgid "The ``fr`` locale." msgstr "``fr`` ロケール。" -#: ../../api.rst:3047 +#: ../../api.rst:3087 msgid "The ``de`` locale." msgstr "``de`` ロケール。" -#: ../../api.rst:3051 +#: ../../api.rst:3091 msgid "The ``el`` locale." msgstr "``el`` ロケール。" -#: ../../api.rst:3055 +#: ../../api.rst:3095 msgid "The ``hi`` locale." msgstr "``hi`` ロケール。" -#: ../../api.rst:3059 +#: ../../api.rst:3099 msgid "The ``hu`` locale." msgstr "``hu`` ロケール。" -#: ../../api.rst:3063 +#: ../../api.rst:3103 msgid "The ``it`` locale." msgstr "``it`` ロケール。" -#: ../../api.rst:3067 +#: ../../api.rst:3107 msgid "The ``ja`` locale." msgstr "``ja`` ロケール。" -#: ../../api.rst:3071 +#: ../../api.rst:3111 msgid "The ``ko`` locale." msgstr "``ko`` ロケール。" -#: ../../api.rst:3075 +#: ../../api.rst:3115 msgid "The ``lt`` locale." msgstr "``lt`` ロケール。" -#: ../../api.rst:3079 +#: ../../api.rst:3119 msgid "The ``no`` locale." msgstr "``no`` ロケール。" -#: ../../api.rst:3083 +#: ../../api.rst:3123 msgid "The ``pl`` locale." msgstr "``pl`` ロケール。" -#: ../../api.rst:3087 +#: ../../api.rst:3127 msgid "The ``pt-BR`` locale." msgstr "``pt-BR`` ロケール。" -#: ../../api.rst:3091 +#: ../../api.rst:3131 msgid "The ``ro`` locale." msgstr "``ro`` ロケール。" -#: ../../api.rst:3095 +#: ../../api.rst:3135 msgid "The ``ru`` locale." msgstr "``ru`` ロケール。" -#: ../../api.rst:3099 +#: ../../api.rst:3139 msgid "The ``es-ES`` locale." msgstr "``es-ES`` ロケール。" -#: ../../api.rst:3103 +#: ../../api.rst:3143 msgid "The ``sv-SE`` locale." msgstr "``sv-SE`` ロケール。" -#: ../../api.rst:3107 +#: ../../api.rst:3147 msgid "The ``th`` locale." msgstr "``th`` ロケール。" -#: ../../api.rst:3111 +#: ../../api.rst:3151 msgid "The ``tr`` locale." msgstr "``tr`` ロケール。" -#: ../../api.rst:3115 +#: ../../api.rst:3155 msgid "The ``uk`` locale." msgstr "``uk`` ロケール。" -#: ../../api.rst:3119 +#: ../../api.rst:3159 msgid "The ``vi`` locale." msgstr "``vi`` ロケール。" -#: ../../api.rst:3124 +#: ../../api.rst:3164 msgid "Represents the Multi-Factor Authentication requirement level of a guild." msgstr "ギルドの多要素認証要件レベル。" -#: ../../api.rst:3132 +#: ../../api.rst:3172 msgid "Checks if two MFA levels are equal." msgstr "二つのMFAレベルが等しいかを比較します。" -#: ../../api.rst:3135 +#: ../../api.rst:3175 msgid "Checks if two MFA levels are not equal." msgstr "二つのMFAレベルが等しくないかを比較します。" -#: ../../api.rst:3138 +#: ../../api.rst:3178 msgid "Checks if a MFA level is higher than another." msgstr "多要素認証レベルがあるレベルより厳しいか確認します。" -#: ../../api.rst:3141 +#: ../../api.rst:3181 msgid "Checks if a MFA level is lower than another." msgstr "多要素認証レベルがあるレベルより緩いか確認します。" -#: ../../api.rst:3144 +#: ../../api.rst:3184 msgid "Checks if a MFA level is higher or equal to another." msgstr "多要素認証レベルがあるレベルと同じ、又は厳しいか確認します。" -#: ../../api.rst:3147 +#: ../../api.rst:3187 msgid "Checks if a MFA level is lower or equal to another." msgstr "多要素認証レベルがあるレベルと同じ、又は緩いか確認します。" -#: ../../api.rst:3151 +#: ../../api.rst:3191 msgid "The guild has no MFA requirement." msgstr "多要素認証要件がないギルド。" -#: ../../api.rst:3155 +#: ../../api.rst:3195 msgid "The guild requires 2 factor authentication." msgstr "二要素認証を必須とするギルド。" -#: ../../api.rst:3159 +#: ../../api.rst:3199 msgid "Represents the type of entity that a scheduled event is for." msgstr "スケジュールイベントの開催場所の種類。" -#: ../../api.rst:3165 +#: ../../api.rst:3205 msgid "The scheduled event will occur in a stage instance." msgstr "ステージインスタンスで起こるスケジュールイベント。" -#: ../../api.rst:3169 +#: ../../api.rst:3209 msgid "The scheduled event will occur in a voice channel." msgstr "ボイスチャンネルで起こるスケジュールイベント。" -#: ../../api.rst:3173 +#: ../../api.rst:3213 msgid "The scheduled event will occur externally." msgstr "外部で起こるスケジュールイベント。" -#: ../../api.rst:3177 +#: ../../api.rst:3217 msgid "Represents the status of an event." msgstr "イベントの状態。" -#: ../../api.rst:3183 +#: ../../api.rst:3223 msgid "The event is scheduled." msgstr "予定されたイベント。" -#: ../../api.rst:3187 +#: ../../api.rst:3227 msgid "The event is active." msgstr "開催中のイベント。" -#: ../../api.rst:3191 +#: ../../api.rst:3231 msgid "The event has ended." msgstr "終了したイベント。" -#: ../../api.rst:3195 +#: ../../api.rst:3235 msgid "The event has been cancelled." msgstr "キャンセルされたイベント。" -#: ../../api.rst:3199 +#: ../../api.rst:3239 msgid "An alias for :attr:`cancelled`." msgstr ":attr:`cancelled` のエイリアス。" -#: ../../api.rst:3203 +#: ../../api.rst:3243 msgid "An alias for :attr:`completed`." msgstr ":attr:`completed` のエイリアス。" -#: ../../api.rst:3207 +#: ../../api.rst:3247 msgid "Represents the trigger type of an automod rule." msgstr "自動管理ルールの発動条件の種類を表します。" -#: ../../api.rst:3213 +#: ../../api.rst:3253 msgid "The rule will trigger when a keyword is mentioned." msgstr "キーワードに言及したときに発動されるルール。" -#: ../../api.rst:3217 +#: ../../api.rst:3257 msgid "The rule will trigger when a harmful link is posted." msgstr "有害なリンクを投稿したときに発動されるルール。" -#: ../../api.rst:3221 +#: ../../api.rst:3261 msgid "The rule will trigger when a spam message is posted." msgstr "スパムメッセージを投稿したときに発動されるルール。" -#: ../../api.rst:3225 +#: ../../api.rst:3265 msgid "The rule will trigger when something triggers based on the set keyword preset types." msgstr "事前に定められたキーワードプリセットに基づき発動したときに発動されるルール。" -#: ../../api.rst:3229 +#: ../../api.rst:3269 msgid "The rule will trigger when combined number of role and user mentions is greater than the set limit." msgstr "ロールとユーザーのメンションの合計数が設定された制限よりも多い場合に発動されるルール。" -#: ../../api.rst:3234 +#: ../../api.rst:3274 msgid "Represents the event type of an automod rule." msgstr "自動管理ルールのイベントの種類を表します。" -#: ../../api.rst:3240 +#: ../../api.rst:3280 msgid "The rule will trigger when a message is sent." msgstr "メッセージを投稿したときにルールが発動します。" -#: ../../api.rst:3244 +#: ../../api.rst:3284 msgid "Represents the action type of an automod rule." msgstr "自動管理ルールの対応の種類を表します。" -#: ../../api.rst:3250 +#: ../../api.rst:3290 msgid "The rule will block a message from being sent." msgstr "メッセージを送信できないようにします。" -#: ../../api.rst:3254 +#: ../../api.rst:3294 msgid "The rule will send an alert message to a predefined channel." msgstr "事前に指定したチャンネルに警告メッセージを送信します。" -#: ../../api.rst:3258 +#: ../../api.rst:3298 msgid "The rule will timeout a user." msgstr "ユーザーをタイムアウトします。" -#: ../../api.rst:3263 +#: ../../api.rst:3303 msgid "Represents how a forum's posts are layed out in the client." msgstr "フォーラムの投稿がクライアントでどのように配列されるかを表します。" -#: ../../api.rst:3269 +#: ../../api.rst:3309 msgid "No default has been set, so it is up to the client to know how to lay it out." msgstr "デフォルトが設定されていないので、配列方法はクライアントによります。" -#: ../../api.rst:3273 +#: ../../api.rst:3313 msgid "Displays posts as a list." msgstr "投稿を一覧として表示します。" -#: ../../api.rst:3277 +#: ../../api.rst:3317 msgid "Displays posts as a collection of tiles." msgstr "投稿をタイルの集まりとして表示します。" -#: ../../api.rst:3283 +#: ../../api.rst:3322 +msgid "Represents how a forum's posts are sorted in the client." +msgstr "" + +#: ../../api.rst:3328 +msgid "Sort forum posts by activity." +msgstr "" + +#: ../../api.rst:3332 +msgid "Sort forum posts by creation time (from most recent to oldest)." +msgstr "" + +#: ../../api.rst:3338 msgid "Audit Log Data" msgstr "監査ログデータ" -#: ../../api.rst:3285 +#: ../../api.rst:3340 msgid "Working with :meth:`Guild.audit_logs` is a complicated process with a lot of machinery involved. The library attempts to make it easy to use and friendly. In order to accomplish this goal, it must make use of a couple of data classes that aid in this goal." msgstr ":meth:`Guild.audit_logs` の使用は複雑なプロセスです。このライブラリーはこれを使いやすくフレンドリーにしようと試みています。この目標の達成のためにいくつかのデータクラスを使用しています。" -#: ../../api.rst:3290 +#: ../../api.rst:3345 msgid "AuditLogEntry" msgstr "AuditLogEntry" @@ -6317,402 +6406,406 @@ msgstr ":class:`AuditLogDiff`" msgid "The target's subsequent state." msgstr "対象の直後の状態。" -#: ../../api.rst:3298 +#: ../../api.rst:3353 msgid "AuditLogChanges" msgstr "AuditLogChanges" -#: ../../api.rst:3304 +#: ../../api.rst:3359 msgid "An audit log change set." msgstr "監査ログの変更のセット。" -#: ../../api.rst:3308 +#: ../../api.rst:3363 msgid "The old value. The attribute has the type of :class:`AuditLogDiff`." msgstr "以前の値。この属性は :class:`AuditLogDiff` 型です。" -#: ../../api.rst:3310 -#: ../../api.rst:3330 +#: ../../api.rst:3365 +#: ../../api.rst:3385 msgid "Depending on the :class:`AuditLogActionCategory` retrieved by :attr:`~AuditLogEntry.category`\\, the data retrieved by this attribute differs:" msgstr ":attr:`~AuditLogEntry.category` で取得される :class:`AuditLogActionCategory` によりこの属性の値が異なります:" -#: ../../api.rst:3315 -#: ../../api.rst:3335 +#: ../../api.rst:3370 +#: ../../api.rst:3390 msgid "Category" msgstr "カテゴリー" -#: ../../api.rst:3317 -#: ../../api.rst:3337 +#: ../../api.rst:3372 +#: ../../api.rst:3392 msgid ":attr:`~AuditLogActionCategory.create`" msgstr ":attr:`~AuditLogActionCategory.create`" -#: ../../api.rst:3317 +#: ../../api.rst:3372 msgid "All attributes are set to ``None``." msgstr "全ての属性は ``None`` です。" -#: ../../api.rst:3319 -#: ../../api.rst:3339 +#: ../../api.rst:3374 +#: ../../api.rst:3394 msgid ":attr:`~AuditLogActionCategory.delete`" msgstr ":attr:`~AuditLogActionCategory.delete`" -#: ../../api.rst:3319 +#: ../../api.rst:3374 msgid "All attributes are set the value before deletion." msgstr "全ての属性は削除前の値に設定されています。" -#: ../../api.rst:3321 -#: ../../api.rst:3341 +#: ../../api.rst:3376 +#: ../../api.rst:3396 msgid ":attr:`~AuditLogActionCategory.update`" msgstr ":attr:`~AuditLogActionCategory.update`" -#: ../../api.rst:3321 +#: ../../api.rst:3376 msgid "All attributes are set the value before updating." msgstr "全ての属性は更新前の値に設定されています。" -#: ../../api.rst:3323 -#: ../../api.rst:3343 +#: ../../api.rst:3378 +#: ../../api.rst:3398 msgid "``None``" msgstr "``None``" -#: ../../api.rst:3323 -#: ../../api.rst:3343 +#: ../../api.rst:3378 +#: ../../api.rst:3398 msgid "No attributes are set." msgstr "属性が設定されていません。" -#: ../../api.rst:3328 +#: ../../api.rst:3383 msgid "The new value. The attribute has the type of :class:`AuditLogDiff`." msgstr "新しい値。この属性は :class:`AuditLogDiff` 型です。" -#: ../../api.rst:3337 +#: ../../api.rst:3392 msgid "All attributes are set to the created value" msgstr "全ての属性は作成時の値に設定されています。" -#: ../../api.rst:3339 +#: ../../api.rst:3394 msgid "All attributes are set to ``None``" msgstr "全ての属性は ``None`` です。" -#: ../../api.rst:3341 +#: ../../api.rst:3396 msgid "All attributes are set the value after updating." msgstr "全ての属性は更新後の値に設定されています。" -#: ../../api.rst:3347 +#: ../../api.rst:3402 msgid "AuditLogDiff" msgstr "AuditLogDiff" -#: ../../api.rst:3353 +#: ../../api.rst:3408 msgid "Represents an audit log \"change\" object. A change object has dynamic attributes that depend on the type of action being done. Certain actions map to certain attributes being set." msgstr "監査ログの「変更」オブジェクト。変更オブジェクトには、行われたアクションの種類によって異なる属性があります。特定のアクションが行われた場合に特定の属性が設定されます。" -#: ../../api.rst:3357 +#: ../../api.rst:3412 msgid "Note that accessing an attribute that does not match the specified action will lead to an attribute error." msgstr "指定されたアクションに一致しない属性にアクセスすると、AttributeErrorが発生することに注意してください。" -#: ../../api.rst:3360 +#: ../../api.rst:3415 msgid "To get a list of attributes that have been set, you can iterate over them. To see a list of all possible attributes that could be set based on the action being done, check the documentation for :class:`AuditLogAction`, otherwise check the documentation below for all attributes that are possible." msgstr "設定された属性のリストを取得するには、イテレートすることができます。 行われたアクションに対応した可能な属性の一覧は、 :class:`AuditLogAction` の説明を確認してください。あるいは、可能なすべての属性について、以下の説明を確認してください。" -#: ../../api.rst:3369 +#: ../../api.rst:3424 msgid "Returns an iterator over (attribute, value) tuple of this diff." msgstr "差分の(属性、値)タプルのイテレーターを返します。" -#: ../../api.rst:3373 +#: ../../api.rst:3428 msgid "A name of something." msgstr "何かの名前。" -#: ../../api.rst:3379 +#: ../../api.rst:3434 +msgid "The guild of something." +msgstr "" + +#: ../../api.rst:3440 msgid "A guild's or role's icon. See also :attr:`Guild.icon` or :attr:`Role.icon`." msgstr "ギルドまたはロールのアイコン。 :attr:`Guild.icon` と :attr:`Role.icon` も参照してください。" -#: ../../api.rst:3385 +#: ../../api.rst:3446 msgid "The guild's invite splash. See also :attr:`Guild.splash`." msgstr "ギルドの招待のスプラッシュ。 :attr:`Guild.splash` も参照してください。" -#: ../../api.rst:3391 +#: ../../api.rst:3452 msgid "The guild's discovery splash. See also :attr:`Guild.discovery_splash`." msgstr "ギルドのディスカバリースプラッシュ。 :attr:`Guild.discovery_splash` も参照してください。" -#: ../../api.rst:3397 +#: ../../api.rst:3458 msgid "The guild's banner. See also :attr:`Guild.banner`." msgstr "ギルドのバナー。 :attr:`Guild.banner` も参照してください。" -#: ../../api.rst:3403 +#: ../../api.rst:3464 msgid "The guild's owner. See also :attr:`Guild.owner`" msgstr "ギルドの所有者。 :attr:`Guild.owner` も参照してください。" -#: ../../api.rst:3405 +#: ../../api.rst:3466 msgid "Union[:class:`Member`, :class:`User`]" msgstr "Union[:class:`Member`, :class:`User`]" -#: ../../api.rst:3409 +#: ../../api.rst:3470 msgid "The guild's AFK channel." msgstr "ギルドのAFKチャンネル。" -#: ../../api.rst:3411 -#: ../../api.rst:3422 +#: ../../api.rst:3472 +#: ../../api.rst:3483 msgid "If this could not be found, then it falls back to a :class:`Object` with the ID being set." msgstr "見つからない場合は、IDが設定された :class:`Object` になります。" -#: ../../api.rst:3414 +#: ../../api.rst:3475 msgid "See :attr:`Guild.afk_channel`." msgstr ":attr:`Guild.afk_channel` を参照してください。" -#: ../../api.rst:3416 +#: ../../api.rst:3477 msgid "Union[:class:`VoiceChannel`, :class:`Object`]" msgstr "Union[:class:`VoiceChannel`, :class:`Object`]" -#: ../../api.rst:3420 +#: ../../api.rst:3481 msgid "The guild's system channel." msgstr "ギルドのシステムチャンネル。" -#: ../../api.rst:3425 +#: ../../api.rst:3486 msgid "See :attr:`Guild.system_channel`." msgstr ":attr:`Guild.system_channel` を参照してください。" -#: ../../api.rst:3427 -#: ../../api.rst:3439 -#: ../../api.rst:3451 -#: ../../api.rst:3478 +#: ../../api.rst:3488 +#: ../../api.rst:3500 +#: ../../api.rst:3512 +#: ../../api.rst:3539 msgid "Union[:class:`TextChannel`, :class:`Object`]" msgstr "Union[:class:`TextChannel`, :class:`Object`]" -#: ../../api.rst:3432 +#: ../../api.rst:3493 msgid "The guild's rules channel." msgstr "ギルドのルールチャンネル。" -#: ../../api.rst:3434 -#: ../../api.rst:3446 -#: ../../api.rst:3475 +#: ../../api.rst:3495 +#: ../../api.rst:3507 +#: ../../api.rst:3536 msgid "If this could not be found then it falls back to a :class:`Object` with the ID being set." msgstr "見つからない場合は、IDが設定された :class:`Object` になります。" -#: ../../api.rst:3437 +#: ../../api.rst:3498 msgid "See :attr:`Guild.rules_channel`." msgstr ":attr:`Guild.rules_channel` を参照してください。" -#: ../../api.rst:3444 +#: ../../api.rst:3505 msgid "The guild's public updates channel." msgstr "ギルドのパブリックアップデートチャンネル。" -#: ../../api.rst:3449 +#: ../../api.rst:3510 msgid "See :attr:`Guild.public_updates_channel`." msgstr ":attr:`Guild.public_updates_channel` を参照してください。" -#: ../../api.rst:3455 +#: ../../api.rst:3516 msgid "The guild's AFK timeout. See :attr:`Guild.afk_timeout`." msgstr "ギルドのAFKタイムアウト。 :attr:`Guild.afk_timeout` も参照してください。" -#: ../../api.rst:3461 +#: ../../api.rst:3522 msgid "The guild's MFA level. See :attr:`Guild.mfa_level`." msgstr "ギルドの多要素認証レベル。 :attr:`Guild.mfa_level` も参照してください。" -#: ../../api.rst:3463 -#: ../../../discord/guild.py:docstring of discord.guild.Guild:179 +#: ../../api.rst:3524 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:173 msgid ":class:`MFALevel`" msgstr ":class:`MFALevel`" -#: ../../api.rst:3467 +#: ../../api.rst:3528 msgid "The guild's widget has been enabled or disabled." msgstr "ギルドのウィジェットが有効化または無効化された。" -#: ../../api.rst:3473 +#: ../../api.rst:3534 msgid "The widget's channel." msgstr "ウィジェットのチャンネル。" -#: ../../api.rst:3482 -#: ../../../discord/guild.py:docstring of discord.guild.Guild:109 +#: ../../api.rst:3543 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:103 msgid "The guild's verification level." msgstr "ギルドの認証レベル。" -#: ../../api.rst:3484 +#: ../../api.rst:3545 msgid "See also :attr:`Guild.verification_level`." msgstr ":attr:`Guild.verification_level` も参照してください。" -#: ../../api.rst:3486 -#: ../../../discord/guild.py:docstring of discord.guild.Guild:111 +#: ../../api.rst:3547 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:105 #: ../../../discord/invite.py:docstring of discord.invite.PartialInviteGuild:40 msgid ":class:`VerificationLevel`" msgstr ":class:`VerificationLevel`" -#: ../../api.rst:3490 +#: ../../api.rst:3551 msgid "The guild's default notification level." msgstr "ギルドのデフォルト通知レベル。" -#: ../../api.rst:3492 +#: ../../api.rst:3553 msgid "See also :attr:`Guild.default_notifications`." msgstr ":attr:`Guild.default_notifications` も参照してください。" -#: ../../api.rst:3494 -#: ../../../discord/guild.py:docstring of discord.guild.Guild:131 +#: ../../api.rst:3555 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:125 msgid ":class:`NotificationLevel`" msgstr ":class:`NotificationLevel`" -#: ../../api.rst:3498 +#: ../../api.rst:3559 msgid "The guild's content filter." msgstr "ギルドのコンテンツフィルター。" -#: ../../api.rst:3500 +#: ../../api.rst:3561 msgid "See also :attr:`Guild.explicit_content_filter`." msgstr ":attr:`Guild.explicit_content_filter` も参照してください。" -#: ../../api.rst:3502 -#: ../../../discord/guild.py:docstring of discord.guild.Guild:125 +#: ../../api.rst:3563 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:119 msgid ":class:`ContentFilter`" msgstr ":class:`ContentFilter`" -#: ../../api.rst:3506 +#: ../../api.rst:3567 msgid "The guild's vanity URL." msgstr "ギルドのバニティURL。" -#: ../../api.rst:3508 +#: ../../api.rst:3569 msgid "See also :meth:`Guild.vanity_invite` and :meth:`Guild.edit`." msgstr ":meth:`Guild.vanity_invite` と :meth:`Guild.edit` も参照してください。" -#: ../../api.rst:3514 +#: ../../api.rst:3575 msgid "The position of a :class:`Role` or :class:`abc.GuildChannel`." msgstr ":class:`Role` や :class:`abc.GuildChannel` の位置。" -#: ../../api.rst:3520 -msgid "The type of channel, sticker or integration." -msgstr "チャンネル、スタンプまたは連携サービスのタイプ。" +#: ../../api.rst:3581 +msgid "The type of channel, sticker, webhook or integration." +msgstr "" -#: ../../api.rst:3522 -msgid "Union[:class:`ChannelType`, :class:`StickerType`, :class:`str`]" -msgstr "Union[:class:`ChannelType`, :class:`StickerType`, :class:`str`]" +#: ../../api.rst:3583 +msgid "Union[:class:`ChannelType`, :class:`StickerType`, :class:`WebhookType`, :class:`str`]" +msgstr "" -#: ../../api.rst:3526 +#: ../../api.rst:3587 msgid "The topic of a :class:`TextChannel` or :class:`StageChannel`." msgstr ":class:`TextChannel` または :class:`StageChannel` のトピック。" -#: ../../api.rst:3528 +#: ../../api.rst:3589 msgid "See also :attr:`TextChannel.topic` or :attr:`StageChannel.topic`." msgstr ":attr:`TextChannel.topic` または :attr:`StageChannel.topic` も参照してください。" -#: ../../api.rst:3534 +#: ../../api.rst:3595 msgid "The bitrate of a :class:`VoiceChannel`." msgstr ":class:`VoiceChannel` のビットレート。" -#: ../../api.rst:3536 +#: ../../api.rst:3597 msgid "See also :attr:`VoiceChannel.bitrate`." msgstr ":attr:`VoiceChannel.bitrate` も参照してください。" -#: ../../api.rst:3542 +#: ../../api.rst:3603 msgid "A list of permission overwrite tuples that represents a target and a :class:`PermissionOverwrite` for said target." msgstr "対象とその :class:`PermissionOverwrite` のタプルで示された権限の上書きのリスト。" -#: ../../api.rst:3545 +#: ../../api.rst:3606 msgid "The first element is the object being targeted, which can either be a :class:`Member` or :class:`User` or :class:`Role`. If this object is not found then it is a :class:`Object` with an ID being filled and a ``type`` attribute set to either ``'role'`` or ``'member'`` to help decide what type of ID it is." msgstr "最初の要素は対象のオブジェクトで、 :class:`Member` か :class:`User` か :class:`Role` です。このオブジェクトが見つからない場合はこれはIDが設定され、 ``type`` 属性が ``'role'`` か ``'member'`` に設定された :class:`Object` になります。" -#: ../../api.rst:3551 +#: ../../api.rst:3612 msgid "List[Tuple[target, :class:`PermissionOverwrite`]]" msgstr "List[Tuple[target, :class:`PermissionOverwrite`]]" -#: ../../api.rst:3555 +#: ../../api.rst:3616 msgid "The privacy level of the stage instance or scheduled event" msgstr "ステージインスタンスやスケジュールイベントのプライバシーレベル。" -#: ../../api.rst:3557 +#: ../../api.rst:3618 #: ../../../discord/scheduled_event.py:docstring of discord.scheduled_event.ScheduledEvent:65 #: ../../../discord/stage_instance.py:docstring of discord.stage_instance.StageInstance:47 msgid ":class:`PrivacyLevel`" msgstr ":class:`PrivacyLevel`" -#: ../../api.rst:3561 +#: ../../api.rst:3622 msgid "A list of roles being added or removed from a member." msgstr "メンバーから追加または削除されたロールのリスト。" -#: ../../api.rst:3563 +#: ../../api.rst:3624 msgid "If a role is not found then it is a :class:`Object` with the ID and name being filled in." msgstr "ロールが見つからない場合は、IDとnameが設定された :class:`Object` になります。" -#: ../../api.rst:3566 -#: ../../api.rst:3907 +#: ../../api.rst:3627 +#: ../../api.rst:3968 msgid "List[Union[:class:`Role`, :class:`Object`]]" msgstr "List[Union[:class:`Role`, :class:`Object`]]" -#: ../../api.rst:3570 +#: ../../api.rst:3631 msgid "The nickname of a member." msgstr "メンバーのニックネーム。" -#: ../../api.rst:3572 +#: ../../api.rst:3633 msgid "See also :attr:`Member.nick`" msgstr ":attr:`Member.nick` も参照してください。" -#: ../../api.rst:3578 +#: ../../api.rst:3639 msgid "Whether the member is being server deafened." msgstr "メンバーがサーバーでスピーカーミュートされているかどうか。" -#: ../../api.rst:3580 +#: ../../api.rst:3641 msgid "See also :attr:`VoiceState.deaf`." msgstr ":attr:`VoiceState.deaf` も参照してください。" -#: ../../api.rst:3586 +#: ../../api.rst:3647 msgid "Whether the member is being server muted." msgstr "メンバーがサーバーでミュートされているかどうか。" -#: ../../api.rst:3588 +#: ../../api.rst:3649 msgid "See also :attr:`VoiceState.mute`." msgstr ":attr:`VoiceState.mute` も参照してください。" -#: ../../api.rst:3594 +#: ../../api.rst:3655 msgid "The permissions of a role." msgstr "ロールの権限。" -#: ../../api.rst:3596 +#: ../../api.rst:3657 msgid "See also :attr:`Role.permissions`." msgstr ":attr:`Role.permissions` も参照してください。" -#: ../../api.rst:3603 +#: ../../api.rst:3664 msgid "The colour of a role." msgstr "ロールの色。" -#: ../../api.rst:3605 +#: ../../api.rst:3666 msgid "See also :attr:`Role.colour`" msgstr ":attr:`Role.colour` も参照してください。" -#: ../../api.rst:3611 +#: ../../api.rst:3672 msgid "Whether the role is being hoisted or not." msgstr "役割が別に表示されるかどうか。" -#: ../../api.rst:3613 +#: ../../api.rst:3674 msgid "See also :attr:`Role.hoist`" msgstr ":attr:`Role.hoist` も参照してください。" -#: ../../api.rst:3619 +#: ../../api.rst:3680 msgid "Whether the role is mentionable or not." msgstr "役割がメンションできるかどうか。" -#: ../../api.rst:3621 +#: ../../api.rst:3682 msgid "See also :attr:`Role.mentionable`" msgstr ":attr:`Role.mentionable` も参照してください。" -#: ../../api.rst:3627 +#: ../../api.rst:3688 msgid "The invite's code." msgstr "招待のコード。" -#: ../../api.rst:3629 +#: ../../api.rst:3690 msgid "See also :attr:`Invite.code`" msgstr ":attr:`Invite.code` も参照してください。" -#: ../../api.rst:3635 +#: ../../api.rst:3696 msgid "A guild channel." msgstr "ギルドのチャンネル。" -#: ../../api.rst:3637 +#: ../../api.rst:3698 msgid "If the channel is not found then it is a :class:`Object` with the ID being set. In some cases the channel name is also set." msgstr "チャンネルが見つからない場合は、IDが設定された :class:`Object` になります。 場合によっては、チャンネル名も設定されています。" -#: ../../api.rst:3640 +#: ../../api.rst:3701 msgid "Union[:class:`abc.GuildChannel`, :class:`Object`]" msgstr "Union[:class:`abc.GuildChannel`, :class:`Object`]" -#: ../../api.rst:3644 +#: ../../api.rst:3705 #: ../../../discord/invite.py:docstring of discord.invite.Invite:101 msgid "The user who created the invite." msgstr "招待を作成したユーザー。" -#: ../../api.rst:3646 +#: ../../api.rst:3707 msgid "See also :attr:`Invite.inviter`." msgstr ":attr:`Invite.inviter` も参照してください。" -#: ../../api.rst:3648 +#: ../../api.rst:3709 #: ../../../discord/scheduled_event.py:docstring of discord.scheduled_event.ScheduledEvent:83 #: ../../../discord/integrations.py:docstring of discord.integrations.IntegrationApplication:39 #: ../../../discord/emoji.py:docstring of discord.emoji.Emoji:76 @@ -6720,96 +6813,97 @@ msgstr ":attr:`Invite.inviter` も参照してください。" msgid "Optional[:class:`User`]" msgstr "Optional[:class:`User`]" -#: ../../api.rst:3652 +#: ../../api.rst:3713 msgid "The invite's max uses." msgstr "招待の最大使用回数。" -#: ../../api.rst:3654 +#: ../../api.rst:3715 msgid "See also :attr:`Invite.max_uses`." msgstr ":attr:`Invite.max_uses` も参照してください。" -#: ../../api.rst:3660 +#: ../../api.rst:3721 msgid "The invite's current uses." msgstr "招待の現在の使用回数。" -#: ../../api.rst:3662 +#: ../../api.rst:3723 msgid "See also :attr:`Invite.uses`." msgstr ":attr:`Invite.uses` も参照してください。" -#: ../../api.rst:3668 +#: ../../api.rst:3729 msgid "The invite's max age in seconds." msgstr "招待者の最大時間は秒数です。" -#: ../../api.rst:3670 +#: ../../api.rst:3731 msgid "See also :attr:`Invite.max_age`." msgstr ":attr:`Invite.max_age` も参照してください。" -#: ../../api.rst:3676 +#: ../../api.rst:3737 msgid "If the invite is a temporary invite." msgstr "招待が一時的な招待であるか。" -#: ../../api.rst:3678 +#: ../../api.rst:3739 msgid "See also :attr:`Invite.temporary`." msgstr ":attr:`Invite.temporary` も参照してください。" -#: ../../api.rst:3685 +#: ../../api.rst:3746 msgid "The permissions being allowed or denied." msgstr "許可または拒否された権限。" -#: ../../api.rst:3691 +#: ../../api.rst:3752 msgid "The ID of the object being changed." msgstr "変更されたオブジェクトのID。" -#: ../../api.rst:3697 +#: ../../api.rst:3758 msgid "The avatar of a member." msgstr "メンバーのアバター。" -#: ../../api.rst:3699 +#: ../../api.rst:3760 msgid "See also :attr:`User.avatar`." msgstr ":attr:`User.avatar` も参照してください。" -#: ../../api.rst:3705 +#: ../../api.rst:3766 msgid "The number of seconds members have to wait before sending another message in the channel." msgstr "メンバーが別のメッセージをチャンネルに送信するまでの秒単位の待ち時間。" -#: ../../api.rst:3708 +#: ../../api.rst:3769 msgid "See also :attr:`TextChannel.slowmode_delay`." msgstr ":attr:`TextChannel.slowmode_delay` も参照してください。" -#: ../../api.rst:3714 +#: ../../api.rst:3775 msgid "The region for the voice channel’s voice communication. A value of ``None`` indicates automatic voice region detection." msgstr "ボイスチャンネルの音声通信のためのリージョン。値が ``None`` の場合は自動で検出されます。" -#: ../../api.rst:3717 +#: ../../api.rst:3778 msgid "See also :attr:`VoiceChannel.rtc_region`." msgstr ":attr:`VoiceChannel.rtc_region` も参照してください。" -#: ../../api.rst:3723 +#: ../../api.rst:3784 #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_voice_channel:31 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:37 #: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel:86 #: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.edit:49 msgid "The camera video quality for the voice channel's participants." msgstr "ボイスチャンネル参加者のカメラビデオの画質。" -#: ../../api.rst:3725 +#: ../../api.rst:3786 msgid "See also :attr:`VoiceChannel.video_quality_mode`." msgstr ":attr:`VoiceChannel.video_quality_mode` も参照してください。" -#: ../../api.rst:3727 +#: ../../api.rst:3788 #: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel:90 #: ../../../discord/channel.py:docstring of discord.channel.StageChannel:93 msgid ":class:`VideoQualityMode`" msgstr ":class:`VideoQualityMode`" -#: ../../api.rst:3731 +#: ../../api.rst:3792 msgid "The format type of a sticker being changed." msgstr "変更されたスタンプのフォーマットの種類。" -#: ../../api.rst:3733 +#: ../../api.rst:3794 msgid "See also :attr:`GuildSticker.format`" msgstr ":attr:`GuildSticker.format` も参照してください。" -#: ../../api.rst:3735 +#: ../../api.rst:3796 #: ../../../discord/sticker.py:docstring of discord.sticker.StickerItem:35 #: ../../../discord/sticker.py:docstring of discord.sticker.Sticker:47 #: ../../../discord/sticker.py:docstring of discord.sticker.StandardSticker:47 @@ -6817,67 +6911,67 @@ msgstr ":attr:`GuildSticker.format` も参照してください。" msgid ":class:`StickerFormatType`" msgstr ":class:`StickerFormatType`" -#: ../../api.rst:3739 +#: ../../api.rst:3800 msgid "The name of the emoji that represents a sticker being changed." msgstr "変更されたスタンプを示す絵文字の名前。" -#: ../../api.rst:3741 +#: ../../api.rst:3802 msgid "See also :attr:`GuildSticker.emoji`." msgstr ":attr:`GuildSticker.emoji` も参照してください。" -#: ../../api.rst:3747 +#: ../../api.rst:3808 msgid "The unicode emoji that is used as an icon for the role being changed." msgstr "変更されたロールのアイコンとして使用されるUnicode絵文字。" -#: ../../api.rst:3749 +#: ../../api.rst:3810 msgid "See also :attr:`Role.unicode_emoji`." msgstr ":attr:`Role.unicode_emoji` も参照してください。" -#: ../../api.rst:3755 +#: ../../api.rst:3816 msgid "The description of a guild, a sticker, or a scheduled event." msgstr "ギルド、スタンプ、またはスケジュールイベントの説明。" -#: ../../api.rst:3757 +#: ../../api.rst:3818 msgid "See also :attr:`Guild.description`, :attr:`GuildSticker.description`, or :attr:`ScheduledEvent.description`." msgstr ":attr:`Guild.description` 、 :attr:`GuildSticker.description` 、または :attr:`ScheduledEvent.description` も参照してください。" -#: ../../api.rst:3764 +#: ../../api.rst:3825 msgid "The availability of a sticker being changed." msgstr "変更されたスタンプの利用可能かどうかの状態。" -#: ../../api.rst:3766 +#: ../../api.rst:3827 msgid "See also :attr:`GuildSticker.available`" msgstr ":attr:`GuildSticker.available` も参照してください。" -#: ../../api.rst:3772 +#: ../../api.rst:3833 msgid "The thread is now archived." msgstr "スレッドがアーカイブされたか。" -#: ../../api.rst:3778 +#: ../../api.rst:3839 msgid "The thread is being locked or unlocked." msgstr "スレッドがロックされ、またはロックが解除されたかどうか。" -#: ../../api.rst:3784 +#: ../../api.rst:3845 msgid "The thread's auto archive duration being changed." msgstr "変更されたスレッドの自動アーカイブ期間。" -#: ../../api.rst:3786 +#: ../../api.rst:3847 msgid "See also :attr:`Thread.auto_archive_duration`" msgstr ":attr:`Thread.auto_archive_duration` も参照してください。" -#: ../../api.rst:3792 +#: ../../api.rst:3853 msgid "The default auto archive duration for newly created threads being changed." msgstr "変更された新規作成されたスレッドの既定の自動アーカイブ期間。" -#: ../../api.rst:3798 +#: ../../api.rst:3859 msgid "Whether non-moderators can add users to this private thread." msgstr "モデレータ以外がプライベートスレッドにユーザーを追加できるかどうか。" -#: ../../api.rst:3804 +#: ../../api.rst:3865 msgid "Whether the user is timed out, and if so until when." msgstr "ユーザーがタイムアウトされているかどうか、そしてその場合はいつまでか。" -#: ../../api.rst:3806 +#: ../../api.rst:3867 #: ../../../discord/webhook/async_.py:docstring of discord.WebhookMessage.edited_at:3 #: ../../../discord/message.py:docstring of discord.Message.edited_at:3 #: ../../../discord/scheduled_event.py:docstring of discord.scheduled_event.ScheduledEvent:59 @@ -6885,150 +6979,238 @@ msgstr "ユーザーがタイムアウトされているかどうか、そして msgid "Optional[:class:`datetime.datetime`]" msgstr "Optional[:class:`datetime.datetime`]" -#: ../../api.rst:3810 +#: ../../api.rst:3871 msgid "Integration emoticons were enabled or disabled." msgstr "連携サービスの絵文字が有効化され、または無効化されたか。" -#: ../../api.rst:3812 +#: ../../api.rst:3873 msgid "See also :attr:`StreamIntegration.enable_emoticons`" msgstr ":attr:`StreamIntegration.enable_emoticons` も参照してください。" -#: ../../api.rst:3819 +#: ../../api.rst:3880 msgid "The behaviour of expiring subscribers changed." msgstr "変更された期限切れのサブスクライバーの動作。" -#: ../../api.rst:3821 +#: ../../api.rst:3882 msgid "See also :attr:`StreamIntegration.expire_behaviour`" msgstr ":attr:`StreamIntegration.expire_behaviour` も参照してください。" -#: ../../api.rst:3823 +#: ../../api.rst:3884 #: ../../../discord/integrations.py:docstring of discord.integrations.StreamIntegration:51 #: ../../../discord/integrations.py:docstring of discord.StreamIntegration.expire_behavior:3 msgid ":class:`ExpireBehaviour`" msgstr ":class:`ExpireBehaviour`" -#: ../../api.rst:3827 +#: ../../api.rst:3888 msgid "The grace period before expiring subscribers changed." msgstr "変更された期限切れのサブスクライバーの猶予期間。" -#: ../../api.rst:3829 +#: ../../api.rst:3890 msgid "See also :attr:`StreamIntegration.expire_grace_period`" msgstr ":attr:`StreamIntegration.expire_grace_period` も参照してください。" -#: ../../api.rst:3835 +#: ../../api.rst:3896 msgid "The preferred locale for the guild changed." msgstr "変更されたギルドの優先ローケル。" -#: ../../api.rst:3837 +#: ../../api.rst:3898 msgid "See also :attr:`Guild.preferred_locale`" msgstr ":attr:`Guild.preferred_locale` も参照してください。" -#: ../../api.rst:3839 -#: ../../../discord/guild.py:docstring of discord.guild.Guild:162 +#: ../../api.rst:3900 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:156 msgid ":class:`Locale`" msgstr ":class:`Locale`" -#: ../../api.rst:3843 +#: ../../api.rst:3904 msgid "The number of days after which inactive and role-unassigned members are kicked has been changed." msgstr "変更された活動していない、かつロールが割り当てられていないメンバーがキックさえるまでの日数。" -#: ../../api.rst:3849 +#: ../../api.rst:3910 #: ../../../discord/scheduled_event.py:docstring of discord.scheduled_event.ScheduledEvent:69 msgid "The status of the scheduled event." msgstr "スケジュールイベントのステータス。" -#: ../../api.rst:3851 +#: ../../api.rst:3912 #: ../../../discord/scheduled_event.py:docstring of discord.scheduled_event.ScheduledEvent:71 msgid ":class:`EventStatus`" msgstr ":class:`EventStatus`" -#: ../../api.rst:3855 +#: ../../api.rst:3916 msgid "The type of entity this scheduled event is for." msgstr "スケジュールイベントの開催場所の種類。" -#: ../../api.rst:3857 +#: ../../api.rst:3918 #: ../../../discord/scheduled_event.py:docstring of discord.scheduled_event.ScheduledEvent:41 msgid ":class:`EntityType`" msgstr ":class:`EntityType`" -#: ../../api.rst:3861 +#: ../../api.rst:3922 #: ../../../discord/scheduled_event.py:docstring of discord.ScheduledEvent.cover_image:1 msgid "The scheduled event's cover image." msgstr "スケジュールイベントのカバー画像。" -#: ../../api.rst:3863 +#: ../../api.rst:3924 msgid "See also :attr:`ScheduledEvent.cover_image`." msgstr ":attr:`ScheduledEvent.cover_image` も参照してください。" -#: ../../api.rst:3869 +#: ../../api.rst:3930 msgid "List of permissions for the app command." msgstr "アプリケーションコマンドの権限のリスト。" -#: ../../api.rst:3871 +#: ../../api.rst:3932 #: ../../../discord/raw_models.py:docstring of discord.raw_models.RawAppCommandPermissionsUpdateEvent:29 msgid "List[:class:`~discord.app_commands.AppCommandPermissions`]" msgstr "List[:class:`~discord.app_commands.AppCommandPermissions`]" -#: ../../api.rst:3875 +#: ../../api.rst:3936 msgid "Whether the automod rule is active or not." msgstr "自動管理ルールが有効かどうか。" -#: ../../api.rst:3881 +#: ../../api.rst:3942 msgid "The event type for triggering the automod rule." msgstr "自動管理ルールを発動させるイベントの種類。" -#: ../../api.rst:3883 +#: ../../api.rst:3944 msgid ":class:`AutoModRuleEventType`" msgstr ":class:`AutoModRuleEventType`" -#: ../../api.rst:3887 +#: ../../api.rst:3948 msgid "The trigger type for the automod rule." msgstr "自動管理ルールの発動条件の種類。" -#: ../../api.rst:3889 +#: ../../api.rst:3950 #: ../../../discord/automod.py:docstring of discord.automod.AutoModAction:28 #: ../../../discord/automod.py:docstring of discord.automod.AutoModTrigger:24 msgid ":class:`AutoModRuleTriggerType`" msgstr ":class:`AutoModRuleTriggerType`" -#: ../../api.rst:3893 +#: ../../api.rst:3954 msgid "The trigger for the automod rule." msgstr "自動管理ルールの発動条件。" -#: ../../api.rst:3895 +#: ../../api.rst:3956 #: ../../../discord/automod.py:docstring of discord.automod.AutoModRule:33 msgid ":class:`AutoModTrigger`" msgstr ":class:`AutoModTrigger`" -#: ../../api.rst:3899 +#: ../../api.rst:3960 msgid "The actions to take when an automod rule is triggered." msgstr "自動管理ルールの発動時の対応。" -#: ../../api.rst:3901 +#: ../../api.rst:3962 msgid "List[AutoModRuleAction]" msgstr "List[AutoModRuleAction]" -#: ../../api.rst:3905 +#: ../../api.rst:3966 msgid "The list of roles that are exempt from the automod rule." msgstr "自動管理ルールの除外対象のロールのリスト。" -#: ../../api.rst:3911 +#: ../../api.rst:3972 msgid "The list of channels or threads that are exempt from the automod rule." msgstr "自動管理ルールの除外対象のチャンネルまたはスレッドのリスト。" -#: ../../api.rst:3913 +#: ../../api.rst:3974 msgid "List[:class:`abc.GuildChannel`, :class:`Thread`, :class:`Object`]" msgstr "List[:class:`abc.GuildChannel`, :class:`Thread`, :class:`Object`]" -#: ../../api.rst:3919 +#: ../../api.rst:3978 +msgid "The guild’s display setting to show boost progress bar." +msgstr "" + +#: ../../api.rst:3984 +msgid "The guild’s system channel settings." +msgstr "" + +#: ../../api.rst:3986 +msgid "See also :attr:`Guild.system_channel_flags`" +msgstr "" + +#: ../../api.rst:3988 +#: ../../../discord/guild.py:docstring of discord.Guild.system_channel_flags:3 +msgid ":class:`SystemChannelFlags`" +msgstr ":class:`SystemChannelFlags`" + +#: ../../api.rst:3992 +msgid "Whether the channel is marked as “not safe for work” or “age restricted”." +msgstr "" + +#: ../../api.rst:3998 +msgid "The channel’s limit for number of members that can be in a voice or stage channel." +msgstr "" + +#: ../../api.rst:4000 +msgid "See also :attr:`VoiceChannel.user_limit` and :attr:`StageChannel.user_limit`" +msgstr "" + +#: ../../api.rst:4006 +msgid "The channel flags associated with this thread or forum post." +msgstr "" + +#: ../../api.rst:4008 +msgid "See also :attr:`ForumChannel.flags` and :attr:`Thread.flags`" +msgstr "" + +#: ../../api.rst:4010 +#: ../../../discord/channel.py:docstring of discord.ForumChannel.flags:5 +#: ../../../discord/threads.py:docstring of discord.Thread.flags:3 +msgid ":class:`ChannelFlags`" +msgstr ":class:`ChannelFlags`" + +#: ../../api.rst:4014 +msgid "The default slowmode delay for threads created in this text channel or forum." +msgstr "" + +#: ../../api.rst:4016 +msgid "See also :attr:`TextChannel.default_thread_slowmode_delay` and :attr:`ForumChannel.default_thread_slowmode_delay`" +msgstr "" + +#: ../../api.rst:4022 +msgid "The applied tags of a forum post." +msgstr "" + +#: ../../api.rst:4024 +msgid "See also :attr:`Thread.applied_tags`" +msgstr "" + +#: ../../api.rst:4026 +msgid "List[Union[:class:`ForumTag`, :class:`Object`]]" +msgstr "" + +#: ../../api.rst:4030 +msgid "The available tags of a forum." +msgstr "" + +#: ../../api.rst:4032 +msgid "See also :attr:`ForumChannel.available_tags`" +msgstr "" + +#: ../../api.rst:4034 +#: ../../../discord/channel.py:docstring of discord.ForumChannel.available_tags:5 +msgid "Sequence[:class:`ForumTag`]" +msgstr "Sequence[:class:`ForumTag`]" + +#: ../../api.rst:4038 +msgid "The default_reaction_emoji for forum posts." +msgstr "" + +#: ../../api.rst:4040 +msgid "See also :attr:`ForumChannel.default_reaction_emoji`" +msgstr "" + +#: ../../api.rst:4042 +msgid ":class:`default_reaction_emoji`" +msgstr "" + +#: ../../api.rst:4048 msgid "Webhook Support" msgstr "Webhookサポート" -#: ../../api.rst:3921 +#: ../../api.rst:4050 msgid "discord.py offers support for creating, editing, and executing webhooks through the :class:`Webhook` class." msgstr "discord.pyは、 :class:`Webhook` クラスからWebhookの作成、編集、実行をサポートします。" -#: ../../api.rst:3924 +#: ../../api.rst:4053 msgid "Webhook" msgstr "Webhook" @@ -7163,23 +7345,31 @@ msgstr "リクエストを送信するために使用するセッション。ラ #: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.partial:13 #: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.from_url:15 +msgid "The client to initialise this webhook with. This allows it to attach the client's internal state. If ``session`` is not given while this is given then the client's internal session will be used." +msgstr "" + +#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.partial:19 +#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.from_url:21 #: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.partial:12 #: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.from_url:10 msgid "The bot authentication token for authenticated requests involving the webhook." msgstr "Webhook関連の認証が必要なリクエストに使用するボットの認証トークン。" -#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.partial:19 -#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.from_url:23 -#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.partial:16 -#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.from_url:16 +#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.partial:25 +#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.from_url:28 +msgid "Neither ``session`` nor ``client`` were given." +msgstr "" + +#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.partial:27 +#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.from_url:30 msgid "A partial :class:`Webhook`. A partial webhook is just a webhook object with an ID and a token." msgstr "部分的な :class:`Webhook` 。部分的なWebhookはただのIDとトークンのみを持つWebhookオブジェクトです。" -#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.partial:21 -#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.from_url:25 +#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.partial:29 +#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.from_url:32 #: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.fetch:24 -#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.partial:18 -#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.from_url:18 +#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_webhook:22 +#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.follow:31 msgid ":class:`Webhook`" msgstr ":class:`Webhook`" @@ -7193,7 +7383,7 @@ msgstr "WebhookのURLから部分的な :class:`Webhook` を作成します。" msgid "The URL of the webhook." msgstr "WebhookのURL。" -#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.from_url:21 +#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.from_url:27 #: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.from_url:14 msgid "The URL is invalid." msgstr "URLが無効な場合。" @@ -7468,39 +7658,47 @@ msgstr "Webhookが :class:`~discord.ForumChannel` に属する場合、このWeb msgid "Whether to suppress embeds for the message. This sends the message without any embeds if set to ``True``." msgstr "メッセージの埋め込みを抑制するかどうか。これが ``True`` に設定されている場合、埋め込みなしでメッセージを送信します。" -#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.send:79 +#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.send:78 +#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.send:57 +#: ../../../discord/abc.py:docstring of discord.abc.Messageable.send:76 +#: ../../../discord/user.py:docstring of discord.abc.Messageable.send:76 +#: ../../../discord/member.py:docstring of discord.abc.Messageable.send:76 +msgid "Whether to suppress push and desktop notifications for the message. This will increment the mention counter in the UI, but will not actually send a notification." +msgstr "" + +#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.send:84 #: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.reply:12 -#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.send:58 -#: ../../../discord/abc.py:docstring of discord.abc.Messageable.send:77 -#: ../../../discord/user.py:docstring of discord.abc.Messageable.send:77 +#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.send:63 +#: ../../../discord/abc.py:docstring of discord.abc.Messageable.send:82 +#: ../../../discord/user.py:docstring of discord.abc.Messageable.send:82 msgid "Sending the message failed." msgstr "メッセージの送信に失敗した場合。" -#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.send:80 -#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.send:59 +#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.send:85 +#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.send:64 msgid "This webhook was not found." msgstr "Webhookが見つからなかった場合。" -#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.send:81 -#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.send:60 +#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.send:86 +#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.send:65 msgid "The authorization token for the webhook is incorrect." msgstr "Webhookの認証トークンが正しくない場合。" -#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.send:82 -#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.send:61 +#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.send:87 +#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.send:66 msgid "You specified both ``embed`` and ``embeds`` or ``file`` and ``files`` or ``thread`` and ``thread_name``." msgstr "``embed`` と ``embeds`` または ``file`` と ``files`` または ``thread`` と ``thread_name`` の両方を指定した場合。" -#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.send:83 +#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.send:88 msgid "The length of ``embeds`` was invalid, there was no token associated with this webhook or ``ephemeral`` was passed with the improper webhook type or there was no state attached with this webhook when giving it a view." msgstr "``embeds`` の長さが不正な場合、Webhookにトークンが紐づいていない場合、 ``ephemeral`` が適切でない種類のWebhookに渡された場合、またはステートが付属していないWebhookにビューを渡した場合。" -#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.send:85 -#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.send:64 +#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.send:90 +#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.send:69 msgid "If ``wait`` is ``True`` then the message that was sent, otherwise ``None``." msgstr "``wait`` が ``True`` のとき、送信されたメッセージ、それ以外の場合は ``None`` 。" -#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.send:86 +#: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.Webhook.send:91 msgid "Optional[:class:`WebhookMessage`]" msgstr "Optional[:class:`WebhookMessage`]" @@ -7701,7 +7899,7 @@ msgstr "メッセージの削除に失敗した場合。" msgid "Deleted a message that is not yours." msgstr "自分以外のメッセージを削除しようとした場合。" -#: ../../api.rst:3933 +#: ../../api.rst:4062 msgid "WebhookMessage" msgstr "WebhookMessage" @@ -7741,7 +7939,7 @@ msgid "The updated view to update this message with. If ``None`` is passed then msgstr "このメッセージを更新するために更新されたビュー。 ``None`` が渡された場合、ビューは削除されます。" #: ../../../discord/webhook/async_.py:docstring of discord.webhook.async_.WebhookMessage.edit:42 -#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.send:62 +#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.send:67 #: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.edit_message:33 #: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhookMessage.edit:30 msgid "The length of ``embeds`` was invalid or there was no token associated with this webhook." @@ -7969,54 +8167,70 @@ msgstr "スレッドの名前。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_thread:16 #: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_thread:13 #: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:14 -msgid "The duration in minutes before a thread is automatically archived for inactivity. If not provided, the channel's default auto archive duration is used." -msgstr "スレッドが非アクティブ時に、自動的にアーカイブされるまでの分単位の時間。指定しない場合は、チャンネルのデフォルトの自動アーカイブ期間が使用されます。" +msgid "The duration in minutes before a thread is automatically hidden from the channel list. If not provided, the channel's default auto archive duration is used. Must be one of ``60``, ``1440``, ``4320``, or ``10080``, if provided." +msgstr "" + +#: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.create_thread:14 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:14 +#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_thread:16 +#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_thread:13 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:14 +msgid "The duration in minutes before a thread is automatically hidden from the channel list. If not provided, the channel's default auto archive duration is used." +msgstr "" #: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.create_thread:17 #: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:17 -#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_thread:28 +#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_thread:19 #: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_thread:16 #: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:17 +msgid "Must be one of ``60``, ``1440``, ``4320``, or ``10080``, if provided." +msgstr "" + +#: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.create_thread:19 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:19 +#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_thread:30 +#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_thread:18 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:19 msgid "Specifies the slowmode rate limit for user in this channel, in seconds. The maximum value possible is ``21600``. By default no slowmode rate limit if this is ``None``." msgstr "このチャンネルの秒単位での低速モードレート制限。 最大値は ``21600`` です。デフォルトは ``None`` でこの場合は低速モードレート制限が無しとなります。" -#: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.create_thread:21 -#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:21 -#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_thread:23 -#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_thread:49 -#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:21 +#: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.create_thread:23 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:23 +#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_thread:25 +#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_thread:51 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:23 msgid "The reason for creating a new thread. Shows up on the audit log." msgstr "スレッドを作成する理由。監査ログに表示されます。" -#: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.create_thread:24 -#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:24 -#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_thread:33 -#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_thread:52 -#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:24 +#: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.create_thread:26 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:26 +#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_thread:35 +#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_thread:54 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:26 msgid "You do not have permissions to create a thread." msgstr "スレッドを作成する権限を持っていない場合。" -#: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.create_thread:25 -#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:25 -#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:25 +#: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.create_thread:27 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:27 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:27 msgid "Creating the thread failed." msgstr "スレッドの作成に失敗した場合。" -#: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.create_thread:26 -#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:26 -#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:26 -msgid "This message does not have guild info attached." -msgstr "メッセージがギルド情報を持っていない場合。" - #: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.create_thread:28 #: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:28 #: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:28 +msgid "This message does not have guild info attached." +msgstr "メッセージがギルド情報を持っていない場合。" + +#: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.create_thread:30 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:30 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:30 msgid "The created thread." msgstr "作成されたスレッド。" -#: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.create_thread:29 -#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:29 -#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:29 +#: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.create_thread:31 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:31 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage.create_thread:31 msgid ":class:`.Thread`" msgstr ":class:`.Thread`" @@ -8115,30 +8329,30 @@ msgstr "チャンネルにすでに50個ピン留めされたメッセージが #: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.publish:3 #: ../../../discord/message.py:docstring of discord.message.PartialMessage.publish:3 #: ../../../discord/message.py:docstring of discord.message.PartialMessage.publish:3 -msgid "Publishes this message to your announcement channel." -msgstr "アナウンスチャンネルのメッセージを公開します。" +msgid "Publishes this message to the channel's followers." +msgstr "" #: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.publish:5 #: ../../../discord/message.py:docstring of discord.message.PartialMessage.publish:5 #: ../../../discord/message.py:docstring of discord.message.PartialMessage.publish:5 -msgid "You must have :attr:`~Permissions.send_messages` to do this." -msgstr "これを行うには、 :attr:`~Permissions.send_messages` が必要です。" +msgid "The message must have been sent in a news channel. You must have :attr:`~Permissions.send_messages` to do this." +msgstr "" -#: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.publish:7 -#: ../../../discord/message.py:docstring of discord.message.PartialMessage.publish:7 -#: ../../../discord/message.py:docstring of discord.message.PartialMessage.publish:7 +#: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.publish:8 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage.publish:8 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage.publish:8 msgid "If the message is not your own then :attr:`~Permissions.manage_messages` is also needed." msgstr "自身のメッセージ以外の場合は :attr:`~Permissions.manage_messages` も必要です。" -#: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.publish:10 -#: ../../../discord/message.py:docstring of discord.message.PartialMessage.publish:10 -#: ../../../discord/message.py:docstring of discord.message.PartialMessage.publish:10 -msgid "You do not have the proper permissions to publish this message." -msgstr "メッセージを公開する適切な権限がない場合。" - #: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.publish:11 #: ../../../discord/message.py:docstring of discord.message.PartialMessage.publish:11 #: ../../../discord/message.py:docstring of discord.message.PartialMessage.publish:11 +msgid "You do not have the proper permissions to publish this message or the channel is not a news channel." +msgstr "" + +#: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.publish:12 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage.publish:12 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage.publish:12 msgid "Publishing the message failed." msgstr "メッセージの公開に失敗した場合。" @@ -8235,10 +8449,10 @@ msgid "This function will now raise :exc:`TypeError` or :exc:`ValueError` instea msgstr "この関数は ``InvalidArgument`` の代わりに :exc:`TypeError` や :exc:`ValueError` を送出します。" #: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.reply:13 -#: ../../../discord/abc.py:docstring of discord.abc.Messageable.send:78 -#: ../../../discord/user.py:docstring of discord.abc.Messageable.send:78 +#: ../../../discord/abc.py:docstring of discord.abc.Messageable.send:83 +#: ../../../discord/user.py:docstring of discord.abc.Messageable.send:83 #: ../../../discord/message.py:docstring of discord.message.PartialMessage.reply:13 -#: ../../../discord/member.py:docstring of discord.abc.Messageable.send:78 +#: ../../../discord/member.py:docstring of discord.abc.Messageable.send:83 msgid "You do not have the proper permissions to send the message." msgstr "メッセージを送信する適切な権限がない場合。" @@ -8255,10 +8469,10 @@ msgid "You specified both ``file`` and ``files``." msgstr "``file`` と ``filess`` の両方を指定した場合。" #: ../../../discord/webhook/async_.py:docstring of discord.message.PartialMessage.reply:17 -#: ../../../discord/abc.py:docstring of discord.abc.Messageable.send:82 -#: ../../../discord/user.py:docstring of discord.abc.Messageable.send:82 +#: ../../../discord/abc.py:docstring of discord.abc.Messageable.send:87 +#: ../../../discord/user.py:docstring of discord.abc.Messageable.send:87 #: ../../../discord/message.py:docstring of discord.message.PartialMessage.reply:17 -#: ../../../discord/member.py:docstring of discord.abc.Messageable.send:82 +#: ../../../discord/member.py:docstring of discord.abc.Messageable.send:87 msgid "The message that was sent." msgstr "送信されたメッセージ。" @@ -8326,7 +8540,7 @@ msgstr "このメッセージのピン留めを外す権限を持っていない msgid "Unpinning the message failed." msgstr "メッセージのピン留め解除に失敗した場合。" -#: ../../api.rst:3942 +#: ../../api.rst:4071 msgid "SyncWebhook" msgstr "SyncWebhook" @@ -8343,6 +8557,13 @@ msgstr "非同期対応については、 :class:`Webhook` を参照してくだ msgid "The session to use to send requests with. Note that the library does not manage the session and will not close it. If not given, the ``requests`` auto session creation functions are used instead." msgstr "リクエストを送信するために使うセッション。ライブラリはセッションを管理しておらず、セッションを閉じないことに注意してください。指定されていない場合は、代わりに ``requests`` の自動セッション作成関数が使用されます。" +#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.partial:16 +#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.from_url:16 +msgid "A partial :class:`SyncWebhook`. A partial :class:`SyncWebhook` is just a :class:`SyncWebhook` object with an ID and a token." +msgstr "" + +#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.partial:18 +#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.from_url:18 #: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.fetch:20 #: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.edit:22 msgid ":class:`SyncWebhook`" @@ -8360,7 +8581,7 @@ msgstr "サーバーが応答を送信するまで待機するかどうか。``T msgid "The thread to send this message to." msgstr "このメッセージを送信するスレッド。" -#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.send:65 +#: ../../../discord/webhook/sync.py:docstring of discord.webhook.sync.SyncWebhook.send:70 msgid "Optional[:class:`SyncWebhookMessage`]" msgstr "Optional[:class:`SyncWebhookMessage`]" @@ -8372,7 +8593,7 @@ msgstr "このwebhookが送信した :class:`~discord.SyncWebhookMessage` を1 msgid ":class:`~discord.SyncWebhookMessage`" msgstr ":class:`~discord.SyncWebhookMessage`" -#: ../../api.rst:3951 +#: ../../api.rst:4080 msgid "SyncWebhookMessage" msgstr "SyncWebhookMessage" @@ -8386,19 +8607,19 @@ msgstr ":class:`SyncWebhookMessage`" msgid "If provided, the number of seconds to wait before deleting the message. This blocks the thread." msgstr "指定された場合、メッセージを削除するまでの待機秒数。これはスレッドをブロックします。" -#: ../../api.rst:3961 +#: ../../api.rst:4090 msgid "Abstract Base Classes" msgstr "抽象基底クラス" -#: ../../api.rst:3963 +#: ../../api.rst:4092 msgid "An :term:`abstract base class` (also known as an ``abc``) is a class that models can inherit to get their behaviour. **Abstract base classes should not be instantiated**. They are mainly there for usage with :func:`isinstance` and :func:`issubclass`\\." msgstr ":term:`abstract base class` ( ``abc`` という名称でも知られています)はモデルが振る舞いを得るために継承するクラスです。 **抽象基底クラスはインスタンス化されるべきではありません。** これらは主に :func:`isinstance` や :func:`issubclass` で使用するために存在します。" -#: ../../api.rst:3967 +#: ../../api.rst:4096 msgid "This library has a module related to abstract base classes, in which all the ABCs are subclasses of :class:`typing.Protocol`." msgstr "このライブラリには抽象基底クラスに関連するモジュールがあり、その中の抽象基底クラスは全て :class:`typing.Protocol` のサブクラスです。" -#: ../../api.rst:3971 +#: ../../api.rst:4100 msgid "Snowflake" msgstr "Snowflake" @@ -8418,8 +8639,8 @@ msgstr "スノーフレークを自分で作成したい場合は、 :class:`.Ob msgid "The model's unique ID." msgstr "モデルのユニークなID。" -#: ../../api.rst:3979 -#: ../../api.rst:4059 +#: ../../api.rst:4108 +#: ../../api.rst:4188 msgid "User" msgstr "User" @@ -8440,7 +8661,7 @@ msgid ":class:`~discord.ClientUser`" msgstr ":class:`~discord.ClientUser`" #: ../../../discord/abc.py:docstring of discord.abc.User:7 -#: ../../../discord/abc.py:docstring of discord.abc.Messageable:11 +#: ../../../discord/abc.py:docstring of discord.abc.Messageable:12 msgid ":class:`~discord.Member`" msgstr ":class:`~discord.Member`" @@ -8457,14 +8678,20 @@ msgid "The user's username." msgstr "ユーザー名。" #: ../../../discord/abc.py:docstring of discord.abc.User:19 -msgid "The user's discriminator." -msgstr "ユーザーのディスクリミネーター。" +#: ../../../discord/user.py:docstring of discord.user.ClientUser:35 +#: ../../../discord/user.py:docstring of discord.user.User:35 +msgid "The user's discriminator. This is a legacy concept that is no longer used." +msgstr "" #: ../../../discord/abc.py:docstring of discord.abc.User:25 +msgid "The user's global nickname." +msgstr "" + +#: ../../../discord/abc.py:docstring of discord.abc.User:31 msgid "If the user is a bot account." msgstr "ユーザーがBotであるかどうか。" -#: ../../../discord/abc.py:docstring of discord.abc.User:31 +#: ../../../discord/abc.py:docstring of discord.abc.User:37 msgid "If the user is a system account." msgstr "ユーザーがシステムアカウントであるかどうか。" @@ -8481,7 +8708,7 @@ msgstr "Optional[:class:`~discord.Asset`]" msgid ":class:`~discord.Asset`" msgstr ":class:`~discord.Asset`" -#: ../../api.rst:3987 +#: ../../api.rst:4116 msgid "PrivateChannel" msgstr "PrivateChannel" @@ -8490,12 +8717,12 @@ msgid "An ABC that details the common operations on a private Discord channel." msgstr "Discordのプライベートチャンネルの一般的な操作を説明するABC。" #: ../../../discord/abc.py:docstring of discord.abc.PrivateChannel:5 -#: ../../../discord/abc.py:docstring of discord.abc.Messageable:7 +#: ../../../discord/abc.py:docstring of discord.abc.Messageable:8 msgid ":class:`~discord.DMChannel`" msgstr ":class:`~discord.DMChannel`" #: ../../../discord/abc.py:docstring of discord.abc.PrivateChannel:6 -#: ../../../discord/abc.py:docstring of discord.abc.Messageable:8 +#: ../../../discord/abc.py:docstring of discord.abc.Messageable:9 msgid ":class:`~discord.GroupChannel`" msgstr ":class:`~discord.GroupChannel`" @@ -8505,7 +8732,7 @@ msgstr ":class:`~discord.GroupChannel`" msgid "The user presenting yourself." msgstr "あなた自身を示すユーザー。" -#: ../../api.rst:3995 +#: ../../api.rst:4124 msgid "GuildChannel" msgstr "GuildChannel" @@ -8529,6 +8756,7 @@ msgid ":class:`~discord.CategoryChannel`" msgstr ":class:`~discord.CategoryChannel`" #: ../../../discord/abc.py:docstring of discord.abc.GuildChannel:8 +#: ../../../discord/abc.py:docstring of discord.abc.Messageable:7 #: ../../../discord/abc.py:docstring of discord.abc.Connectable:7 msgid ":class:`~discord.StageChannel`" msgstr ":class:`~discord.StageChannel`" @@ -8559,8 +8787,8 @@ msgstr ":class:`~discord.Guild`" #: ../../../discord/abc.py:docstring of discord.abc.GuildChannel:27 #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_text_channel:51 #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_voice_channel:19 -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:23 -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:20 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:21 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:24 msgid "The position in the channel list. This is a number that starts at 0. e.g. the top channel is position 0." msgstr "チャンネルリストにおける位置。これは0から始まる番号で、最も上のチャンネルの位置は0です。" @@ -9077,17 +9305,17 @@ msgid "The reason for cloning this channel. Shows up on the audit log." msgstr "チャンネルを複製する理由。監査ログに表示されます。" #: ../../../discord/abc.py:docstring of discord.abc.GuildChannel.clone:16 -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_text_channel:73 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_text_channel:77 #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_voice_channel:38 -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:29 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:44 #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_category:14 msgid "You do not have the proper permissions to create this channel." msgstr "チャンネルを作成するのに必要な権限がない場合。" #: ../../../discord/abc.py:docstring of discord.abc.GuildChannel.clone:17 -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_text_channel:74 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_text_channel:78 #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_voice_channel:39 -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:30 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:45 #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_category:15 msgid "Creating the channel failed." msgstr "チャンネルの作成に失敗した場合。" @@ -9372,7 +9600,7 @@ msgstr "現時点でアクティブな招待のリスト。" msgid "List[:class:`~discord.Invite`]" msgstr "List[:class:`~discord.Invite`]" -#: ../../api.rst:4003 +#: ../../api.rst:4132 msgid "Messageable" msgstr "Messageable" @@ -9384,15 +9612,15 @@ msgstr "メッセージを送信できるモデルに共通する操作を説明 msgid "The following classes implement this ABC:" msgstr "以下のクラスがこのABCを実装しています:" -#: ../../../discord/abc.py:docstring of discord.abc.Messageable:9 +#: ../../../discord/abc.py:docstring of discord.abc.Messageable:10 msgid ":class:`~discord.PartialMessageable`" msgstr ":class:`~discord.PartialMessageable`" -#: ../../../discord/abc.py:docstring of discord.abc.Messageable:12 +#: ../../../discord/abc.py:docstring of discord.abc.Messageable:13 msgid ":class:`~discord.ext.commands.Context`" msgstr ":class:`~discord.ext.commands.Context`" -#: ../../../discord/abc.py:docstring of discord.abc.Messageable:13 +#: ../../../discord/abc.py:docstring of discord.abc.Messageable:14 msgid ":class:`~discord.Thread`" msgstr ":class:`~discord.Thread`" @@ -9548,26 +9776,26 @@ msgstr "メッセージに追加するDiscord UI ビュー。" msgid "A list of stickers to upload. Must be a maximum of 3." msgstr "送信するスタンプのリスト。最大3個まで送信できます。" -#: ../../../discord/abc.py:docstring of discord.abc.Messageable.send:79 -#: ../../../discord/user.py:docstring of discord.abc.Messageable.send:79 -#: ../../../discord/member.py:docstring of discord.abc.Messageable.send:79 -#: ../../../discord/channel.py:docstring of discord.abc.Messageable.send:79 -#: ../../../discord/channel.py:docstring of discord.abc.Messageable.send:79 +#: ../../../discord/abc.py:docstring of discord.abc.Messageable.send:84 +#: ../../../discord/user.py:docstring of discord.abc.Messageable.send:84 +#: ../../../discord/member.py:docstring of discord.abc.Messageable.send:84 +#: ../../../discord/channel.py:docstring of discord.abc.Messageable.send:84 +#: ../../../discord/channel.py:docstring of discord.abc.Messageable.send:84 msgid "The ``files`` or ``embeds`` list is not of the appropriate size." msgstr "``files`` または ``embeds`` リストの大きさが適切でない場合。" -#: ../../../discord/abc.py:docstring of discord.abc.Messageable.send:80 -#: ../../../discord/user.py:docstring of discord.abc.Messageable.send:80 -#: ../../../discord/member.py:docstring of discord.abc.Messageable.send:80 -#: ../../../discord/channel.py:docstring of discord.abc.Messageable.send:80 -#: ../../../discord/channel.py:docstring of discord.abc.Messageable.send:80 +#: ../../../discord/abc.py:docstring of discord.abc.Messageable.send:85 +#: ../../../discord/user.py:docstring of discord.abc.Messageable.send:85 +#: ../../../discord/member.py:docstring of discord.abc.Messageable.send:85 +#: ../../../discord/channel.py:docstring of discord.abc.Messageable.send:85 +#: ../../../discord/channel.py:docstring of discord.abc.Messageable.send:85 msgid "You specified both ``file`` and ``files``, or you specified both ``embed`` and ``embeds``, or the ``reference`` object is not a :class:`~discord.Message`, :class:`~discord.MessageReference` or :class:`~discord.PartialMessage`." msgstr "``file`` と ``files`` の両方が指定された場合、 ``embed`` と ``embeds`` の両方が指定された場合、または ``reference`` が :class:`~discord.Message` 、 :class:`~discord.MessageReference` 、 :class:`~discord.PartialMessage` でない場合。" -#: ../../../discord/abc.py:docstring of discord.abc.Messageable.send:83 +#: ../../../discord/abc.py:docstring of discord.abc.Messageable.send:88 #: ../../../discord/abc.py:docstring of discord.abc.Messageable.fetch_message:13 #: ../../../discord/user.py:docstring of discord.abc.Messageable.fetch_message:13 -#: ../../../discord/user.py:docstring of discord.abc.Messageable.send:83 +#: ../../../discord/user.py:docstring of discord.abc.Messageable.send:88 #: ../../../discord/member.py:docstring of discord.abc.Messageable.fetch_message:13 msgid ":class:`~discord.Message`" msgstr ":class:`~discord.Message`" @@ -9716,7 +9944,7 @@ msgstr "メッセージ履歴の取得に失敗した場合。" msgid ":class:`~discord.Message` -- The message with the message data parsed." msgstr ":class:`~discord.Message` -- メッセージデータをパースしたメッセージ。" -#: ../../api.rst:4015 +#: ../../api.rst:4144 msgid "Connectable" msgstr "Connectable" @@ -9784,32 +10012,32 @@ msgstr "ボイスサーバーに完全に接続されたボイスクライアン msgid ":class:`~discord.VoiceProtocol`" msgstr ":class:`~discord.VoiceProtocol`" -#: ../../api.rst:4025 +#: ../../api.rst:4154 msgid "Discord Models" msgstr "Discordモデル" -#: ../../api.rst:4027 +#: ../../api.rst:4156 msgid "Models are classes that are received from Discord and are not meant to be created by the user of the library." msgstr "モデルはDiscordから受け取るクラスであり、ユーザーによって作成されることを想定していません。" -#: ../../api.rst:4032 +#: ../../api.rst:4161 msgid "The classes listed below are **not intended to be created by users** and are also **read-only**." msgstr "下記のクラスは、 **ユーザーによって作成されることを想定しておらず** 、中には **読み取り専用** のものもあります。" -#: ../../api.rst:4035 +#: ../../api.rst:4164 msgid "For example, this means that you should not make your own :class:`User` instances nor should you modify the :class:`User` instance yourself." msgstr "つまり、独自の :class:`User` を作成したりするべきではなく、また、 :class:`User` インスタンスの値の変更もするべきではありません。" -#: ../../api.rst:4038 +#: ../../api.rst:4167 msgid "If you want to get one of these model classes instances they'd have to be through the cache, and a common way of doing so is through the :func:`utils.find` function or attributes of model classes that you receive from the events specified in the :ref:`discord-api-events`." msgstr "このようなモデルクラスのインスタンスを取得したい場合は、 キャッシュを経由して取得する必要があります。一般的な方法としては :func:`utils.find` 関数を用いるか、 :ref:`discord-api-events` の特定のイベントから受け取る方法が挙げられます。" -#: ../../api.rst:4045 -#: ../../api.rst:4621 +#: ../../api.rst:4174 +#: ../../api.rst:4750 msgid "Nearly all classes here have :ref:`py:slots` defined which means that it is impossible to have dynamic attributes to the data classes." msgstr "ほぼすべてのクラスに :ref:`py:slots` が定義されています。つまり、データクラスに動的に変数を追加することは不可能です。" -#: ../../api.rst:4050 +#: ../../api.rst:4179 msgid "ClientUser" msgstr "ClientUser" @@ -9834,33 +10062,33 @@ msgstr "ユーザーのハッシュ値を返します。" #: ../../../discord/user.py:docstring of discord.user.ClientUser:19 #: ../../../discord/user.py:docstring of discord.user.User:19 -msgid "Returns the user's name with discriminator." -msgstr "ユーザー名とディスクリミネータを返します。" +msgid "Returns the user's handle (e.g. ``name`` or ``name#discriminator``)." +msgstr "" #: ../../../discord/user.py:docstring of discord.user.ClientUser:29 #: ../../../discord/user.py:docstring of discord.user.User:29 msgid "The user's unique ID." msgstr "ユーザーのユニークなID。" -#: ../../../discord/user.py:docstring of discord.user.ClientUser:35 -#: ../../../discord/user.py:docstring of discord.user.User:35 -msgid "The user's discriminator. This is given when the username has conflicts." -msgstr "ユーザーのディスクリミネーター。これはユーザー名が重複しているときに与えられます。" +#: ../../../discord/user.py:docstring of discord.user.ClientUser:41 +#: ../../../discord/user.py:docstring of discord.user.User:41 +msgid "The user's global nickname, taking precedence over the username in display." +msgstr "" -#: ../../../discord/user.py:docstring of discord.user.ClientUser:47 -#: ../../../discord/user.py:docstring of discord.user.User:47 +#: ../../../discord/user.py:docstring of discord.user.ClientUser:55 +#: ../../../discord/user.py:docstring of discord.user.User:55 msgid "Specifies if the user is a system user (i.e. represents Discord officially)." msgstr "ユーザーがシステムユーザーかどうかを示します。(つまり、Discord公式を表しているかどうか。)" -#: ../../../discord/user.py:docstring of discord.user.ClientUser:55 +#: ../../../discord/user.py:docstring of discord.user.ClientUser:63 msgid "Specifies if the user's email is verified." msgstr "ユーザーのメールアドレスが確認されているかどうかを示します。" -#: ../../../discord/user.py:docstring of discord.user.ClientUser:61 +#: ../../../discord/user.py:docstring of discord.user.ClientUser:69 msgid "The IETF language tag used to identify the language the user is using." msgstr "ユーザーが使用している言語を識別するためのIETF言語タグ。" -#: ../../../discord/user.py:docstring of discord.user.ClientUser:67 +#: ../../../discord/user.py:docstring of discord.user.ClientUser:75 msgid "Specifies if the user has MFA turned on and working." msgstr "ユーザーが多段階認証を使用しているかを示します。" @@ -9900,6 +10128,21 @@ msgstr "``avatar`` に渡された画像のフォーマットが間違ってい msgid "The newly edited client user." msgstr "新しく編集されたクライアントユーザー。" +#: ../../../discord/user.py:docstring of discord.ClientUser.mutual_guilds:1 +#: ../../../discord/user.py:docstring of discord.User.mutual_guilds:1 +msgid "The guilds that the user shares with the client." +msgstr "ユーザーがクライアントと共有するギルド。" + +#: ../../../discord/user.py:docstring of discord.ClientUser.mutual_guilds:5 +#: ../../../discord/user.py:docstring of discord.User.mutual_guilds:5 +msgid "This will only return mutual guilds within the client's internal cache." +msgstr "クライアントの内部キャッシュ内に存在する共通のサーバーのみが返されます。" + +#: ../../../discord/user.py:docstring of discord.ClientUser.mutual_guilds:9 +#: ../../../discord/user.py:docstring of discord.User.mutual_guilds:9 +msgid "List[:class:`Guild`]" +msgstr "List[:class:`Guild`]" + #: ../../../discord/user.py:docstring of discord.user.User:1 msgid "Represents a Discord user." msgstr "Discordユーザー。" @@ -9916,18 +10159,6 @@ msgstr "これが ``None`` を返すなら、あなたは :meth:`create_dm` コ msgid "Optional[:class:`DMChannel`]" msgstr "Optional[:class:`DMChannel`]" -#: ../../../discord/user.py:docstring of discord.User.mutual_guilds:1 -msgid "The guilds that the user shares with the client." -msgstr "ユーザーがクライアントと共有するギルド。" - -#: ../../../discord/user.py:docstring of discord.User.mutual_guilds:5 -msgid "This will only return mutual guilds within the client's internal cache." -msgstr "クライアントの内部キャッシュ内に存在する共通のサーバーのみが返されます。" - -#: ../../../discord/user.py:docstring of discord.User.mutual_guilds:9 -msgid "List[:class:`Guild`]" -msgstr "List[:class:`Guild`]" - #: ../../../discord/user.py:docstring of discord.user.User.create_dm:3 #: ../../../discord/member.py:docstring of discord.member.flatten_user..generate_function..general:3 msgid "Creates a :class:`DMChannel` with this user." @@ -9983,7 +10214,7 @@ msgstr "このルールを作成したメンバー。" #: ../../../discord/automod.py:docstring of discord.AutoModAction.member:3 #: ../../../discord/guild.py:docstring of discord.guild.Guild.get_member:11 #: ../../../discord/guild.py:docstring of discord.Guild.owner:3 -#: ../../../discord/guild.py:docstring of discord.guild.Guild.get_member_named:24 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.get_member_named:26 msgid "Optional[:class:`Member`]" msgstr "Optional[:class:`Member`]" @@ -10198,7 +10429,7 @@ msgstr "ルールの取得に失敗した場合。" msgid "The rule that was executed." msgstr "発動されたルール。" -#: ../../api.rst:4085 +#: ../../api.rst:4214 msgid "Attachment" msgstr "Attachment" @@ -10266,10 +10497,30 @@ msgstr "添付ファイルの説明。画像にのみ適用されます。" msgid "Whether the attachment is ephemeral." msgstr "添付ファイルが一時的であるかどうか。" +#: ../../../discord/message.py:docstring of discord.message.Attachment:95 +msgid "The duration of the audio file in seconds. Returns ``None`` if it's not a voice message." +msgstr "" + +#: ../../../discord/message.py:docstring of discord.message.Attachment:99 +msgid "Optional[:class:`float`]" +msgstr "" + +#: ../../../discord/message.py:docstring of discord.message.Attachment:103 +msgid "The waveform (amplitudes) of the audio in bytes. Returns ``None`` if it's not a voice message." +msgstr "" + +#: ../../../discord/message.py:docstring of discord.message.Attachment:107 +msgid "Optional[:class:`bytes`]" +msgstr "" + #: ../../../discord/message.py:docstring of discord.message.Attachment.is_spoiler:1 msgid ":class:`bool`: Whether this attachment contains a spoiler." msgstr ":class:`bool`: この添付ファイルにスポイラーが含まれているかどうか。" +#: ../../../discord/message.py:docstring of discord.message.Attachment.is_voice_message:1 +msgid ":class:`bool`: Whether this attachment is a voice message." +msgstr "" + #: ../../../discord/message.py:docstring of discord.message.Attachment.save:3 msgid "Saves this attachment into a file-like object." msgstr "この添付ファイルをファイルライクオブジェクトに保存します。" @@ -10356,7 +10607,7 @@ msgstr "送信に適したファイルに変換された添付ファイル。" msgid ":class:`File`" msgstr ":class:`File`" -#: ../../api.rst:4093 +#: ../../api.rst:4222 msgid "Asset" msgstr "Asset" @@ -10554,7 +10805,7 @@ msgstr "アセットがロッティータイプのスタンプであった場合 msgid "The asset as a file suitable for sending." msgstr "送信に適したファイルとしてのアセット。" -#: ../../api.rst:4102 +#: ../../api.rst:4231 msgid "Message" msgstr "Message" @@ -10611,8 +10862,8 @@ msgid "The :class:`TextChannel` or :class:`Thread` that the message was sent fro msgstr "メッセージの送信された :class:`TextChannel` や :class:`Thread` 。もしメッセージがプライベートチャンネルで送信されたなら、これは :class:`DMChannel` か :class:`GroupChannel` になります。" #: ../../../discord/message.py:docstring of discord.message.Message:67 -msgid "Union[:class:`TextChannel`, :class:`VoiceChannel`, :class:`Thread`, :class:`DMChannel`, :class:`GroupChannel`, :class:`PartialMessageable`]" -msgstr "Union[:class:`TextChannel`, :class:`VoiceChannel`, :class:`Thread`, :class:`DMChannel`, :class:`GroupChannel`, :class:`PartialMessageable`]" +msgid "Union[:class:`TextChannel`, :class:`StageChannel`, :class:`VoiceChannel`, :class:`Thread`, :class:`DMChannel`, :class:`GroupChannel`, :class:`PartialMessageable`]" +msgstr "" #: ../../../discord/message.py:docstring of discord.message.Message:71 msgid "The message that this message references. This is only applicable to messages of type :attr:`MessageType.pins_add`, crossposted messages created by a followed channel integration, or message replies." @@ -10651,7 +10902,7 @@ msgid "A list of :class:`Role` that were mentioned. If the message is in a priva msgstr "メンションされた :class:`Role` のリスト。もしメッセージがプライベートチャンネル内のものなら、このリストは常に空になります。" #: ../../../discord/message.py:docstring of discord.message.Message:121 -#: ../../../discord/message.py:docstring of discord.message.PartialMessage:38 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage:39 msgid "The message ID." msgstr "メッセージのID。" @@ -10826,7 +11077,7 @@ msgstr "もし指定したなら、これはメッセージを編集したあと msgid "Tried to suppress a message without permissions or edited a message's content or embed that isn't yours." msgstr "権限なしに埋め込みを除去しようとした場合や、他人のメッセージの内容や埋め込みを編集しようとした場合。" -#: ../../api.rst:4111 +#: ../../api.rst:4240 msgid "DeletedReferencedMessage" msgstr "DeletedReferencedMessage" @@ -10850,7 +11101,7 @@ msgstr "削除された参照されたメッセージが属していたチャン msgid "The guild ID of the deleted referenced message." msgstr "削除された参照されたメッセージが属していたギルドのID。" -#: ../../api.rst:4120 +#: ../../api.rst:4249 msgid "Reaction" msgstr "Reaction" @@ -10956,7 +11207,7 @@ msgstr "リアクションを付けたユーザーの取得に失敗した場合 msgid "Union[:class:`User`, :class:`Member`] -- The member (if retrievable) or the user that has reacted to this message. The case where it can be a :class:`Member` is in a guild message context. Sometimes it can be a :class:`User` if the member has left the guild." msgstr "Union[:class:`User`, :class:`Member`] -- リアクションを付けたメンバー(取得できる場合)かユーザー。ギルド内では :class:`Member` となります。メンバーがギルドを脱退した場合は :class:`User` になります。" -#: ../../api.rst:4128 +#: ../../api.rst:4257 msgid "Guild" msgstr "Guild" @@ -11005,120 +11256,116 @@ msgid "Tuple[:class:`GuildSticker`, ...]" msgstr "Tuple[:class:`GuildSticker`, ...]" #: ../../../discord/guild.py:docstring of discord.guild.Guild:45 -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:60 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:49 msgid "The number of seconds until someone is moved to the AFK channel." msgstr "メンバーをAFKチャンネルに移動させるまでの秒数。" #: ../../../discord/guild.py:docstring of discord.guild.Guild:51 -msgid "The channel that denotes the AFK channel. ``None`` if it doesn't exist." -msgstr "AFKチャンネルに指定されているチャンネル。もしなければこれは ``None`` です。" - -#: ../../../discord/guild.py:docstring of discord.guild.Guild:53 -msgid "Optional[:class:`VoiceChannel`]" -msgstr "Optional[:class:`VoiceChannel`]" - -#: ../../../discord/guild.py:docstring of discord.guild.Guild:57 #: ../../../discord/widget.py:docstring of discord.widget.Widget:19 msgid "The guild's ID." msgstr "ギルドのID。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:63 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:57 msgid "The guild owner's ID. Use :attr:`Guild.owner` instead." msgstr "ギルドのオーナーのID。代わりに :attr:`Guild.owner` を使用してください。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:69 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:63 msgid "Indicates if the guild is unavailable. If this is ``True`` then the reliability of other attributes outside of :attr:`Guild.id` is slim and they might all be ``None``. It is best to not do anything with the guild if it is unavailable." msgstr "ギルドが利用できないかどうか。これが ``True`` の場合 :attr:`Guild.id` 以外の属性の信頼度は低く ``None`` の場合もあります。利用不可能なギルドに対しては何も行わないことをおすすめします。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:73 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:67 msgid "Check the :func:`on_guild_unavailable` and :func:`on_guild_available` events." msgstr ":func:`on_guild_unavailable` と :func:`on_guild_available` イベントも確認してください。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:79 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:73 msgid "The maximum amount of presences for the guild." msgstr "ギルドのオンラインメンバーの最大数。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:85 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:79 msgid "The maximum amount of members for the guild." msgstr "ギルドのメンバーの最大数。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:89 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:83 msgid "This attribute is only available via :meth:`.Client.fetch_guild`." msgstr "この情報は :meth:`Client.fetch_guild` 経由でのみ入手できます。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:95 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:89 msgid "The maximum amount of users in a video channel." msgstr "ビデオチャンネルのユーザーの最大数。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:103 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:97 msgid "The guild's description." msgstr "ギルドの説明。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:115 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:109 msgid "The guild's vanity url code, if any" msgstr "存在する場合は、ギルドのバニティURLコード。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:123 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:117 msgid "The guild's explicit content filter." msgstr "メディアコンテンツフィルターのレベル。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:129 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:123 msgid "The guild's notification settings." msgstr "ギルドの標準の通知設定。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:135 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:129 msgid "A list of features that the guild has. The features that a guild can have are subject to arbitrary change by Discord. A list of guild features can be found in :ddocs:`the Discord documentation `." msgstr "ギルドの機能のリスト。ギルドの機能の種類はDiscordによって変更されることがあります。 ギルドの機能の一覧は :ddocs:`the Discord documentation ` にあります。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:143 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:137 msgid "The premium tier for this guild. Corresponds to \"Nitro Server\" in the official UI. The number goes from 0 to 3 inclusive." msgstr "ギルドのプレミアム階級。これは公式UIの「ニトロサーバー」に対応します。これは0以上3以下です。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:150 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:144 msgid "The number of \"boosts\" this guild currently has." msgstr "ギルドの現在の「ブースト」数。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:156 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:150 msgid "The preferred locale for the guild. Used when filtering Server Discovery results to a specific language." msgstr "ギルドの優先ローケル。これはサーバー発見画面の結果を特定の言語で絞り込むときに利用されます。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:159 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:153 msgid "This field is now an enum instead of a :class:`str`." msgstr "このフィールドが :class:`str` から列挙型に変更されました。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:166 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:160 msgid "The guild's NSFW level." msgstr "ギルドの年齢制限レベル。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:170 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:164 #: ../../../discord/invite.py:docstring of discord.invite.PartialInviteGuild:60 msgid ":class:`NSFWLevel`" msgstr ":class:`NSFWLevel`" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:174 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:168 msgid "The guild's Multi-Factor Authentication requirement level." msgstr "ギルドの多要素認証要件レベル。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:176 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:170 msgid "This field is now an enum instead of an :class:`int`." msgstr "このフィールドが :class:`int` から列挙型に変更されました。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:183 -msgid "The approximate number of members in the guild. This is ``None`` unless the guild is obtained using :meth:`Client.fetch_guild` with ``with_counts=True``." -msgstr "ギルドのおおよそのメンバーの数を示します。 :meth:`Client.fetch_guild` にて ``with_counts=True`` を指定してギルドを取得しない限り、 ``None`` を返します。" +#: ../../../discord/guild.py:docstring of discord.guild.Guild:177 +msgid "The approximate number of members in the guild. This is ``None`` unless the guild is obtained using :meth:`Client.fetch_guild` or :meth:`Client.fetch_guilds` with ``with_counts=True``." +msgstr "" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:192 -msgid "The approximate number of members currently active in the guild. Offline members are excluded. This is ``None`` unless the guild is obtained using :meth:`Client.fetch_guild` with ``with_counts=True``." -msgstr "ギルドで現在アクティブなメンバーのおおよその数を示します。オフラインのメンバーは除外された値となります。 :meth:`Client.fetch_guild` にて ``with_counts=True`` を指定してギルドを取得しない限り、 ``None`` を返します。" +#: ../../../discord/guild.py:docstring of discord.guild.Guild:186 +msgid "The approximate number of members currently active in the guild. Offline members are excluded. This is ``None`` unless the guild is obtained using :meth:`Client.fetch_guild` or :meth:`Client.fetch_guilds` with ``with_counts=True``." +msgstr "" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:202 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:196 msgid "Indicates if the guild has premium AKA server boost level progress bar enabled." msgstr "ギルドがプレミアム、すなわちサーバーブーストレベルの進捗バーを有効化しているか。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild:210 +#: ../../../discord/guild.py:docstring of discord.guild.Guild:204 msgid "Indicates if the guild has widget enabled." msgstr "ギルドにてウィジェットが有効になっているかどうかを示します。" +#: ../../../discord/guild.py:docstring of discord.guild.Guild:212 +msgid "The maximum amount of users in a stage video channel." +msgstr "" + #: ../../../discord/guild.py:docstring of discord.Guild.channels:1 msgid "A list of channels that belongs to this guild." msgstr "このギルド内に存在するチャンネルのリスト。" @@ -11274,19 +11521,40 @@ msgstr "スレッド、または該当するものが見つからない場合 `` msgid "Optional[:class:`Thread`]" msgstr "Optional[:class:`Thread`]" -#: ../../../discord/guild.py:docstring of discord.Guild.system_channel:1 -msgid "Returns the guild's channel used for system messages." -msgstr "ギルドの「システムのメッセージチャンネル」として設定されているチャンネルを返します。" +#: ../../../discord/guild.py:docstring of discord.guild.Guild.get_emoji:8 +msgid "The returned Emoji or ``None`` if not found." +msgstr "" + +#: ../../../discord/guild.py:docstring of discord.guild.Guild.get_emoji:9 +msgid "Optional[:class:`Emoji`]" +msgstr "" +#: ../../../discord/guild.py:docstring of discord.Guild.afk_channel:1 +msgid "The channel that denotes the AFK channel." +msgstr "" + +#: ../../../discord/guild.py:docstring of discord.Guild.afk_channel:3 #: ../../../discord/guild.py:docstring of discord.Guild.system_channel:3 #: ../../../discord/guild.py:docstring of discord.Guild.rules_channel:4 #: ../../../discord/guild.py:docstring of discord.Guild.public_updates_channel:5 +#: ../../../discord/guild.py:docstring of discord.Guild.widget_channel:4 msgid "If no channel is set, then this returns ``None``." msgstr "チャンネルが設定されていない場合はこれは ``None`` になります。" +#: ../../../discord/guild.py:docstring of discord.Guild.afk_channel:5 +#: ../../../discord/scheduled_event.py:docstring of discord.ScheduledEvent.channel:3 +#: ../../../discord/member.py:docstring of discord.member.VoiceState:74 +msgid "Optional[Union[:class:`VoiceChannel`, :class:`StageChannel`]]" +msgstr "Optional[Union[:class:`VoiceChannel`, :class:`StageChannel`]]" + +#: ../../../discord/guild.py:docstring of discord.Guild.system_channel:1 +msgid "Returns the guild's channel used for system messages." +msgstr "ギルドの「システムのメッセージチャンネル」として設定されているチャンネルを返します。" + #: ../../../discord/guild.py:docstring of discord.Guild.system_channel:5 #: ../../../discord/guild.py:docstring of discord.Guild.rules_channel:8 #: ../../../discord/guild.py:docstring of discord.Guild.public_updates_channel:9 +#: ../../../discord/guild.py:docstring of discord.Guild.safety_alerts_channel:7 msgid "Optional[:class:`TextChannel`]" msgstr "Optional[:class:`TextChannel`]" @@ -11294,10 +11562,6 @@ msgstr "Optional[:class:`TextChannel`]" msgid "Returns the guild's system channel settings." msgstr "ギルドのシステムチャンネルの設定を返します。" -#: ../../../discord/guild.py:docstring of discord.Guild.system_channel_flags:3 -msgid ":class:`SystemChannelFlags`" -msgstr ":class:`SystemChannelFlags`" - #: ../../../discord/guild.py:docstring of discord.Guild.rules_channel:1 msgid "Return's the guild's channel used for the rules. The guild must be a Community guild." msgstr "ルールに使用されるギルドのチャンネルを返します。ギルドはコミュニティギルドでなければなりません。" @@ -11306,6 +11570,22 @@ msgstr "ルールに使用されるギルドのチャンネルを返します。 msgid "Return's the guild's channel where admins and moderators of the guilds receive notices from Discord. The guild must be a Community guild." msgstr "ギルドの管理者とモデレータがDiscordからの通知を受け取るギルドのチャンネルを返します。ギルドはコミュニティギルドでなければなりません。" +#: ../../../discord/guild.py:docstring of discord.Guild.safety_alerts_channel:1 +msgid "Return's the guild's channel used for safety alerts, if set." +msgstr "" + +#: ../../../discord/guild.py:docstring of discord.Guild.safety_alerts_channel:3 +msgid "For example, this is used for the raid protection setting. The guild must have the ``COMMUNITY`` feature." +msgstr "" + +#: ../../../discord/guild.py:docstring of discord.Guild.widget_channel:1 +msgid "Returns the widget channel of the guild." +msgstr "" + +#: ../../../discord/guild.py:docstring of discord.Guild.widget_channel:8 +msgid "Optional[Union[:class:`TextChannel`, :class:`ForumChannel`, :class:`VoiceChannel`, :class:`StageChannel`]]" +msgstr "" + #: ../../../discord/guild.py:docstring of discord.Guild.emoji_limit:1 msgid "The maximum number of emoji slots this guild has." msgstr "ギルドに追加できるカスタム絵文字のスロットの最大数。" @@ -11501,26 +11781,46 @@ msgid "Returns the first member found that matches the name provided." msgstr "指定された名前に一致する最初のメンバーを返します。" #: ../../../discord/guild.py:docstring of discord.guild.Guild.get_member_named:3 -msgid "The name can have an optional discriminator argument, e.g. \"Jake#0001\" or \"Jake\" will both do the lookup. However the former will give a more precise result. Note that the discriminator must have all 4 digits for this to work." -msgstr "名前にはタグを含めることができます。例:\"Jake#0001\" も \"Jake\" も利用できます。ただ、前者のほうがより正確な結果になります。この場合にはタグは4桁すべて必要です。" +msgid "The name is looked up in the following order:" +msgstr "" + +#: ../../../discord/guild.py:docstring of discord.guild.Guild.get_member_named:5 +msgid "Username#Discriminator (deprecated)" +msgstr "" + +#: ../../../discord/guild.py:docstring of discord.guild.Guild.get_member_named:6 +msgid "Username#0 (deprecated, only gets users that migrated from their discriminator)" +msgstr "" + +#: ../../../discord/guild.py:docstring of discord.guild.Guild.get_member_named:7 +msgid "Nickname" +msgstr "" #: ../../../discord/guild.py:docstring of discord.guild.Guild.get_member_named:8 -msgid "If a nickname is passed, then it is looked up via the nickname. Note however, that a nickname + discriminator combo will not lookup the nickname but rather the username + discriminator combo due to nickname + discriminator not being unique." -msgstr "ニックネームが渡された場合、ニックネームで検索が行われます。なお、ニックネームとタグの組み合わせでは、ニックネームではなくユーザー名とタグの組み合わせとして扱われます。これは、ニックネームとタグの組み合わせが一意でないためです。" +msgid "Global name" +msgstr "" + +#: ../../../discord/guild.py:docstring of discord.guild.Guild.get_member_named:9 +msgid "Username" +msgstr "" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.get_member_named:13 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.get_member_named:11 msgid "If no member is found, ``None`` is returned." msgstr "メンバーが見つからない場合は ``None`` が返されます。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.get_member_named:17 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.get_member_named:15 msgid "``name`` parameter is now positional-only." msgstr "``name`` 引数は位置限定引数になりました。" #: ../../../discord/guild.py:docstring of discord.guild.Guild.get_member_named:19 -msgid "The name of the member to lookup with an optional discriminator." -msgstr "検索するメンバーの名前。タグをつけることもできます。" +msgid "Looking up users via discriminator due to Discord API change." +msgstr "" + +#: ../../../discord/guild.py:docstring of discord.guild.Guild.get_member_named:21 +msgid "The name of the member to lookup." +msgstr "" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.get_member_named:22 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.get_member_named:24 msgid "The member in this guild with the associated name. If not found then ``None`` is returned." msgstr "渡された名前のメンバー。見つからなかった場合は ``None`` が返ります。" @@ -11559,19 +11859,19 @@ msgstr "チャンネルの名前。" #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_text_channel:43 #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_voice_channel:11 -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:15 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:13 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:14 msgid "A :class:`dict` of target (either a role or a member) to :class:`PermissionOverwrite` to apply upon creation of a channel. Useful for creating secret channels." msgstr "チャンネル作成時に適用すべき、対象(ロールまたはメンバー)をキーとし :class:`PermissionOverwrite` を値とする :class:`dict` 。秘密のチャンネルの作成に便利です。" #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_text_channel:47 #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_voice_channel:15 -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:19 -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:16 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:17 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:20 msgid "The category to place the newly created channel under. The permissions will be automatically synced to category if no overwrites are provided." msgstr "新しく作成されたチャンネルを配置するカテゴリ。上書きがない場合、権限は自動的にカテゴリと同期されます。" #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_text_channel:54 -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:13 #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.edit:22 msgid "The new channel's topic." msgstr "新しいチャンネルのトピック。" @@ -11581,7 +11881,7 @@ msgid "Specifies the slowmode rate limit for user in this channel, in seconds. T msgstr "チャンネル内の低速モードの時間を秒単位で指定します。最大値は ``21600`` です。" #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_text_channel:59 -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:23 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:27 #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.edit:26 #: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.edit:24 #: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:24 @@ -11597,28 +11897,32 @@ msgid "The default auto archive duration for threads created in the text channel msgstr "このテキストチャンネルで作成されたスレッドの分単位のデフォルトの自動アーカイブ期間。これは ``60`` 、 ``1440`` 、 ``4320`` 、または ``10080`` でないといけません。" #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_text_channel:70 +msgid "The default slowmode delay in seconds for threads created in the text channel." +msgstr "" + +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_text_channel:74 #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_voice_channel:35 -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:26 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:41 msgid "The reason for creating this channel. Shows up on the audit log." msgstr "チャンネルを作成する理由。監査ログに表示されます。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_text_channel:75 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_text_channel:79 #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_voice_channel:40 -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:31 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:46 #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_category:16 #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_category:16 msgid "The permission overwrite information is not in proper form." msgstr "権限の上書きの情報が適切なものでない場合。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_text_channel:77 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_text_channel:81 #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_voice_channel:42 -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:33 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:48 #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_category:18 #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_category:18 msgid "The channel that was just created." msgstr "作成されたチャンネル。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_text_channel:78 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_text_channel:82 #: ../../../discord/channel.py:docstring of discord.channel.CategoryChannel.create_text_channel:6 msgid ":class:`TextChannel`" msgstr ":class:`TextChannel`" @@ -11628,17 +11932,20 @@ msgid "This is similar to :meth:`create_text_channel` except makes a :class:`Voi msgstr "これは :class:`VoiceChannel` を作る点以外では :meth:`create_text_channel` と似ています。" #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_voice_channel:22 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:24 #: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel:62 #: ../../../discord/channel.py:docstring of discord.channel.StageChannel:70 msgid "The channel's preferred audio bitrate in bits per second." msgstr "チャンネルのビット毎秒単位の推奨オーディオビットレート設定。" #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_voice_channel:24 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:28 #: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel:68 msgid "The channel's limit for number of members that can be in a voice channel." msgstr "ボイスチャンネルに参加できるメンバー数の制限。" #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_voice_channel:26 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:32 #: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel:74 msgid "The region for the voice channel's voice communication. A value of ``None`` indicates automatic voice region detection." msgstr "ボイスチャンネルの音声通信のためのリージョン。値が ``None`` の場合は自動で検出されます。" @@ -11652,7 +11959,7 @@ msgstr ":class:`VoiceChannel`" msgid "This is similar to :meth:`create_text_channel` except makes a :class:`StageChannel` instead." msgstr "これは :class:`StageChannel` を作る点以外では :meth:`create_text_channel` と似ています。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:34 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_stage_channel:49 #: ../../../discord/channel.py:docstring of discord.channel.CategoryChannel.create_stage_channel:8 msgid ":class:`StageChannel`" msgstr ":class:`StageChannel`" @@ -11676,32 +11983,46 @@ msgstr ":class:`CategoryChannel`" msgid "Similar to :meth:`create_text_channel` except makes a :class:`ForumChannel` instead." msgstr "これは :class:`ForumChannel` を作る点以外では :meth:`create_text_channel` と似ています。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:14 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:18 msgid "The channel's topic." msgstr "チャンネルのトピック。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:25 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:29 msgid "Specifies the slowmode rate limit for users in this channel, in seconds. The maximum possible value is ``21600``." msgstr "チャンネル内の低速モードの時間を秒単位で指定します。最大値は ``21600`` です。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:28 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:32 msgid "The reason for creating this channel. Shows up in the audit log." msgstr "チャンネルを作成する理由。監査ログに表示されます。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:30 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:34 msgid "The default auto archive duration for threads created in the forum channel (in minutes). Must be one of ``60``, ``1440``, ``4320``, or ``10080``." msgstr "このフォーラムチャンネルで作成されたスレッドの分単位のデフォルトの自動アーカイブ期間。これは ``60`` 、 ``1440`` 、 ``4320`` 、または ``10080`` でないといけません。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:33 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:37 #: ../../../discord/channel.py:docstring of discord.channel.ForumChannel:92 msgid "The default slowmode delay in seconds for threads created in this forum." msgstr "このフォーラムで作成されたスレッドの、デフォルトの秒単位の低速モードレート制限。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:37 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:41 +#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel:118 +msgid "The default sort order for posts in this forum channel." +msgstr "" + +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:45 +#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel:100 +msgid "The default reaction emoji for threads created in this forum to show in the add reaction button." +msgstr "このフォーラムで作成されたスレッドで、デフォルトでリアクション追加ボタンに表示するリアクション絵文字。" + +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:50 +msgid "The default layout for posts in this forum." +msgstr "" + +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:54 msgid "The available tags for this forum channel." msgstr "このフォーラムチャンネルで利用可能なタグ。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:47 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_forum:64 #: ../../../discord/channel.py:docstring of discord.channel.CategoryChannel.create_forum:8 msgid ":class:`ForumChannel`" msgstr ":class:`ForumChannel`" @@ -11739,139 +12060,145 @@ msgid "You must have :attr:`~Permissions.manage_guild` to edit the guild." msgstr "ルールを編集するには、 :attr:`~Permissions.manage_guild` が必要です。" #: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:7 -msgid "The ``rules_channel`` and ``public_updates_channel`` keyword parameters were added." -msgstr "``rules_channel`` と ``public_updates_channel`` キーワード引数が追加されました。" - -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:10 -msgid "The ``discovery_splash`` and ``community`` keyword parameters were added." -msgstr "``discovery_splash`` と ``community`` キーワード引数が追加されました。" - -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:13 msgid "The newly updated guild is returned." msgstr "新しく更新されたギルドが返されるようになりました。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:16 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:10 msgid "The ``region`` keyword parameter has been removed." msgstr "``region`` キーワード引数が削除されました。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:23 -msgid "The ``preferred_locale`` keyword parameter now accepts an enum instead of :class:`str`." -msgstr "``preferred_locale`` キーワード引数が :class:`str` の代わりに列挙型を受け付けるようになりました。" - -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:26 -msgid "The ``premium_progress_bar_enabled`` keyword parameter was added." -msgstr "``premium_progress_bar_enabled`` キーワード引数が追加されました。" - -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:29 -msgid "The ``discoverable`` and ``invites_disabled`` keyword parameters were added." -msgstr "``discoverable`` と ``invites_disabled`` キーワード引数が追加されました。" - -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:32 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:17 msgid "The new name of the guild." msgstr "ギルドの新しい名前。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:34 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:19 msgid "The new description of the guild. Could be ``None`` for no description. This is only available to guilds that contain ``COMMUNITY`` in :attr:`Guild.features`." msgstr "ギルドの新しい説明。説明がない場合 ``None`` を指定することができます。ただし、これは :attr:`Guild.features` に ``COMMUNITY`` があるギルドでのみ使用できます。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:37 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:22 msgid "A :term:`py:bytes-like object` representing the icon. Only PNG/JPEG is supported. GIF is only available to guilds that contain ``ANIMATED_ICON`` in :attr:`Guild.features`. Could be ``None`` to denote removal of the icon." msgstr "アイコンを示す :term:`py:bytes-like object` 。PNGとJPEGのみ使用できます。 :attr:`Guild.features` に ``ANIMATED_ICON`` を含むギルドではGIFも使用できます。アイコンを削除する場合には ``None`` を指定できます。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:41 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:26 msgid "A :term:`py:bytes-like object` representing the banner. Could be ``None`` to denote removal of the banner. This is only available to guilds that contain ``BANNER`` in :attr:`Guild.features`." msgstr "バナーを示す :term:`py:bytes-like object` 。バナーを削除する場合には ``None`` を指定できます。 :attr:`Guild.features` に ``BANNER`` を含むギルドでのみ利用可能です。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:45 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:30 msgid "A :term:`py:bytes-like object` representing the invite splash. Only PNG/JPEG supported. Could be ``None`` to denote removing the splash. This is only available to guilds that contain ``INVITE_SPLASH`` in :attr:`Guild.features`." msgstr "招待スプラッシュを示す :term:`py:bytes-like object` 。PNGとJPEGのみ使用できます。スプラッシュを削除する場合には ``None`` を指定できます。 :attr:`Guild.features` に ``INVITE_SPLASH`` を含むギルドでのみ利用可能です。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:50 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:35 msgid "A :term:`py:bytes-like object` representing the discovery splash. Only PNG/JPEG supported. Could be ``None`` to denote removing the splash. This is only available to guilds that contain ``DISCOVERABLE`` in :attr:`Guild.features`." msgstr "発見画面のスプラッシュを示す :term:`py:bytes-like object` 。PNGとJPEGのみ使用できます。スプラッシュを削除する場合には ``None`` を指定できます。 :attr:`Guild.features` に ``DISCOVERABLE`` を含むギルドでのみ利用可能です。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:55 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:42 msgid "Whether the guild should be a Community guild. If set to ``True``\\, both ``rules_channel`` and ``public_updates_channel`` parameters are required." msgstr "ギルドをコミュニティギルドにするかどうか。``True`` に設定した場合、``rules_channel`` と ``public_updates_channel`` の両方のパラメータが必要です。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:58 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:47 msgid "The new channel that is the AFK channel. Could be ``None`` for no AFK channel." msgstr "AFKチャンネルに設定する新しいチャンネル。AFKチャンネルを設定しない場合には ``None`` を指定することができます。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:62 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:51 msgid "The new owner of the guild to transfer ownership to. Note that you must be owner of the guild to do this." msgstr "ギルドの新しい所有者。ただし、これを設定する場合には、ギルドの所有者である必要があります。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:65 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:54 msgid "The new verification level for the guild." msgstr "ギルドの新しい認証レベル。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:67 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:56 msgid "The new default notification level for the guild." msgstr "ギルドの新しい標準の通知レベル。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:69 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:58 msgid "The new explicit content filter for the guild." msgstr "ギルドの新しい、不適切な表現のフィルター設定。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:71 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:60 msgid "The new vanity code for the guild." msgstr "ギルドの新しいバニティコード。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:73 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:62 msgid "The new channel that is used for the system channel. Could be ``None`` for no system channel." msgstr "システムチャンネルに設定する新しいチャンネル。システムチャンネルを設定しない場合には ``None`` を指定することができます。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:75 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:64 msgid "The new system channel settings to use with the new system channel." msgstr "新しいシステムチャンネルの使用設定。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:77 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:66 msgid "The new preferred locale for the guild. Used as the primary language in the guild." msgstr "ギルドの新しい優先ロケール。ギルドの主要言語として使用されます。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:79 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:70 +msgid "Now accepts an enum instead of :class:`str`." +msgstr "" + +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:72 msgid "The new channel that is used for rules. This is only available to guilds that contain ``COMMUNITY`` in :attr:`Guild.features`. Could be ``None`` for no rules channel." msgstr "ルールに使用される新しいチャンネル。これは :attr:`Guild.features` に ``COMMUNITY`` を含むギルドでのみ利用できます。ルールチャネルがない場合は ``None`` を指定できます。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:83 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:78 msgid "The new channel that is used for public updates from Discord. This is only available to guilds that contain ``COMMUNITY`` in :attr:`Guild.features`. Could be ``None`` for no public updates channel." msgstr "Discordからのコミュニティーアップデートに使用される新しいチャンネル。これは :attr:`Guild.features` に ``COMMUNITY`` を含むギルドでのみ利用できます。コミュニティーアップデートチャネルがない場合は ``None`` を指定できます。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:87 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:84 msgid "Whether the premium AKA server boost level progress bar should be enabled for the guild." msgstr "ギルドのプレミアム、すなわちサーバーブーストレベルの進捗バーを有効化すべきか。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:89 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:88 msgid "Whether server discovery is enabled for this guild." msgstr "このギルドでサーバー発見を有効にするかどうか。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:91 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:92 msgid "Whether joining via invites should be disabled for the guild." msgstr "招待でのギルドへの参加を無効にするかどうか。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:93 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:96 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit_widget:9 +msgid "Whether to enable the widget for the guild." +msgstr "ギルドのウィジェットを有効にするかどうか。" + +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:100 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit_widget:11 +msgid "The new widget channel. ``None`` removes the widget channel." +msgstr "新しいウィジェットチャンネル。``None`` を指定するとウィジェットチャンネルを除去できます。" + +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:104 +msgid "The new guild's Multi-Factor Authentication requirement level. Note that you must be owner of the guild to do this." +msgstr "" + +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:109 msgid "The reason for editing this guild. Shows up on the audit log." msgstr "ギルドを編集する理由。監査ログに表示されます。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:96 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:111 +msgid "Whether the alerts for raid protection should be disabled for the guild." +msgstr "" + +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:115 +msgid "The new channel that is used for safety alerts. This is only available to guilds that contain ``COMMUNITY`` in :attr:`Guild.features`. Could be ``None`` for no safety alerts channel." +msgstr "" + +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:122 msgid "You do not have permissions to edit the guild." msgstr "ギルドを編集する権限がない場合。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:97 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:123 #: ../../../discord/integrations.py:docstring of discord.integrations.StreamIntegration.edit:19 msgid "Editing the guild failed." msgstr "ギルドの編集に失敗した場合。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:98 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:124 msgid "The image format passed in to ``icon`` is invalid. It must be PNG or JPG. This is also raised if you are not the owner of the guild and request an ownership transfer." msgstr "``icon`` に渡された画像形式が無効な場合。これはPNGかJPGでなくてはいけません。また、あなたがギルドの所有者でないのに、ギルドの所有権の移動を行おうとした場合にも発生します。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:99 -msgid "The type passed to the ``default_notifications``, ``verification_level``, ``explicit_content_filter``, or ``system_channel_flags`` parameter was of the incorrect type." -msgstr "``default_notifications`` 、 ``verification_level`` 、 ``explicit_content_filter`` 、または ``system_channel_flags`` に間違った型の値が渡されたとき。" +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:125 +msgid "The type passed to the ``default_notifications``, ``rules_channel``, ``public_updates_channel``, ``safety_alerts_channel`` ``verification_level``, ``explicit_content_filter``, ``system_channel_flags``, or ``mfa_level`` parameter was of the incorrect type." +msgstr "" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:101 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit:127 msgid "The newly updated guild. Note that this has the same limitations as mentioned in :meth:`Client.fetch_guild` and may not have full data." msgstr "新しく更新されたギルド。これは :meth:`Client.fetch_guild` に記載されているものと同じ制限があり、完全なデータを持っていない可能性があることに注意してください。" @@ -12130,7 +12457,8 @@ msgstr "これを行うには、 :attr:`~.Permissions.manage_webhooks` が必要 #: ../../../discord/guild.py:docstring of discord.guild.Guild.webhooks:7 #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.webhooks:7 #: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.webhooks:7 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.webhooks:9 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.webhooks:9 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.webhooks:9 msgid "You don't have permissions to get the webhooks." msgstr "Webhookを取得する権限がない場合。" @@ -12141,7 +12469,8 @@ msgstr "ギルド内のWebhook。" #: ../../../discord/guild.py:docstring of discord.guild.Guild.webhooks:10 #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.webhooks:10 #: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.webhooks:10 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.webhooks:12 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.webhooks:12 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.webhooks:12 msgid "List[:class:`Webhook`]" msgstr "List[:class:`Webhook`]" @@ -12403,7 +12732,7 @@ msgid "The scheduled event." msgstr "スケジュールイベント。" #: ../../../discord/guild.py:docstring of discord.guild.Guild.fetch_scheduled_event:17 -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:49 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:51 #: ../../../discord/scheduled_event.py:docstring of discord.scheduled_event.ScheduledEvent.start:19 #: ../../../discord/scheduled_event.py:docstring of discord.scheduled_event.ScheduledEvent.end:19 #: ../../../discord/scheduled_event.py:docstring of discord.scheduled_event.ScheduledEvent.cancel:19 @@ -12463,48 +12792,54 @@ msgid "Required if the entity type is :attr:`EntityType.external`." msgstr ":attr:`EntityType.external` の場合必須です。" #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:28 +#: ../../../discord/scheduled_event.py:docstring of discord.scheduled_event.ScheduledEvent:63 +#: ../../../discord/scheduled_event.py:docstring of discord.scheduled_event.ScheduledEvent.edit:30 +msgid "The privacy level of the scheduled event." +msgstr "スケジュールイベントのプライバシーレベル。" + +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:30 msgid "The entity type of the scheduled event. If the channel is a :class:`StageInstance` or :class:`VoiceChannel` then this is automatically set to the appropriate entity type. If no channel is passed then the entity type is assumed to be :attr:`EntityType.external`" msgstr "スケジュールイベントの開催場所の種類。もしチャンネルが :class:`StageInstance` または :class:`VoiceChannel` の場合これは適切な種類に自動で設定されます。もしチャンネルが渡されなかった場合は :attr:`EntityType.external` とみなされます。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:34 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:36 msgid "The image of the scheduled event." msgstr "スケジュールイベントの画像。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:36 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:38 msgid "The location of the scheduled event. Required if the ``entity_type`` is :attr:`EntityType.external`." msgstr "スケジュールイベントの場所。 ``entity_type`` が :attr:`EntityType.external` の場合必須です。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:36 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:38 #: ../../../discord/scheduled_event.py:docstring of discord.scheduled_event.ScheduledEvent:95 msgid "The location of the scheduled event." msgstr "スケジュールイベントの場所。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:38 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:40 msgid "Required if the ``entity_type`` is :attr:`EntityType.external`." msgstr "``entity_type`` が :attr:`EntityType.external` の場合必須です。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:40 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:42 msgid "The reason for creating this scheduled event. Shows up on the audit log." msgstr "スケジュールイベントを作成する理由。監査ログに表示されます。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:43 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:45 msgid "``image`` was not a :term:`py:bytes-like object`, or ``privacy_level`` was not a :class:`PrivacyLevel`, or ``entity_type`` was not an :class:`EntityType`, ``status`` was not an :class:`EventStatus`, or an argument was provided that was incompatible with the provided ``entity_type``." msgstr "``image`` が :term:`py:bytes-like object` でない場合、 ``privacy_level`` が :class:`PrivacyLevel` でない場合、 ``entity_type`` が :class:`EntityType` でない場合、 ``status`` が :class:`EventStatus` でない場合、または引数が渡された ``entity_type`` と互換性のない場合。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:44 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:46 #: ../../../discord/scheduled_event.py:docstring of discord.scheduled_event.ScheduledEvent.edit:48 msgid "``start_time`` or ``end_time`` was not a timezone-aware datetime object." msgstr "``start_time`` や ``end_time`` がtimezone awareなdatetimeオブジェクトでない場合。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:45 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:47 msgid "You are not allowed to create scheduled events." msgstr "スケジュールイベントを作成する権限がない場合。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:46 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:48 msgid "Creating the scheduled event failed." msgstr "スケジュールイベントの作成に失敗した場合。" -#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:48 +#: ../../../discord/guild.py:docstring of discord.guild.Guild.create_scheduled_event:50 msgid "The created scheduled event." msgstr "作成されたスケジュールイベント。" @@ -12959,16 +13294,8 @@ msgid ":class:`Widget`" msgstr ":class:`Widget`" #: ../../../discord/guild.py:docstring of discord.guild.Guild.edit_widget:3 -msgid "Edits the widget of the guild." -msgstr "ギルドのウィジェットを編集します。" - -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit_widget:9 -msgid "Whether to enable the widget for the guild." -msgstr "ギルドのウィジェットを有効にするかどうか。" - -#: ../../../discord/guild.py:docstring of discord.guild.Guild.edit_widget:11 -msgid "The new widget channel. ``None`` removes the widget channel." -msgstr "新しいウィジェットチャンネル。``None`` を指定するとウィジェットチャンネルを除去できます。" +msgid "Edits the widget of the guild. This can also be done with :attr:`~Guild.edit`." +msgstr "" #: ../../../discord/guild.py:docstring of discord.guild.Guild.edit_widget:13 msgid "The reason for editing this widget. Shows up on the audit log." @@ -13100,8 +13427,8 @@ msgid "The actions that will be taken when the automod rule is triggered." msgstr "自動管理ルールが発動したときの対応。" #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_automod_rule:17 -msgid "Whether the automod rule is enabled. Discord will default to ``False``." -msgstr "自動管理ルールを有効にするか。Discordでのデフォルトは ``False`` です。" +msgid "Whether the automod rule is enabled. Defaults to ``False``." +msgstr "" #: ../../../discord/guild.py:docstring of discord.guild.Guild.create_automod_rule:20 msgid "A list of roles that will be exempt from the automod rule." @@ -13127,19 +13454,19 @@ msgstr "自動管理ルールの作成に失敗した場合。" msgid "The automod rule that was created." msgstr "作成された自動管理ルール。" -#: ../../api.rst:4137 +#: ../../api.rst:4266 msgid "A namedtuple which represents a ban returned from :meth:`~Guild.bans`." msgstr ":meth:`~Guild.bans` から返されたBANを表すnamedtuple。" -#: ../../api.rst:4141 +#: ../../api.rst:4270 msgid "The reason this user was banned." msgstr "ユーザーがBANされた理由。" -#: ../../api.rst:4146 +#: ../../api.rst:4275 msgid "The :class:`User` that was banned." msgstr "BANされた :class:`User` 。" -#: ../../api.rst:4152 +#: ../../api.rst:4281 msgid "ScheduledEvent" msgstr "ScheduledEvent" @@ -13179,11 +13506,6 @@ msgstr "スケジュールイベントのUTCの開始予定時間。" msgid "The time that the scheduled event will end in UTC." msgstr "スケジュールイベントのUTCの終了予定時間。" -#: ../../../discord/scheduled_event.py:docstring of discord.scheduled_event.ScheduledEvent:63 -#: ../../../discord/scheduled_event.py:docstring of discord.scheduled_event.ScheduledEvent.edit:30 -msgid "The privacy level of the scheduled event." -msgstr "スケジュールイベントのプライバシーレベル。" - #: ../../../discord/scheduled_event.py:docstring of discord.scheduled_event.ScheduledEvent:75 msgid "The number of users subscribed to the scheduled event." msgstr "スケジュールイベントに購読しているユーザー数。" @@ -13204,11 +13526,6 @@ msgstr "スケジュールイベントの属するギルド。" msgid "The channel this scheduled event is in." msgstr "スケジュールイベントの属するチャンネル。" -#: ../../../discord/scheduled_event.py:docstring of discord.ScheduledEvent.channel:3 -#: ../../../discord/member.py:docstring of discord.member.VoiceState:74 -msgid "Optional[Union[:class:`VoiceChannel`, :class:`StageChannel`]]" -msgstr "Optional[Union[:class:`VoiceChannel`, :class:`StageChannel`]]" - #: ../../../discord/scheduled_event.py:docstring of discord.ScheduledEvent.url:1 msgid "The url for the scheduled event." msgstr "スケジュールイベントのURL。" @@ -13402,7 +13719,7 @@ msgstr "このイベントに購読済みのユーザー。" msgid "List[:class:`User`]" msgstr "List[:class:`User`]" -#: ../../api.rst:4161 +#: ../../api.rst:4290 msgid "Integration" msgstr "Integration" @@ -13544,7 +13861,7 @@ msgstr "この連携サービスで絵文字を同期するか(現在Twitch専 #: ../../../discord/invite.py:docstring of discord.invite.Invite:71 #: ../../../discord/invite.py:docstring of discord.invite.Invite:84 #: ../../../discord/template.py:docstring of discord.template.Template:60 -#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:73 +#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:81 msgid "Optional[:class:`bool`]" msgstr "Optional[:class:`bool`]" @@ -13616,7 +13933,7 @@ msgstr "不完全なギルドの連携サービス。" msgid "The id of the application this integration belongs to." msgstr "このインテグレーションが属するアプリケーションのID。" -#: ../../api.rst:4194 +#: ../../api.rst:4323 msgid "Member" msgstr "Member" @@ -13641,8 +13958,8 @@ msgid "Returns the member's hash." msgstr "メンバーのハッシュ値を返します。" #: ../../../discord/member.py:docstring of discord.member.Member:23 -msgid "Returns the member's name with the discriminator." -msgstr "メンバー名とそのDiscordタグを返します。" +msgid "Returns the member's handle (e.g. ``name`` or ``name#discriminator``)." +msgstr "" #: ../../../discord/member.py:docstring of discord.member.Member:27 msgid "An aware datetime object that specifies the date and time in UTC that the member joined the guild. If the member left and rejoined the guild, this will be the latest date. In certain cases, this can be ``None``." @@ -13665,8 +13982,8 @@ msgid "The guild that the member belongs to." msgstr "メンバーが属するギルド。" #: ../../../discord/member.py:docstring of discord.member.Member:52 -msgid "The guild specific nickname of the user." -msgstr "ユーザーのギルド固有のニックネーム。" +msgid "The guild specific nickname of the user. Takes precedence over the global name." +msgstr "" #: ../../../discord/member.py:docstring of discord.member.Member:58 msgid "Whether the member is pending member verification." @@ -13692,6 +14009,10 @@ msgstr ":attr:`User.id` と同じです。" msgid "Equivalent to :attr:`User.discriminator`" msgstr ":attr:`User.discriminator` と同じです。" +#: ../../../discord/member.py:docstring of discord.Member.global_name:1 +msgid "Equivalent to :attr:`User.global_name`" +msgstr "" + #: ../../../discord/member.py:docstring of discord.Member.bot:1 msgid "Equivalent to :attr:`User.bot`" msgstr ":attr:`User.bot` と同じです。" @@ -13748,7 +14069,7 @@ msgstr "メンバーのステータス。値が不明なものである場合こ #: ../../../discord/member.py:docstring of discord.Member.mobile_status:3 #: ../../../discord/member.py:docstring of discord.Member.desktop_status:3 #: ../../../discord/member.py:docstring of discord.Member.web_status:3 -#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:49 +#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:57 msgid ":class:`Status`" msgstr ":class:`Status`" @@ -13821,7 +14142,7 @@ msgid "A user may have multiple activities, these can be accessed under :attr:`a msgstr "ユーザーは複数のアクティビティを行っていることがあります。これらは :attr:`activities` でアクセスできます。" #: ../../../discord/member.py:docstring of discord.Member.activity:14 -#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:67 +#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:75 msgid "Optional[Union[:class:`BaseActivity`, :class:`Spotify`]]" msgstr "Optional[Union[:class:`BaseActivity`, :class:`Spotify`]]" @@ -13954,6 +14275,7 @@ msgid "timed_out_until" msgstr "timed_out_until" #: ../../../discord/member.py:docstring of discord.member.Member.edit:20 +#: ../../../discord/member.py:docstring of discord.member.Member.edit:22 msgid ":attr:`Permissions.moderate_members`" msgstr ":attr:`Permissions.moderate_members`" @@ -13961,10 +14283,6 @@ msgstr ":attr:`Permissions.moderate_members`" msgid "bypass_verification" msgstr "bypass_verification" -#: ../../../discord/member.py:docstring of discord.member.Member.edit:22 -msgid ":attr:`Permissions.manage_guild`" -msgstr ":attr:`Permissions.manage_guild`" - #: ../../../discord/member.py:docstring of discord.member.Member.edit:27 msgid "Can now pass ``None`` to ``voice_channel`` to kick a member from voice." msgstr "``None`` を ``voice_channel`` に渡してボイスからメンバーを追放できるようになりました。" @@ -14157,7 +14475,7 @@ msgstr "このメンバーがタイムアウトされているかどうかを返 msgid "``True`` if the member is timed out. ``False`` otherwise." msgstr "メンバーがタイムアウトした場合は ``True`` 。そうでなければ、 ``False`` 。" -#: ../../api.rst:4207 +#: ../../api.rst:4336 msgid "Spotify" msgstr "Spotify" @@ -14274,7 +14592,7 @@ msgstr ":class:`datetime.timedelta`" msgid "The party ID of the listening party." msgstr "リスニングパーティーのパーティーID。" -#: ../../api.rst:4215 +#: ../../api.rst:4344 msgid "VoiceState" msgstr "VoiceState" @@ -14326,7 +14644,7 @@ msgstr "ユーザーがギルドのAFKチャンネルにいるかどうかを示 msgid "The voice channel that the user is currently connected to. ``None`` if the user is not currently in a voice channel." msgstr "ユーザーが現在接続しているボイスチャンネル。ユーザーがボイスチャンネルに接続していない場合は ``None`` 。" -#: ../../api.rst:4223 +#: ../../api.rst:4352 msgid "Emoji" msgstr "Emoji" @@ -14446,7 +14764,7 @@ msgstr "絵文字の編集中にエラーが発生した場合。" msgid "The newly updated emoji." msgstr "新しく更新された絵文字。" -#: ../../api.rst:4232 +#: ../../api.rst:4361 msgid "PartialEmoji" msgstr "PartialEmoji" @@ -14544,7 +14862,7 @@ msgstr "これがカスタム絵文字でない場合は、空の文字列が返 msgid "The PartialEmoji is not a custom emoji." msgstr "PartialEmojiがカスタム絵文字でない場合。" -#: ../../api.rst:4241 +#: ../../api.rst:4370 msgid "Role" msgstr "Role" @@ -14772,7 +15090,7 @@ msgstr "ロールを削除する権限がない場合。" msgid "Deleting the role failed." msgstr "ロールの削除に失敗した場合。" -#: ../../api.rst:4249 +#: ../../api.rst:4378 msgid "RoleTags" msgstr "RoleTags" @@ -14808,7 +15126,7 @@ msgstr ":class:`bool`: ロールが購入可能かどうか。" msgid ":class:`bool`: Whether the role is a guild's linked role." msgstr ":class:`bool`: ロールがギルドの関連付けられたロールかどうか。" -#: ../../api.rst:4257 +#: ../../api.rst:4386 msgid "PartialMessageable" msgstr "PartialMessageable" @@ -14821,7 +15139,7 @@ msgid "The only way to construct this class is through :meth:`Client.get_partial msgstr "これは :meth:`Client.get_partial_messageable` によってのみ作成できます。" #: ../../../discord/channel.py:docstring of discord.channel.PartialMessageable:6 -#: ../../../discord/message.py:docstring of discord.message.PartialMessage:12 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage:13 msgid "Note that this class is trimmed down and has no rich attributes." msgstr "これは機能が削られていてリッチな属性を持ちません。" @@ -14886,44 +15204,44 @@ msgstr "解決された権限。" #: ../../../discord/channel.py:docstring of discord.channel.PartialMessageable.get_partial_message:1 #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.get_partial_message:1 #: ../../../discord/threads.py:docstring of discord.threads.Thread.get_partial_message:1 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.get_partial_message:1 -#: ../../../discord/channel.py:docstring of discord.channel.DMChannel.get_partial_message:1 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.get_partial_message:1 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.get_partial_message:1 msgid "Creates a :class:`PartialMessage` from the message ID." msgstr "メッセージIDから :class:`PartialMessage` を作成します。" #: ../../../discord/channel.py:docstring of discord.channel.PartialMessageable.get_partial_message:3 #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.get_partial_message:3 #: ../../../discord/threads.py:docstring of discord.threads.Thread.get_partial_message:3 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.get_partial_message:3 -#: ../../../discord/channel.py:docstring of discord.channel.DMChannel.get_partial_message:3 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.get_partial_message:3 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.get_partial_message:3 msgid "This is useful if you want to work with a message and only have its ID without doing an unnecessary API call." msgstr "これは、IDしかない場合に不必要なAPI呼び出しなくメッセージに関する作業をする時に便利です。" #: ../../../discord/channel.py:docstring of discord.channel.PartialMessageable.get_partial_message:6 #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.get_partial_message:12 #: ../../../discord/threads.py:docstring of discord.threads.Thread.get_partial_message:8 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.get_partial_message:8 -#: ../../../discord/channel.py:docstring of discord.channel.DMChannel.get_partial_message:12 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.get_partial_message:8 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.get_partial_message:8 msgid "The message ID to create a partial message for." msgstr "部分的なメッセージのID。" #: ../../../discord/channel.py:docstring of discord.channel.PartialMessageable.get_partial_message:9 #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.get_partial_message:15 #: ../../../discord/threads.py:docstring of discord.threads.Thread.get_partial_message:11 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.get_partial_message:11 -#: ../../../discord/channel.py:docstring of discord.channel.DMChannel.get_partial_message:15 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.get_partial_message:11 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.get_partial_message:11 msgid "The partial message." msgstr "部分的なメッセージ。" #: ../../../discord/channel.py:docstring of discord.channel.PartialMessageable.get_partial_message:10 #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.get_partial_message:16 #: ../../../discord/threads.py:docstring of discord.threads.Thread.get_partial_message:12 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.get_partial_message:12 -#: ../../../discord/channel.py:docstring of discord.channel.DMChannel.get_partial_message:16 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.get_partial_message:12 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.get_partial_message:12 msgid ":class:`PartialMessage`" msgstr ":class:`PartialMessage`" -#: ../../api.rst:4266 +#: ../../api.rst:4395 msgid "TextChannel" msgstr "TextChannel" @@ -14979,12 +15297,13 @@ msgstr "チャンネルのトピック。存在しない場合は ``None`` に #: ../../../discord/channel.py:docstring of discord.channel.TextChannel:60 #: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel:94 +#: ../../../discord/channel.py:docstring of discord.channel.StageChannel:97 msgid "The last message ID of the message sent to this channel. It may *not* point to an existing or valid message." msgstr "このチャンネルに送信された最後のメッセージのID。既存または有効なメッセージを指して *いない* 場合があります。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel:67 #: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel:103 -#: ../../../discord/channel.py:docstring of discord.channel.StageChannel:97 +#: ../../../discord/channel.py:docstring of discord.channel.StageChannel:106 msgid "The number of seconds a member must wait between sending messages in this channel. A value of ``0`` denotes that it is disabled. Bots and users with :attr:`~Permissions.manage_channels` or :attr:`~Permissions.manage_messages` bypass slowmode." msgstr "このチャンネルにメッセージを送信する間にメンバーが待たなければいけない時間。値が ``0`` の場合これは無効です。ボットやユーザーが :attr:`~Permissions.manage_channels` か :attr:`~Permissions.manage_messages` 権限を有する場合低速モードを回避できます。" @@ -14998,6 +15317,10 @@ msgstr "チャンネルに年齢制限がかかっているか。" msgid "The default auto archive duration in minutes for threads created in this channel." msgstr "このチャンネルで作成されたスレッドのデフォルトの分単位の自動アーカイブ期間。" +#: ../../../discord/channel.py:docstring of discord.channel.TextChannel:90 +msgid "The default slowmode delay in seconds for threads created in this channel." +msgstr "" + #: ../../../discord/channel.py:docstring of discord.TextChannel.type:1 #: ../../../discord/channel.py:docstring of discord.ForumChannel.type:1 #: ../../../discord/threads.py:docstring of discord.Thread.type:1 @@ -15035,30 +15358,35 @@ msgstr ":class:`bool`: チャンネルがニュースチャンネルかをチェ #: ../../../discord/channel.py:docstring of discord.TextChannel.last_message:1 #: ../../../discord/channel.py:docstring of discord.VoiceChannel.last_message:1 +#: ../../../discord/channel.py:docstring of discord.StageChannel.last_message:1 msgid "Retrieves the last message from this channel in cache." msgstr "キャッシュからこのチャンネルに最後に送信されたメッセージを取得します。" #: ../../../discord/channel.py:docstring of discord.TextChannel.last_message:3 #: ../../../discord/threads.py:docstring of discord.Thread.last_message:3 #: ../../../discord/channel.py:docstring of discord.VoiceChannel.last_message:3 +#: ../../../discord/channel.py:docstring of discord.StageChannel.last_message:3 msgid "The message might not be valid or point to an existing message." msgstr "このメッセージは有効でなかったり、存在するものでない場合があります。" #: ../../../discord/channel.py:docstring of discord.TextChannel.last_message:5 #: ../../../discord/threads.py:docstring of discord.Thread.last_message:5 #: ../../../discord/channel.py:docstring of discord.VoiceChannel.last_message:7 +#: ../../../discord/channel.py:docstring of discord.StageChannel.last_message:7 msgid "Reliable Fetching" msgstr "信頼性の高い取得方法" #: ../../../discord/channel.py:docstring of discord.TextChannel.last_message:8 #: ../../../discord/threads.py:docstring of discord.Thread.last_message:8 #: ../../../discord/channel.py:docstring of discord.VoiceChannel.last_message:10 +#: ../../../discord/channel.py:docstring of discord.StageChannel.last_message:10 msgid "For a slightly more reliable method of fetching the last message, consider using either :meth:`history` or :meth:`fetch_message` with the :attr:`last_message_id` attribute." msgstr "より信頼性のある最後のメッセージの取得方法として、 :meth:`history` や :attr:`last_message_id` と :meth:`fetch_message` の組み合わせがあります。" #: ../../../discord/channel.py:docstring of discord.TextChannel.last_message:13 #: ../../../discord/threads.py:docstring of discord.Thread.last_message:13 #: ../../../discord/channel.py:docstring of discord.VoiceChannel.last_message:15 +#: ../../../discord/channel.py:docstring of discord.StageChannel.last_message:15 msgid "The last message in this channel or ``None`` if not found." msgstr "このチャンネルの最後のメッセージ。見つからない場合は ``None`` です。" @@ -15066,7 +15394,7 @@ msgstr "このチャンネルの最後のメッセージ。見つからない場 #: ../../../discord/threads.py:docstring of discord.Thread.starter_message:8 #: ../../../discord/threads.py:docstring of discord.Thread.last_message:14 #: ../../../discord/channel.py:docstring of discord.VoiceChannel.last_message:16 -#: ../../../discord/raw_models.py:docstring of discord.raw_models.RawMessageDeleteEvent:25 +#: ../../../discord/channel.py:docstring of discord.StageChannel.last_message:16 msgid "Optional[:class:`Message`]" msgstr "Optional[:class:`Message`]" @@ -15114,19 +15442,19 @@ msgstr "チャンネルの位置。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.edit:28 #: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.edit:30 -#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:26 +#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:28 msgid "Whether to sync permissions with the channel's new or pre-existing category. Defaults to ``False``." msgstr "チャンネルの新しい、又は既存のカテゴリと権限を同期するか。デフォルトは ``False`` です。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.edit:31 #: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.edit:33 -#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:29 +#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:31 msgid "The new category for this channel. Can be ``None`` to remove the category." msgstr "チャンネルの新しいカテゴリ。カテゴリを削除するには ``None`` を指定できます。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.edit:34 #: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.edit:36 -#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:32 +#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:34 msgid "Specifies the slowmode rate limit for user in this channel, in seconds. A value of ``0`` disables slowmode. The maximum value possible is ``21600``." msgstr "秒単位でこのチャンネルのユーザーの低速モードの値を指定します。 ``0`` を渡すと低速モードを無効にできます。可能な最大の値は ``21600`` です。" @@ -15136,13 +15464,13 @@ msgstr "このテキストチャンネルのタイプを変更します。現時 #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.edit:41 #: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.edit:39 -#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:35 +#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:37 msgid "The reason for editing this channel. Shows up on the audit log." msgstr "チャンネルを編集する理由。監査ログに表示されます。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.edit:43 #: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.edit:41 -#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:37 +#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:39 #: ../../../discord/channel.py:docstring of discord.channel.CategoryChannel.edit:25 msgid "A :class:`Mapping` of target (either a role or a member) to :class:`PermissionOverwrite` to apply to the channel." msgstr "ターゲット(ロール又はメンバー)をキーとし適用される :class:`PermissionOverwrite` を値とする :class:`Mapping` 。" @@ -15152,46 +15480,53 @@ msgstr "ターゲット(ロール又はメンバー)をキーとし適用さ msgid "The new default auto archive duration in minutes for threads created in this channel. Must be one of ``60``, ``1440``, ``4320``, or ``10080``." msgstr "このチャンネルで作成されたスレッドの分単位のデフォルトの自動アーカイブ期間。これは ``60`` 、 ``1440`` 、 ``4320`` 、または ``10080`` でないといけません。" -#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.edit:52 -#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.edit:57 +#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.edit:51 +msgid "The new default slowmode delay in seconds for threads created in this channel." +msgstr "" + +#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.edit:56 +#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.edit:61 msgid "The new ``position`` is less than 0 or greater than the number of channels." msgstr "新しい ``position`` が0より小さいか、カテゴリの数より大きい場合。" -#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.edit:54 +#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.edit:58 #: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.edit:55 -#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:49 +#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:51 msgid "You do not have permissions to edit the channel." msgstr "チャンネルを編集する権限がない場合。" -#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.edit:55 +#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.edit:59 #: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.edit:56 -#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:50 +#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:52 msgid "Editing the channel failed." msgstr "チャンネルの編集に失敗した場合。" -#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.edit:57 +#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.edit:61 msgid "The newly edited text channel. If the edit was only positional then ``None`` is returned instead." msgstr "新しく編集されたテキストチャンネル。編集が位置のみだった場合は代わりに ``None`` が返されます。" -#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.edit:59 +#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.edit:63 msgid "Optional[:class:`.TextChannel`]" msgstr "Optional[:class:`.TextChannel`]" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.delete_messages:3 #: ../../../discord/threads.py:docstring of discord.threads.Thread.delete_messages:3 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.delete_messages:3 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.delete_messages:3 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.delete_messages:3 msgid "Deletes a list of messages. This is similar to :meth:`Message.delete` except it bulk deletes multiple messages." msgstr "メッセージのリストを削除します。複数のメッセージを一括削除する点を除き、これは :meth:`Message.delete` に似ています。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.delete_messages:6 #: ../../../discord/threads.py:docstring of discord.threads.Thread.delete_messages:6 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.delete_messages:6 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.delete_messages:6 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.delete_messages:6 msgid "As a special case, if the number of messages is 0, then nothing is done. If the number of messages is 1 then single message delete is done. If it's more than two, then bulk delete is used." msgstr "スペシャルケースとして、もしメッセージ数が0の場合は何もせず、メッセージ数が1の場合は単独のメッセージ削除が行われます。これが2以上の場合一括削除が行われます。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.delete_messages:10 #: ../../../discord/threads.py:docstring of discord.threads.Thread.delete_messages:10 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.delete_messages:10 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.delete_messages:10 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.delete_messages:10 msgid "You cannot bulk delete more than 100 messages or messages that are older than 14 days old." msgstr "14日以上前のメッセージや100件以上のメッセージを一括削除することはできません。" @@ -15206,144 +15541,168 @@ msgstr "``reason`` キーワード引数が追加されました。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.delete_messages:21 #: ../../../discord/threads.py:docstring of discord.threads.Thread.delete_messages:15 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.delete_messages:17 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.delete_messages:17 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.delete_messages:17 msgid "An iterable of messages denoting which ones to bulk delete." msgstr "一括削除するものを示すメッセージのiterableオブジェクト。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.delete_messages:23 #: ../../../discord/threads.py:docstring of discord.threads.Thread.delete_messages:17 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.delete_messages:19 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.delete_messages:19 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.delete_messages:19 msgid "The reason for deleting the messages. Shows up on the audit log." msgstr "メッセージを一括削除する理由。監査ログに表示されます。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.delete_messages:26 #: ../../../discord/threads.py:docstring of discord.threads.Thread.delete_messages:20 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.delete_messages:22 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.delete_messages:22 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.delete_messages:22 msgid "The number of messages to delete was more than 100." msgstr "削除するメッセージの数が100以上の場合。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.delete_messages:27 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.delete_messages:23 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.delete_messages:23 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.delete_messages:23 msgid "You do not have proper permissions to delete the messages." msgstr "メッセージを一括削除するための適切な権限がない場合。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.delete_messages:28 #: ../../../discord/threads.py:docstring of discord.threads.Thread.delete_messages:22 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.delete_messages:24 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.delete_messages:24 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.delete_messages:24 msgid "If single delete, then the message was already deleted." msgstr "1メッセージのみ削除する時、メッセージが既に削除されていた場合。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.delete_messages:29 #: ../../../discord/threads.py:docstring of discord.threads.Thread.delete_messages:23 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.delete_messages:25 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.delete_messages:25 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.delete_messages:25 msgid "Deleting the messages failed." msgstr "メッセージの削除に失敗した場合。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.purge:3 #: ../../../discord/threads.py:docstring of discord.threads.Thread.purge:3 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.purge:3 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:3 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:3 msgid "Purges a list of messages that meet the criteria given by the predicate ``check``. If a ``check`` is not provided then all messages are deleted without discrimination." msgstr "``check`` 関数の要件を満たすメッセージを一括削除します。 ``check`` が渡されない場合はすべてのメッセージが削除されます。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.purge:7 #: ../../../discord/threads.py:docstring of discord.threads.Thread.purge:7 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.purge:7 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:7 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:7 msgid "You must have :attr:`~Permissions.manage_messages` to delete messages even if they are your own. Having :attr:`~Permissions.read_message_history` is also needed to retrieve message history." msgstr "メッセージを削除するときに、それが自分のものであったとしても、削除するには :attr:`~Permissions.manage_messages` が必要です。メッセージの履歴を取得するために :attr:`~Permissions.read_message_history` も必要になります。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.purge:18 #: ../../../discord/threads.py:docstring of discord.threads.Thread.purge:14 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.purge:16 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:16 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:16 msgid "Deleting bot's messages ::" msgstr "Botによるメッセージを削除する ::" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.purge:26 #: ../../../discord/threads.py:docstring of discord.threads.Thread.purge:22 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.purge:24 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:24 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:24 msgid "The number of messages to search through. This is not the number of messages that will be deleted, though it can be." msgstr "検索するメッセージ数。これは削除するメッセージ数になるとは必ずしも限りません。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.purge:29 #: ../../../discord/threads.py:docstring of discord.threads.Thread.purge:25 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.purge:27 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:27 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:27 msgid "The function used to check if a message should be deleted. It must take a :class:`Message` as its sole parameter." msgstr "メッセージが削除されるかどうかを確認するために使用される関数。 :class:`Message` を唯一のパラメータとして受け取る必要があります。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.purge:32 #: ../../../discord/threads.py:docstring of discord.threads.Thread.purge:28 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.purge:30 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:30 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:30 msgid "Same as ``before`` in :meth:`history`." msgstr ":meth:`history` での ``before`` と同じです。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.purge:34 #: ../../../discord/threads.py:docstring of discord.threads.Thread.purge:30 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.purge:32 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:32 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:32 msgid "Same as ``after`` in :meth:`history`." msgstr ":meth:`history` での ``after`` と同じです。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.purge:36 #: ../../../discord/threads.py:docstring of discord.threads.Thread.purge:32 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.purge:34 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:34 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:34 msgid "Same as ``around`` in :meth:`history`." msgstr ":meth:`history` での ``around`` と同じです。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.purge:38 #: ../../../discord/threads.py:docstring of discord.threads.Thread.purge:34 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.purge:36 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:36 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:36 msgid "Same as ``oldest_first`` in :meth:`history`." msgstr ":meth:`history` での ``oldest_first`` と同じです。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.purge:40 #: ../../../discord/threads.py:docstring of discord.threads.Thread.purge:36 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.purge:38 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:38 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:38 msgid "If ``True``, use bulk delete. Setting this to ``False`` is useful for mass-deleting a bot's own messages without :attr:`Permissions.manage_messages`. When ``True``, will fall back to single delete if messages are older than two weeks." msgstr "``True`` の場合、一括削除を使用します。これを ``False`` に設定すると、 :attr:`Permissions.manage_messages` なしでボット自身のメッセージを一括削除することができます。 ``True`` の場合でも、2週間以上前のメッセージは個別に削除されます。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.purge:44 #: ../../../discord/threads.py:docstring of discord.threads.Thread.purge:40 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.purge:42 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:42 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:42 msgid "The reason for purging the messages. Shows up on the audit log." msgstr "メッセージを一括削除する理由。監査ログに表示されます。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.purge:47 #: ../../../discord/threads.py:docstring of discord.threads.Thread.purge:43 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.purge:45 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:45 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:45 msgid "You do not have proper permissions to do the actions required." msgstr "必要なアクションをするための適切な権限がない場合。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.purge:48 #: ../../../discord/threads.py:docstring of discord.threads.Thread.purge:44 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.purge:46 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:46 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:46 msgid "Purging the messages failed." msgstr "メッセージの一括削除に失敗した場合。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.purge:50 #: ../../../discord/threads.py:docstring of discord.threads.Thread.purge:46 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.purge:48 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:48 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:48 msgid "The list of messages that were deleted." msgstr "削除されたメッセージのlist。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.purge:51 #: ../../../discord/threads.py:docstring of discord.threads.Thread.purge:47 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.purge:49 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:49 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.purge:49 msgid "List[:class:`.Message`]" msgstr "List[:class:`.Message`]" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.webhooks:3 #: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.webhooks:3 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.webhooks:3 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.webhooks:3 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.webhooks:3 msgid "Gets the list of webhooks from this channel." msgstr "チャンネル内のWebhookのリストを取得します。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.webhooks:9 #: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.webhooks:9 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.webhooks:11 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.webhooks:11 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.webhooks:11 msgid "The webhooks for this channel." msgstr "チャンネル内のWebhook。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_webhook:3 #: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_webhook:3 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.create_webhook:3 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.create_webhook:3 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.create_webhook:3 msgid "Creates a webhook for this channel." msgstr "チャンネルに新しいWebhookを作ります。" @@ -15353,38 +15712,44 @@ msgstr "``reason`` キーワード引数が追加されました。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_webhook:10 #: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_webhook:7 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.create_webhook:9 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.create_webhook:9 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.create_webhook:9 msgid "The webhook's name." msgstr "Webhookの名前。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_webhook:12 #: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_webhook:9 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.create_webhook:11 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.create_webhook:11 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.create_webhook:11 msgid "A :term:`py:bytes-like object` representing the webhook's default avatar. This operates similarly to :meth:`~ClientUser.edit`." msgstr "Webhookのデフォルトアバターを表す :term:`py:bytes-like object` 。 :meth:`~ClientUser.edit` と同様に動作します。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_webhook:15 #: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_webhook:12 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.create_webhook:14 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.create_webhook:14 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.create_webhook:14 msgid "The reason for creating this webhook. Shows up in the audit logs." msgstr "Webhookを作成する理由。監査ログに表示されます。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_webhook:18 #: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_webhook:15 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.create_webhook:17 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.create_webhook:17 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.create_webhook:17 msgid "Creating the webhook failed." msgstr "Webhookの作成に失敗した場合。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_webhook:19 #: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_webhook:16 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.create_webhook:18 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.create_webhook:18 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.create_webhook:18 msgid "You do not have permissions to create a webhook." msgstr "Webhookを作成する権限を持っていない場合。" #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_webhook:21 #: ../../../discord/channel.py:docstring of discord.channel.TextChannel.follow:30 #: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_webhook:18 -#: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.create_webhook:20 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.create_webhook:20 +#: ../../../discord/channel.py:docstring of discord.channel.VocalGuildChannel.create_webhook:20 msgid "The created webhook." msgstr "作成されたwebhook。" @@ -15441,24 +15806,24 @@ msgstr "パブリックスレッドを作成するには、 :attr:`~discord.Perm msgid "A snowflake representing the message to create the thread with. If ``None`` is passed then a private thread is created. Defaults to ``None``." msgstr "スレッドを開始するメッセージを表すスノーフレーク。``None`` が渡された場合、プライベートスレッドが作成されます。デフォルトは ``None`` です。" -#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_thread:19 +#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_thread:21 msgid "The type of thread to create. If a ``message`` is passed then this parameter is ignored, as a thread created with a message is always a public thread. By default this creates a private thread if this is ``None``." msgstr "作成するスレッドの種類。 ``message`` が渡された場合、メッセージで作成されたスレッドは常に公開スレッドであるためこのパラメータは無視されます。 デフォルトでは、これが ``None`` の場合、プライベートスレッドが作成されます。" -#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_thread:25 +#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_thread:27 msgid "Whether non-moderators can add users to the thread. Only applicable to private threads. Defaults to ``True``." msgstr "モデレータ以外がスレッドにユーザーを追加できるかどうか。プライベートスレッドにのみ適用されます。デフォルトは ``True`` です。" -#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_thread:34 -#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_thread:53 +#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_thread:36 +#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_thread:55 msgid "Starting the thread failed." msgstr "スレッドの作成に失敗した場合。" -#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_thread:36 +#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_thread:38 msgid "The created thread" msgstr "作成されたスレッド。" -#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_thread:37 +#: ../../../discord/channel.py:docstring of discord.channel.TextChannel.create_thread:39 #: ../../../discord/threads.py:docstring of discord.threads.Thread.edit:40 #: ../../../discord/threads.py:docstring of discord.ThreadMember.thread:3 msgid ":class:`Thread`" @@ -15509,7 +15874,7 @@ msgstr "``joined`` が ``True`` に設定され、``private`` が ``False`` に msgid ":class:`Thread` -- The archived threads." msgstr ":class:`Thread` -- アーカイブされたスレッド。" -#: ../../api.rst:4279 +#: ../../api.rst:4408 msgid "ForumChannel" msgstr "ForumChannel" @@ -15569,10 +15934,6 @@ msgstr "フォーラムに年齢制限がかかっているか。" msgid "The default auto archive duration in minutes for threads created in this forum." msgstr "このフォーラムで作成されたスレッドのデフォルトの分単位の自動アーカイブ期間。" -#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel:100 -msgid "The default reaction emoji for threads created in this forum to show in the add reaction button." -msgstr "このフォーラムで作成されたスレッドで、デフォルトでリアクション追加ボタンに表示するリアクション絵文字。" - #: ../../../discord/channel.py:docstring of discord.channel.ForumChannel:105 #: ../../../discord/activity.py:docstring of discord.activity.Activity:92 #: ../../../discord/activity.py:docstring of discord.activity.CustomActivity:33 @@ -15588,24 +15949,19 @@ msgstr "このフォーラムチャネルの投稿のデフォルトの配列。 msgid ":class:`ForumLayoutType`" msgstr ":class:`ForumLayoutType`" +#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel:122 +msgid "Optional[:class:`ForumOrderType`]" +msgstr "" + #: ../../../discord/channel.py:docstring of discord.ForumChannel.flags:1 #: ../../../discord/threads.py:docstring of discord.Thread.flags:1 msgid "The flags associated with this thread." msgstr "このスレッドに関連付けられたフラグ。" -#: ../../../discord/channel.py:docstring of discord.ForumChannel.flags:5 -#: ../../../discord/threads.py:docstring of discord.Thread.flags:3 -msgid ":class:`ChannelFlags`" -msgstr ":class:`ChannelFlags`" - #: ../../../discord/channel.py:docstring of discord.ForumChannel.available_tags:1 msgid "Returns all the available tags for this forum." msgstr "このフォーラムで利用可能なタグをすべて返します。" -#: ../../../discord/channel.py:docstring of discord.ForumChannel.available_tags:5 -msgid "Sequence[:class:`ForumTag`]" -msgstr "Sequence[:class:`ForumTag`]" - #: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.get_tag:1 msgid "Returns the tag with the given ID." msgstr "与えられたIDのタグを返します。" @@ -15683,26 +16039,30 @@ msgid "The new default layout for posts in this forum." msgstr "このフォーラムの新しい投稿のデフォルトの配列。" #: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.edit:52 +msgid "The new default sort order for posts in this forum." +msgstr "" + +#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.edit:56 msgid "Whether to require a tag for threads in this channel or not." msgstr "チャンネル内のスレッドにタグが必要であるかどうか。" -#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.edit:58 +#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.edit:62 msgid "The permission overwrite information is not in proper form or a type is not the expected type." msgstr "権限上書きが適切でないか、または期待された型でない場合。" -#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.edit:59 +#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.edit:63 msgid "You do not have permissions to edit the forum." msgstr "フォーラムを編集する権限がない場合。" -#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.edit:60 +#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.edit:64 msgid "Editing the forum failed." msgstr "フォーラムの編集に失敗した場合。" -#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.edit:62 +#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.edit:66 msgid "The newly edited forum channel. If the edit was only positional then ``None`` is returned instead." msgstr "新しく編集されたフォーラムチャンネル。編集が位置のみだった場合は代わりに ``None`` が返されます。" -#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.edit:64 +#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.edit:68 msgid "Optional[:class:`.ForumChannel`]" msgstr "Optional[:class:`.ForumChannel`]" @@ -15755,23 +16115,23 @@ msgstr "このスレッドは、最初のメッセージが与えられたパブ msgid "You must send at least one of ``content``, ``embed``, ``embeds``, ``file``, ``files``, or ``view`` to create a thread in a forum, since forum channels must have a starter message." msgstr "フォーラムチャンネルには最初ののメッセージが必要であるため、 ``content`` 、 ``embed`` 、 ``embed`` 、 ``file`` 、 ``files`` 、 ``files`` 、 ``view`` のうち少なくとも1つを送信する必要があります。" -#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_thread:20 +#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_thread:22 msgid "The content of the message to send with the thread." msgstr "スレッドで送信するメッセージの内容。" -#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_thread:41 +#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_thread:43 msgid "A list of tags to apply to the thread." msgstr "スレッドに適用するタグのリスト。" -#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_thread:55 +#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_thread:57 msgid "You specified both ``file`` and ``files``, or you specified both ``embed`` and ``embeds``." msgstr "``file`` と ``files`` の両方が指定された場合、または ``embed`` と ``embeds`` の両方が指定された場合。" -#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_thread:57 +#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_thread:59 msgid "The created thread with the created message. This is also accessible as a namedtuple with ``thread`` and ``message`` fields." msgstr "作成されたスレッドとメッセージ。これは、 ``thread`` と ``message`` フィールドを持つ名前付きタプルとしてもアクセスできます。" -#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_thread:59 +#: ../../../discord/channel.py:docstring of discord.channel.ForumChannel.create_thread:61 msgid "Tuple[:class:`Thread`, :class:`Message`]" msgstr "Tuple[:class:`Thread`, :class:`Message`]" @@ -15783,7 +16143,7 @@ msgstr "このフォーラムののアーカイブされたスレッドを :attr msgid "You must have :attr:`~Permissions.read_message_history` to do this." msgstr "これを行うためには、 :attr:`~Permissions.read_message_history` が必要です。" -#: ../../api.rst:4288 +#: ../../api.rst:4417 msgid "Thread" msgstr "Thread" @@ -15868,8 +16228,8 @@ msgid "The user's ID that archived this thread." msgstr "このスレッドをアーカイブしたユーザーのID。" #: ../../../discord/threads.py:docstring of discord.threads.Thread:115 -msgid "The duration in minutes until the thread is automatically archived due to inactivity. Usually a value of 60, 1440, 4320 and 10080." -msgstr "アクティブでないスレッドが自動的にアーカイブされるまでの分単位の期間です。通常値は60、1440、4320、または10080です。" +msgid "The duration in minutes until the thread is automatically hidden from the channel list. Usually a value of 60, 1440, 4320 and 10080." +msgstr "" #: ../../../discord/threads.py:docstring of discord.threads.Thread:122 msgid "An aware timestamp of when the thread's archived status was last updated in UTC." @@ -16038,8 +16398,8 @@ msgid "Whether non-moderators can add other non-moderators to this thread. Only msgstr "モデレータでないユーザーがこのスレッドに他のモデレータでないユーザーを追加できるかどうか。プライベートスレッドでのみ利用できます。" #: ../../../discord/threads.py:docstring of discord.threads.Thread.edit:23 -msgid "The new duration in minutes before a thread is automatically archived for inactivity. Must be one of ``60``, ``1440``, ``4320``, or ``10080``." -msgstr "スレッドがアクティブでないために自動的にアーカイブされるまでの分単位の新しい期間。``60``、``1440``、``4320``、または ``10080`` のいずれかでなければなりません。" +msgid "The new duration in minutes before a thread is automatically hidden from the channel list. Must be one of ``60``, ``1440``, ``4320``, or ``10080``." +msgstr "" #: ../../../discord/threads.py:docstring of discord.threads.Thread.edit:26 msgid "Specifies the slowmode rate limit for user in this thread, in seconds. A value of ``0`` disables slowmode. The maximum value possible is ``21600``." @@ -16231,7 +16591,7 @@ msgstr "スレッドを削除する権限がない場合。" msgid "Deleting the thread failed." msgstr "スレッドの削除に失敗した場合。" -#: ../../api.rst:4301 +#: ../../api.rst:4430 msgid "ThreadMember" msgstr "ThreadMember" @@ -16271,7 +16631,7 @@ msgstr "メンバーがスレッドに参加したUTC時刻。" msgid "The thread this member belongs to." msgstr "メンバーが属するスレッド。" -#: ../../api.rst:4309 +#: ../../api.rst:4438 msgid "VoiceChannel" msgstr "VoiceChannel" @@ -16298,6 +16658,7 @@ msgid "The new channel's bitrate." msgstr "チャンネルの新しいビットレート。" #: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.edit:26 +#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:26 msgid "The new channel's user limit." msgstr "チャンネルの新しいユーザー人数制限。" @@ -16306,7 +16667,7 @@ msgid "The new region for the voice channel's voice communication. A value of `` msgstr "ボイスチャンネルの新しい音声通信のためのリージョン。値が ``None`` の場合は自動で検出されます。" #: ../../../discord/channel.py:docstring of discord.channel.VoiceChannel.edit:54 -#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:48 +#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:50 msgid "If the permission overwrite information is not in proper form." msgstr "権限の上書きの情報が適切なものでない場合。" @@ -16348,7 +16709,7 @@ msgstr "メンバーIDをキーとしボイス状態を値とするマッピン msgid "Mapping[:class:`int`, :class:`VoiceState`]" msgstr "Mapping[:class:`int`, :class:`VoiceState`]" -#: ../../api.rst:4318 +#: ../../api.rst:4447 msgid "StageChannel" msgstr "StageChannel" @@ -16369,7 +16730,7 @@ msgid "The region for the stage channel's voice communication. A value of ``None msgstr "ステージチャンネルの音声通信のためのリージョン。値が ``None`` の場合は自動で検出されます。" #: ../../../discord/channel.py:docstring of discord.channel.StageChannel:89 -#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:43 +#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:45 msgid "The camera video quality for the stage channel's participants." msgstr "ステージチャンネル参加者のカメラビデオの画質。" @@ -16406,27 +16767,31 @@ msgid "The stage instance's privacy level. Defaults to :attr:`PrivacyLevel.guild msgstr "ステージインスタンスのプライバシーレベル。デフォルトは :attr:`PrivacyLevel.guild_only` です。" #: ../../../discord/channel.py:docstring of discord.channel.StageChannel.create_instance:13 +msgid "Whether to send a start notification. This sends a push notification to @everyone if ``True``. Defaults to ``False``. You must have :attr:`~Permissions.mention_everyone` to do this." +msgstr "" + +#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.create_instance:18 msgid "The reason the stage instance was created. Shows up on the audit log." msgstr "ステージインスタンスを作成する理由。監査ログに表示されます。" -#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.create_instance:16 +#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.create_instance:21 #: ../../../discord/stage_instance.py:docstring of discord.stage_instance.StageInstance.edit:14 msgid "If the ``privacy_level`` parameter is not the proper type." msgstr "引数 ``privacy_level`` が適切な型でない場合。" -#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.create_instance:17 +#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.create_instance:22 msgid "You do not have permissions to create a stage instance." msgstr "ステージインスタンスを作成する権限がない場合。" -#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.create_instance:18 +#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.create_instance:23 msgid "Creating a stage instance failed." msgstr "ステージインスタンスの作成に失敗した場合。" -#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.create_instance:20 +#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.create_instance:25 msgid "The newly created stage instance." msgstr "新しく作成されたステージインスタンス。" -#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.create_instance:21 +#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.create_instance:26 #: ../../../discord/channel.py:docstring of discord.channel.StageChannel.fetch_instance:11 msgid ":class:`StageInstance`" msgstr ":class:`StageInstance`" @@ -16443,19 +16808,19 @@ msgstr "ステージインスタンス。" msgid "The ``topic`` parameter must now be set via :attr:`create_instance`." msgstr "``topic`` パラメーターは :attr:`create_instance` で設定する必要があります。" -#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:40 +#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:42 msgid "The new region for the stage channel's voice communication. A value of ``None`` indicates automatic voice region detection." msgstr "新しいステージチャンネルの音声通信のためのリージョン。値が ``None`` の場合は自動で検出されます。" -#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:52 +#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:54 msgid "The newly edited stage channel. If the edit was only positional then ``None`` is returned instead." msgstr "新しく編集されたステージチャンネル。編集が位置のみだった場合は代わりに ``None`` が返されます。" -#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:54 +#: ../../../discord/channel.py:docstring of discord.channel.StageChannel.edit:56 msgid "Optional[:class:`.StageChannel`]" msgstr "Optional[:class:`.StageChannel`]" -#: ../../api.rst:4328 +#: ../../api.rst:4457 msgid "StageInstance" msgstr "StageInstance" @@ -16555,7 +16920,7 @@ msgstr "ステージインスタンスを削除する権限がない場合。" msgid "Deleting the stage instance failed." msgstr "ステージインスタンスの削除に失敗した場合。" -#: ../../api.rst:4336 +#: ../../api.rst:4465 msgid "CategoryChannel" msgstr "CategoryChannel" @@ -16683,7 +17048,7 @@ msgstr "カテゴリ内に :class:`StageChannel` を作成するための :meth: msgid "A shortcut method to :meth:`Guild.create_forum` to create a :class:`ForumChannel` in the category." msgstr "カテゴリ内に :class:`ForumChannel` を作成するための :meth:`Guild.create_forum` のショートカット。" -#: ../../api.rst:4345 +#: ../../api.rst:4474 msgid "DMChannel" msgstr "DMChannel" @@ -16762,7 +17127,7 @@ msgstr ":attr:`~Permissions.send_messages_in_threads`: DMにはスレッドが msgid "Thread related permissions are now set to ``False``." msgstr "スレッド関連の権限が ``False`` に設定されるようになりました。" -#: ../../api.rst:4358 +#: ../../api.rst:4487 msgid "GroupChannel" msgstr "GroupChannel" @@ -16822,7 +17187,7 @@ msgstr "あなたがグループにいる唯一の者である場合、グルー msgid "Leaving the group failed." msgstr "グループの脱退に失敗した場合。" -#: ../../api.rst:4371 +#: ../../api.rst:4500 msgid "PartialInviteGuild" msgstr "PartialInviteGuild" @@ -16889,7 +17254,7 @@ msgstr "部分的なギルドの現在の「ブースト」数。" msgid "The Discord vanity invite URL for this partial guild, if available." msgstr "存在する場合、部分的なギルドのDiscord バニティURL。" -#: ../../api.rst:4379 +#: ../../api.rst:4508 msgid "PartialInviteChannel" msgstr "PartialInviteChannel" @@ -16931,7 +17296,7 @@ msgstr "部分的なチャンネルのID。" msgid "The partial channel's type." msgstr "部分的なチャンネルの種類。" -#: ../../api.rst:4387 +#: ../../api.rst:4516 msgid "Invite" msgstr "Invite" @@ -17136,7 +17501,7 @@ msgstr "インスタント招待を取り消します。" msgid "The reason for deleting this invite. Shows up on the audit log." msgstr "招待を削除する理由。監査ログに表示されます。" -#: ../../api.rst:4395 +#: ../../api.rst:4524 msgid "Template" msgstr "Template" @@ -17239,7 +17604,7 @@ msgstr "テンプレートを削除します。" msgid "The template url." msgstr "テンプレートのURL。" -#: ../../api.rst:4403 +#: ../../api.rst:4532 msgid "WelcomeScreen" msgstr "WelcomeScreen" @@ -17311,7 +17676,7 @@ msgstr "ようこそ画面を編集するのに必要な権限がない場合。 msgid "This welcome screen does not exist." msgstr "ようこそ画面が存在しない場合。" -#: ../../api.rst:4411 +#: ../../api.rst:4540 msgid "WelcomeChannel" msgstr "WelcomeChannel" @@ -17339,7 +17704,7 @@ msgstr "チャンネルの説明の横に使用される絵文字。" msgid "Optional[:class:`PartialEmoji`, :class:`Emoji`, :class:`str`]" msgstr "Optional[:class:`PartialEmoji`, :class:`Emoji`, :class:`str`]" -#: ../../api.rst:4419 +#: ../../api.rst:4548 msgid "WidgetChannel" msgstr "WidgetChannel" @@ -17355,7 +17720,7 @@ msgstr "チャンネルのID。" msgid "The channel's position" msgstr "チャンネルの位置。" -#: ../../api.rst:4427 +#: ../../api.rst:4556 msgid "WidgetMember" msgstr "WidgetMember" @@ -17376,8 +17741,8 @@ msgid "Return the widget member's hash." msgstr "ウィジェットメンバーのハッシュ値を返します。" #: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:19 -msgid "Returns the widget member's ``name#discriminator``." -msgstr "ウィジェットメンバーの ``name#discriminator`` を返します。" +msgid "Returns the widget member's handle (e.g. ``name`` or ``name#discriminator``)." +msgstr "" #: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:23 msgid "The member's ID." @@ -17388,46 +17753,50 @@ msgid "The member's username." msgstr "メンバーのユーザー名。" #: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:35 -msgid "The member's discriminator." -msgstr "メンバーのタグ。" +msgid "The member's discriminator. This is a legacy concept that is no longer used." +msgstr "" #: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:41 +msgid "The member's global nickname, taking precedence over the username in display." +msgstr "" + +#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:49 msgid "Whether the member is a bot." msgstr "メンバーがボットであるかどうか。" -#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:47 +#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:55 msgid "The member's status." msgstr "メンバーのステータス。" -#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:53 -msgid "The member's nickname." -msgstr "メンバーのニックネーム。" +#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:61 +msgid "The member's guild-specific nickname. Takes precedence over the global name." +msgstr "" -#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:59 +#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:67 msgid "The member's avatar hash." msgstr "メンバーのアバターのハッシュ値。" -#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:65 +#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:73 msgid "The member's activity." msgstr "メンバーのアクティビティ。" -#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:71 +#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:79 msgid "Whether the member is currently deafened." msgstr "メンバーがスピーカーミュートされているかどうか。" -#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:77 +#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:85 msgid "Whether the member is currently muted." msgstr "メンバーがミュートされているかどうか。" -#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:83 +#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:91 msgid "Whether the member is currently being suppressed." msgstr "メンバーが現在抑制されているのかどうか。" -#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:89 +#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:97 msgid "Which channel the member is connected to." msgstr "メンバーが接続しているチャンネル。" -#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:91 +#: ../../../discord/widget.py:docstring of discord.widget.WidgetMember:99 msgid "Optional[:class:`WidgetChannel`]" msgstr "Optional[:class:`WidgetChannel`]" @@ -17435,7 +17804,7 @@ msgstr "Optional[:class:`WidgetChannel`]" msgid "Returns the member's display name." msgstr "メンバーの表示名を返します。" -#: ../../api.rst:4436 +#: ../../api.rst:4565 msgid "Widget" msgstr "Widget" @@ -17475,6 +17844,10 @@ msgstr "ギルド内のオンラインのメンバー。オフラインのメン msgid "Due to a Discord limitation, if this data is available the users will be \"anonymized\" with linear IDs and discriminator information being incorrect. Likewise, the number of members retrieved is capped." msgstr "Discordの制限により、このデータが利用可能な場合、ユーザーのIDとタグは「仮名化」され、誤った情報になります。同様に、取得できるメンバー数にも制限があります。" +#: ../../../discord/widget.py:docstring of discord.widget.Widget:47 +msgid "List[:class:`WidgetMember`]" +msgstr "" + #: ../../../discord/widget.py:docstring of discord.widget.Widget:51 msgid "The approximate number of online members in the guild. Offline members are not included in this count." msgstr "ギルド内のオンラインのメンバーのおおよその数。オフラインのメンバーはこの数には含まれません。" @@ -17503,7 +17876,7 @@ msgstr "招待にカウント情報を含めるかどうか。これにより :a msgid "The invite from the widget's invite URL, if available." msgstr "利用可能な場合は、ウィジェットの招待URLからの招待。" -#: ../../api.rst:4444 +#: ../../api.rst:4573 msgid "StickerPack" msgstr "StickerPack" @@ -17563,7 +17936,7 @@ msgstr "Optional[:class:`StandardSticker`]" msgid "The banner asset of the sticker pack." msgstr "スタンプパックのバナーアセット。" -#: ../../api.rst:4452 +#: ../../api.rst:4581 msgid "StickerItem" msgstr "StickerItem" @@ -17617,7 +17990,7 @@ msgstr "スタンプアイテムの完全なスタンプデータを取得する msgid "Union[:class:`StandardSticker`, :class:`GuildSticker`]" msgstr "Union[:class:`StandardSticker`, :class:`GuildSticker`]" -#: ../../api.rst:4460 +#: ../../api.rst:4589 msgid "Sticker" msgstr "Sticker" @@ -17658,7 +18031,7 @@ msgstr "スタンプパックのID。" msgid "Returns the sticker's creation time in UTC." msgstr "スタンプの作成された時間をUTCで返します。" -#: ../../api.rst:4468 +#: ../../api.rst:4597 msgid "StandardSticker" msgstr "StandardSticker" @@ -17694,7 +18067,7 @@ msgstr "取得したスタンプパック。" msgid ":class:`StickerPack`" msgstr ":class:`StickerPack`" -#: ../../api.rst:4476 +#: ../../api.rst:4605 msgid "GuildSticker" msgstr "GuildSticker" @@ -17750,7 +18123,7 @@ msgstr "スタンプの編集中にエラーが発生した場合。" msgid "The newly modified sticker." msgstr "新しく変更されたスタンプ。" -#: ../../api.rst:4484 +#: ../../api.rst:4613 msgid "ShardInfo" msgstr "ShardInfo" @@ -17794,7 +18167,7 @@ msgstr "シャードを接続します。もしすでに接続されている場 msgid "Measures latency between a HEARTBEAT and a HEARTBEAT_ACK in seconds for this shard." msgstr "このシャードのHEARTBEATとHEARTBEAT_ACK間の待ち時間を秒単位で測定します。" -#: ../../api.rst:4492 +#: ../../api.rst:4621 msgid "RawMessageDeleteEvent" msgstr "RawMessageDeleteEvent" @@ -17819,7 +18192,7 @@ msgstr "削除されたメッセージ ID。" msgid "The cached message, if found in the internal message cache." msgstr "内部のメッセージキャッシュに見つかった場合、そのキャッシュされたメッセージ。" -#: ../../api.rst:4500 +#: ../../api.rst:4629 msgid "RawBulkMessageDeleteEvent" msgstr "RawBulkMessageDeleteEvent" @@ -17847,7 +18220,7 @@ msgstr "内部のメッセージキャッシュに見つかった場合、その msgid "List[:class:`Message`]" msgstr "List[:class:`Message`]" -#: ../../api.rst:4508 +#: ../../api.rst:4637 msgid "RawMessageUpdateEvent" msgstr "RawMessageUpdateEvent" @@ -17883,7 +18256,7 @@ msgstr ":class:`dict`" msgid "The cached message, if found in the internal message cache. Represents the message before it is modified by the data in :attr:`RawMessageUpdateEvent.data`." msgstr "内部メッセージキャッシュで見つかった場合、そのキャッシュされたメッセージ。 :attr:`RawMessageUpdateEvent.data` のデータによって変更される前のメッセージを表します。" -#: ../../api.rst:4516 +#: ../../api.rst:4645 msgid "RawReactionActionEvent" msgstr "RawReactionActionEvent" @@ -17919,7 +18292,7 @@ msgstr "リアクションを追加したメンバー。 ``event_type`` が ``RE msgid "The event type that triggered this action. Can be ``REACTION_ADD`` for reaction addition or ``REACTION_REMOVE`` for reaction removal." msgstr "このアクションの原因であるイベントタイプ。リアクションの追加は ``REACTION_ADD`` 、リアクションの除去は ``REACTION_REMOVE`` です。" -#: ../../api.rst:4524 +#: ../../api.rst:4653 msgid "RawReactionClearEvent" msgstr "RawReactionClearEvent" @@ -17942,7 +18315,7 @@ msgstr "リアクションの一括除去が行われたチャンネルのID。" msgid "The guild ID where the reactions got cleared." msgstr "リアクションの一括除去が行われたギルドのID。" -#: ../../api.rst:4532 +#: ../../api.rst:4661 msgid "RawReactionClearEmojiEvent" msgstr "RawReactionClearEmojiEvent" @@ -17954,7 +18327,7 @@ msgstr ":func:`on_raw_reaction_clear_emoji` イベントのペイロードを表 msgid "The custom or unicode emoji being removed." msgstr "除去されたカスタムまたはユニコード絵文字。" -#: ../../api.rst:4540 +#: ../../api.rst:4669 msgid "RawIntegrationDeleteEvent" msgstr "RawIntegrationDeleteEvent" @@ -17974,7 +18347,7 @@ msgstr "削除された連携サービスのボットやOAuth2 アプリケー msgid "The guild ID where the integration got deleted." msgstr "連携サービスが削除されたギルドのID。" -#: ../../api.rst:4548 +#: ../../api.rst:4677 msgid "RawThreadUpdateEvent" msgstr "RawThreadUpdateEvent" @@ -18019,7 +18392,7 @@ msgstr "スレッドが内部キャッシュで見つかった場合、そのス msgid "Optional[:class:`discord.Thread`]" msgstr "Optional[:class:`discord.Thread`]" -#: ../../api.rst:4556 +#: ../../api.rst:4685 msgid "RawThreadMembersUpdate" msgstr "RawThreadMembersUpdate" @@ -18035,7 +18408,7 @@ msgstr "スレッドのおおよそのメンバー数。この値は50の上限 msgid "The raw data given by the :ddocs:`gateway `." msgstr ":ddocs:`ゲートウェイ ` によって与えられた生のデータ。" -#: ../../api.rst:4564 +#: ../../api.rst:4693 msgid "RawThreadDeleteEvent" msgstr "RawThreadDeleteEvent" @@ -18059,7 +18432,7 @@ msgstr "スレッドが削除されたギルドのID。" msgid "The ID of the channel the thread belonged to." msgstr "スレッドが属したチャンネルの ID。" -#: ../../api.rst:4572 +#: ../../api.rst:4701 msgid "RawTypingEvent" msgstr "RawTypingEvent" @@ -18087,7 +18460,7 @@ msgstr "Optional[Union[:class:`discord.User`, :class:`discord.Member`]]" msgid "The ID of the guild the user started typing in, if applicable." msgstr "該当する場合、ユーザーが入力し始めたギルドのID。" -#: ../../api.rst:4580 +#: ../../api.rst:4709 msgid "RawMemberRemoveEvent" msgstr "RawMemberRemoveEvent" @@ -18107,7 +18480,7 @@ msgstr "Union[:class:`discord.User`, :class:`discord.Member`]" msgid "The ID of the guild the user left." msgstr "ユーザーが脱退したギルドのID。" -#: ../../api.rst:4588 +#: ../../api.rst:4717 msgid "RawAppCommandPermissionsUpdateEvent" msgstr "RawAppCommandPermissionsUpdateEvent" @@ -18131,7 +18504,7 @@ msgstr "権限が更新されたギルド。" msgid "List of new permissions for the app command." msgstr "アプリケーションコマンドの新しい権限のリスト。" -#: ../../api.rst:4596 +#: ../../api.rst:4725 msgid "PartialWebhookGuild" msgstr "PartialWebhookGuild" @@ -18144,7 +18517,7 @@ msgstr "Webhook用の部分的なギルドを表します。" msgid "These are typically given for channel follower webhooks." msgstr "これは通常、チャンネルをフォローするWebhookから与えられます。" -#: ../../api.rst:4604 +#: ../../api.rst:4733 msgid "PartialWebhookChannel" msgstr "PartialWebhookChannel" @@ -18152,23 +18525,23 @@ msgstr "PartialWebhookChannel" msgid "Represents a partial channel for webhooks." msgstr "Webhook用の部分的なチャンネルを表します。" -#: ../../api.rst:4614 +#: ../../api.rst:4743 msgid "Data Classes" msgstr "データクラス" -#: ../../api.rst:4616 +#: ../../api.rst:4745 msgid "Some classes are just there to be data containers, this lists them." msgstr "一部のクラスはデータコンテナとして用いられます。ここではそのクラスを一覧表にしています。" -#: ../../api.rst:4618 +#: ../../api.rst:4747 msgid "Unlike :ref:`models ` you are allowed to create most of these yourself, even if they can also be used to hold attributes." msgstr ":ref:`models ` とは異なり、属性を持つものであっても、自分で作成することが許されています。" -#: ../../api.rst:4624 +#: ../../api.rst:4753 msgid "The only exception to this rule is :class:`Object`, which is made with dynamic attributes in mind." msgstr "このルールの唯一の例外は :class:`Object` で、動的な属性を念頭に置いて作成されます。" -#: ../../api.rst:4629 +#: ../../api.rst:4758 msgid "Object" msgstr "Object" @@ -18216,7 +18589,7 @@ msgstr "Type[:class:`abc.Snowflake`]" msgid "Returns the snowflake's creation time in UTC." msgstr "スノーフレークの作成時刻をUTCで返します。" -#: ../../api.rst:4637 +#: ../../api.rst:4766 msgid "Embed" msgstr "Embed" @@ -18529,7 +18902,7 @@ msgstr "無効なインデックスが指定された場合。" msgid "Converts this embed object into a dict." msgstr "埋め込みオブジェクトを辞書型に変換します。" -#: ../../api.rst:4645 +#: ../../api.rst:4774 msgid "AllowedMentions" msgstr "AllowedMentions" @@ -18570,7 +18943,7 @@ msgstr "すべてのフィールドが ``True`` に明示的に設定された : msgid "A factory method that returns a :class:`AllowedMentions` with all fields set to ``False``" msgstr "すべてのフィールドが ``False`` に設定された :class:`AllowedMentions` を返すファクトリメソッド。" -#: ../../api.rst:4653 +#: ../../api.rst:4782 msgid "MessageReference" msgstr "MessageReference" @@ -18635,7 +19008,7 @@ msgstr "Optional[:class:`~discord.Message`]" msgid "Returns a URL that allows the client to jump to the referenced message." msgstr "クライアントが参照されたメッセージにジャンプすることのできるURLを返します。" -#: ../../api.rst:4661 +#: ../../api.rst:4790 msgid "PartialMessage" msgstr "PartialMessage" @@ -18656,34 +19029,38 @@ msgid ":meth:`VoiceChannel.get_partial_message`" msgstr ":meth:`VoiceChannel.get_partial_message`" #: ../../../discord/message.py:docstring of discord.message.PartialMessage:9 +msgid ":meth:`StageChannel.get_partial_message`" +msgstr "" + +#: ../../../discord/message.py:docstring of discord.message.PartialMessage:10 msgid ":meth:`Thread.get_partial_message`" msgstr ":meth:`Thread.get_partial_message`" -#: ../../../discord/message.py:docstring of discord.message.PartialMessage:10 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage:11 msgid ":meth:`DMChannel.get_partial_message`" msgstr ":meth:`DMChannel.get_partial_message`" -#: ../../../discord/message.py:docstring of discord.message.PartialMessage:20 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage:21 msgid "Checks if two partial messages are equal." msgstr "二つの部分的なメッセージが等しいかを比較します。" -#: ../../../discord/message.py:docstring of discord.message.PartialMessage:24 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage:25 msgid "Checks if two partial messages are not equal." msgstr "二つの部分的なメッセージが等しくないかを比較します。" -#: ../../../discord/message.py:docstring of discord.message.PartialMessage:28 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage:29 msgid "Returns the partial message's hash." msgstr "部分的なメッセージのハッシュ値を返します。" -#: ../../../discord/message.py:docstring of discord.message.PartialMessage:32 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage:33 msgid "The channel associated with this partial message." msgstr "この部分的なメッセージに関連付けられたチャンネル。" -#: ../../../discord/message.py:docstring of discord.message.PartialMessage:34 -msgid "Union[:class:`PartialMessageable`, :class:`TextChannel`, :class:`VoiceChannel`, :class:`Thread`, :class:`DMChannel`]" -msgstr "Union[:class:`PartialMessageable`, :class:`TextChannel`, :class:`VoiceChannel`, :class:`Thread`, :class:`DMChannel`]" +#: ../../../discord/message.py:docstring of discord.message.PartialMessage:35 +msgid "Union[:class:`PartialMessageable`, :class:`TextChannel`, :class:`StageChannel`, :class:`VoiceChannel`, :class:`Thread`, :class:`DMChannel`]" +msgstr "" -#: ../../../discord/message.py:docstring of discord.message.PartialMessage:44 +#: ../../../discord/message.py:docstring of discord.message.PartialMessage:45 msgid "The guild that the partial message belongs to, if applicable." msgstr "該当する場合、この部分的なメッセージが属するギルド。" @@ -18691,7 +19068,7 @@ msgstr "該当する場合、この部分的なメッセージが属するギル msgid "The partial message's creation time in UTC." msgstr "UTCの、部分的なメッセージが作成された時刻。" -#: ../../api.rst:4669 +#: ../../api.rst:4798 msgid "MessageApplication" msgstr "MessageApplication" @@ -18707,7 +19084,7 @@ msgstr "存在する場合、アプリケーションのアイコン。" msgid "The application's cover image, if any." msgstr "存在する場合、アプリケーションのカバー画像。" -#: ../../api.rst:4677 +#: ../../api.rst:4806 msgid "RoleSubscriptionInfo" msgstr "RoleSubscriptionInfo" @@ -18735,7 +19112,7 @@ msgstr "ユーザーが購読している月数の合計。" msgid "Whether this notification is for a renewal rather than a new purchase." msgstr "この通知が新しい購入ではなく、更新のためであるかどうか。" -#: ../../api.rst:4685 +#: ../../api.rst:4814 msgid "Intents" msgstr "Intents" @@ -18803,10 +19180,14 @@ msgid "Returns an iterator of ``(name, value)`` pairs. This allows it to be, for msgstr "``(name, value)`` ペアのイテレータを返します。これにより、例えば、辞書型やペアのリストに変換できます。" #: ../../../discord/flags.py:docstring of discord.flags.Intents:62 -#: ../../../discord/flags.py:docstring of discord.flags.MemberCacheFlags:65 -#: ../../../discord/flags.py:docstring of discord.flags.ApplicationFlags:52 -#: ../../../discord/flags.py:docstring of discord.flags.ChannelFlags:52 -#: ../../../discord/flags.py:docstring of discord.flags.AutoModPresets:54 +msgid "Returns whether any intent is enabled." +msgstr "" + +#: ../../../discord/flags.py:docstring of discord.flags.Intents:68 +#: ../../../discord/flags.py:docstring of discord.flags.MemberCacheFlags:71 +#: ../../../discord/flags.py:docstring of discord.flags.ApplicationFlags:56 +#: ../../../discord/flags.py:docstring of discord.flags.ChannelFlags:56 +#: ../../../discord/flags.py:docstring of discord.flags.AutoModPresets:58 msgid "The raw value. You should query flags via the properties rather than using this raw value." msgstr "生の値。この値を使用するのではなく、プロパティ経由でフラグを取得すべきです。" @@ -18986,11 +19367,15 @@ msgstr ":attr:`User.avatar`" msgid ":attr:`User.discriminator`" msgstr ":attr:`User.discriminator`" -#: ../../docstring of discord.Intents.members:27 +#: ../../docstring of discord.Intents.members:26 +msgid ":attr:`User.global_name`" +msgstr "" + +#: ../../docstring of discord.Intents.members:28 msgid "For more information go to the :ref:`member intent documentation `." msgstr "詳細については、 :ref:`メンバーインテントの説明 ` を参照してください。" -#: ../../docstring of discord.Intents.members:31 +#: ../../docstring of discord.Intents.members:32 #: ../../docstring of discord.Intents.presences:17 #: ../../docstring of discord.Intents.message_content:19 msgid "Currently, this requires opting in explicitly via the developer portal as well. Bots in over 100 guilds will need to apply to Discord for verification." @@ -19509,7 +19894,7 @@ msgstr "自動管理ルール対応関係のイベントが有効になってい msgid "This corresponds to the following events: - :func:`on_automod_action`" msgstr "これは以下のイベントに対応します: - :func:`on_automod_action`" -#: ../../api.rst:4693 +#: ../../api.rst:4822 msgid "MemberCacheFlags" msgstr "MemberCacheFlags" @@ -19545,6 +19930,14 @@ msgstr "x と y のいずれか一方のみにて有効化されたフラグの msgid "Returns a MemberCacheFlags instance with all flags inverted from x." msgstr "x のすべてのフラグが反転したMemberCacheFlagsインスタンスを返します。" +#: ../../../discord/flags.py:docstring of discord.flags.MemberCacheFlags:65 +#: ../../../discord/flags.py:docstring of discord.flags.ApplicationFlags:50 +#: ../../../discord/flags.py:docstring of discord.flags.ChannelFlags:50 +#: ../../../discord/flags.py:docstring of discord.flags.AutoModPresets:54 +#: ../../../discord/flags.py:docstring of discord.flags.SystemChannelFlags:58 +msgid "Returns whether any flag is set to ``True``." +msgstr "" + #: ../../../discord/flags.py:docstring of discord.flags.MemberCacheFlags.all:1 msgid "A factory method that creates a :class:`MemberCacheFlags` with everything enabled." msgstr "すべて有効化された :class:`MemberCacheFlags` を作成するファクトリメソッド。" @@ -19593,7 +19986,7 @@ msgstr "結果として生成されるメンバーキャッシュフラグ。" msgid ":class:`MemberCacheFlags`" msgstr ":class:`MemberCacheFlags`" -#: ../../api.rst:4701 +#: ../../api.rst:4830 msgid "ApplicationFlags" msgstr "ApplicationFlags" @@ -19633,6 +20026,10 @@ msgstr "x のすべてのフラグが反転したApplicationFlagsインスタン msgid "Returns an iterator of ``(name, value)`` pairs. This allows it to be, for example, constructed as a dict or a list of pairs. Note that aliases are not shown." msgstr "``(name, value)`` ペアのイテレータを返します。これにより、例えば、辞書型やペアのリストに変換できます。エイリアスは含まれません。" +#: ../../docstring of discord.ApplicationFlags.auto_mod_badge:1 +msgid "Returns ``True`` if the application uses at least 100 automod rules across all guilds. This shows up as a badge in the official client." +msgstr "" + #: ../../docstring of discord.ApplicationFlags.gateway_presence:1 msgid "Returns ``True`` if the application is verified and is allowed to receive presence information over the gateway." msgstr "アプリケーションが認証済みでプレゼンス情報をゲートウェイ経由で受け取ることができる場合に ``True`` を返します。" @@ -19673,7 +20070,7 @@ msgstr "アプリケーションがグローバルアプリケーションコマ msgid "Returns ``True`` if the application has had at least one global application command used in the last 30 days." msgstr "過去30日間で少なくとも1つのグローバルアプリケーションコマンドが使用されている場合に ``True`` を返します。" -#: ../../api.rst:4709 +#: ../../api.rst:4838 msgid "ChannelFlags" msgstr "ChannelFlags" @@ -19713,7 +20110,7 @@ msgstr "スレッドがフォーラムチャンネルにピン留めされてい msgid "Returns ``True`` if a tag is required to be specified when creating a thread in a :class:`ForumChannel`." msgstr ":class:`ForumChannel` でスレッドを作成する際にタグを指定する必要がある場合に ``True`` を返します。" -#: ../../api.rst:4717 +#: ../../api.rst:4846 msgid "AutoModPresets" msgstr "AutoModPresets" @@ -19765,7 +20162,7 @@ msgstr "すべて有効化された :class:`AutoModPresets` を作成するフ msgid "A factory method that creates a :class:`AutoModPresets` with everything disabled." msgstr "すべて無効化された :class:`AutoModPresets` を作成するファクトリメソッド。" -#: ../../api.rst:4725 +#: ../../api.rst:4854 msgid "AutoModRuleAction" msgstr "AutoModRuleAction" @@ -19773,27 +20170,35 @@ msgstr "AutoModRuleAction" msgid "Represents an auto moderation's rule action." msgstr "自動管理ルールの対応を表します。" -#: ../../../discord/automod.py:docstring of discord.automod.AutoModRuleAction:7 +#: ../../../discord/automod.py:docstring of discord.automod.AutoModRuleAction:4 +msgid "Only one of ``channel_id``, ``duration``, or ``custom_message`` can be used." +msgstr "" + +#: ../../../discord/automod.py:docstring of discord.automod.AutoModRuleAction:10 msgid "The type of action to take. Defaults to :attr:`~AutoModRuleActionType.block_message`." msgstr "行う対応の種類。デフォルトは :attr:`~AutoModRuleActionType.block_message` です。" -#: ../../../discord/automod.py:docstring of discord.automod.AutoModRuleAction:10 +#: ../../../discord/automod.py:docstring of discord.automod.AutoModRuleAction:13 msgid ":class:`AutoModRuleActionType`" msgstr ":class:`AutoModRuleActionType`" -#: ../../../discord/automod.py:docstring of discord.automod.AutoModRuleAction:14 +#: ../../../discord/automod.py:docstring of discord.automod.AutoModRuleAction:17 msgid "The ID of the channel or thread to send the alert message to, if any. Passing this sets :attr:`type` to :attr:`~AutoModRuleActionType.send_alert_message`." msgstr "該当する場合、アラートメッセージを送信するチャンネルまたはスレッドのID。これを渡すと、 :attr:`type` が :attr:`~AutoModRuleActionType.send_alert_message` に設定されます。" -#: ../../../discord/automod.py:docstring of discord.automod.AutoModRuleAction:21 +#: ../../../discord/automod.py:docstring of discord.automod.AutoModRuleAction:24 msgid "The duration of the timeout to apply, if any. Has a maximum of 28 days. Passing this sets :attr:`type` to :attr:`~AutoModRuleActionType.timeout`." msgstr "該当する場合、適用するタイムアウトの長さ。最大28日間です。これを渡すと、 :attr:`type` が :attr:`~AutoModRuleActionType.timeout` に設定されます。" -#: ../../../discord/automod.py:docstring of discord.automod.AutoModRuleAction:25 +#: ../../../discord/automod.py:docstring of discord.automod.AutoModRuleAction:28 msgid "Optional[:class:`datetime.timedelta`]" msgstr "Optional[:class:`datetime.timedelta`]" -#: ../../api.rst:4733 +#: ../../../discord/automod.py:docstring of discord.automod.AutoModRuleAction:32 +msgid "A custom message which will be shown to a user when their message is blocked. Passing this sets :attr:`type` to :attr:`~AutoModRuleActionType.block_message`." +msgstr "" + +#: ../../api.rst:4862 msgid "AutoModTrigger" msgstr "AutoModTrigger" @@ -19846,16 +20251,16 @@ msgid "The type of trigger." msgstr "発動条件の種類。" #: ../../../discord/automod.py:docstring of discord.automod.AutoModTrigger:28 -msgid "The list of strings that will trigger the keyword filter. Maximum of 1000. Keywords can only be up to 30 characters in length." -msgstr "キーワードフィルタを発動させる文字列の一覧。最大1000個まで。キーワードは各30文字以内です。" +msgid "The list of strings that will trigger the keyword filter. Maximum of 1000. Keywords can only be up to 60 characters in length." +msgstr "" #: ../../../discord/automod.py:docstring of discord.automod.AutoModTrigger:31 msgid "This could be combined with :attr:`regex_patterns`." msgstr ":attr:`regex_patterns` と組み合わせることができます。" #: ../../../discord/automod.py:docstring of discord.automod.AutoModTrigger:37 -msgid "The regex pattern that will trigger the filter. The syntax is based off of `Rust's regex syntax `_. Maximum of 10. Regex strings can only be up to 250 characters in length." -msgstr "フィルタを発動させる正規表現パターン。構文は `Rust の正規表現構文 `_ に基づいています。 最大 10 個まで。正規表現文字列は 250 文字までしか使用できません。" +msgid "The regex pattern that will trigger the filter. The syntax is based off of `Rust's regex syntax `_. Maximum of 10. Regex strings can only be up to 260 characters in length." +msgstr "" #: ../../../discord/automod.py:docstring of discord.automod.AutoModTrigger:41 msgid "This could be combined with :attr:`keyword_filter` and/or :attr:`allow_list`" @@ -19870,14 +20275,14 @@ msgid ":class:`AutoModPresets`" msgstr ":class:`AutoModPresets`" #: ../../../discord/automod.py:docstring of discord.automod.AutoModTrigger:55 -msgid "The list of words that are exempt from the commonly flagged words." -msgstr "通常ならフィルタが発動される単語のうち、除外されるもののリスト。" +msgid "The list of words that are exempt from the commonly flagged words. Maximum of 100. Keywords can only be up to 60 characters in length." +msgstr "" -#: ../../../discord/automod.py:docstring of discord.automod.AutoModTrigger:61 +#: ../../../discord/automod.py:docstring of discord.automod.AutoModTrigger:62 msgid "The total number of user and role mentions a message can contain. Has a maximum of 50." msgstr "メッセージに含めることのできるユーザーとロールのメンションの合計数。最大で50個です。" -#: ../../api.rst:4741 +#: ../../api.rst:4870 msgid "File" msgstr "File" @@ -19917,7 +20322,7 @@ msgstr "表示するファイルの説明。現在画像でのみサポートさ msgid "The filename to display when uploading to Discord. If this is not given then it defaults to ``fp.name`` or if ``fp`` is a string then the ``filename`` will default to the string given." msgstr "Discordにアップロードするときに表示されるファイル名。指定されていない場合はデフォルトでは ``fp.name`` 、または ``fp`` が文字列の場合、 ``filename`` は与えられた文字列をデフォルトにします。" -#: ../../api.rst:4749 +#: ../../api.rst:4878 msgid "Colour" msgstr "Colour" @@ -19950,6 +20355,10 @@ msgid "Returns the raw colour value." msgstr "生の色の値を返します。" #: ../../../discord/colour.py:docstring of discord.colour.Colour:30 +msgid "The colour values in the classmethods are mostly provided as-is and can change between versions should the Discord client's representation of that colour also change." +msgstr "" + +#: ../../../discord/colour.py:docstring of discord.colour.Colour:35 msgid "The raw integer colour value." msgstr "生の色の整数値。" @@ -20130,8 +20539,16 @@ msgid "A factory method that returns a :class:`Colour` with a value of ``0x99AAB msgstr "``0x99AAB5`` の値を持つ :class:`Colour` を返すクラスメソッドです。" #: ../../../discord/colour.py:docstring of discord.colour.Colour.dark_theme:1 -msgid "A factory method that returns a :class:`Colour` with a value of ``0x36393F``. This will appear transparent on Discord's dark theme." -msgstr "``0x36393F`` の値を持つ :class:`Colour` を返すクラスメソッドです。Discordのダークテーマでは透明に見えます。" +msgid "A factory method that returns a :class:`Colour` with a value of ``0x313338``." +msgstr "" + +#: ../../../discord/colour.py:docstring of discord.colour.Colour.dark_theme:3 +msgid "This will appear transparent on Discord's dark theme." +msgstr "" + +#: ../../../discord/colour.py:docstring of discord.colour.Colour.dark_theme:9 +msgid "Updated colour from previous ``0x36393F`` to reflect discord theme changes." +msgstr "" #: ../../../discord/colour.py:docstring of discord.colour.Colour.fuchsia:1 msgid "A factory method that returns a :class:`Colour` with a value of ``0xEB459E``." @@ -20141,7 +20558,19 @@ msgstr "``0xEB459E`` の値を持つ :class:`Colour` を返すクラスメソッ msgid "A factory method that returns a :class:`Colour` with a value of ``0xFEE75C``." msgstr "``0xFEE75C`` の値を持つ :class:`Colour` を返すクラスメソッドです。" -#: ../../api.rst:4757 +#: ../../../discord/colour.py:docstring of discord.colour.Colour.dark_embed:1 +msgid "A factory method that returns a :class:`Colour` with a value of ``0x2B2D31``." +msgstr "" + +#: ../../../discord/colour.py:docstring of discord.colour.Colour.light_embed:1 +msgid "A factory method that returns a :class:`Colour` with a value of ``0xEEEFF1``." +msgstr "" + +#: ../../../discord/colour.py:docstring of discord.colour.Colour.pink:1 +msgid "A factory method that returns a :class:`Colour` with a value of ``0xEB459F``." +msgstr "" + +#: ../../api.rst:4886 msgid "BaseActivity" msgstr "BaseActivity" @@ -20179,7 +20608,7 @@ msgstr "なお、ライブラリはこれらをユーザー設定可能としま msgid "When the user started doing this activity in UTC." msgstr "ユーザーがアクティビティを開始したときのUTC時刻。" -#: ../../api.rst:4765 +#: ../../api.rst:4894 msgid "Activity" msgstr "Activity" @@ -20295,7 +20724,7 @@ msgstr "該当する場合、このアクティビティの大きな画像アセ msgid "Returns the small image asset hover text of this activity, if applicable." msgstr "該当する場合、このアクティビティの小さな画像アセットのホバーテキストを返します。" -#: ../../api.rst:4773 +#: ../../api.rst:4902 msgid "Game" msgstr "Game" @@ -20345,7 +20774,7 @@ msgstr "該当する場合、ユーザーがゲームを開始したときのUTC msgid "When the user will stop playing this game in UTC, if applicable." msgstr "該当する場合、ユーザーがゲームを終了する予定のUTC時刻。" -#: ../../api.rst:4781 +#: ../../api.rst:4910 msgid "Streaming" msgstr "Streaming" @@ -20409,7 +20838,7 @@ msgstr "提供された場合、ストリーム中のユーザーのTwitchの名 msgid "This corresponds to the ``large_image`` key of the :attr:`Streaming.assets` dictionary if it starts with ``twitch:``. Typically set by the Discord client." msgstr "これが ``twitch:`` で始まる場合、 :attr:`Streaming.assets` 辞書の ``large_image`` キーに対応します。典型的にはDiscordクライアントによって設定されます。" -#: ../../api.rst:4789 +#: ../../api.rst:4918 msgid "CustomActivity" msgstr "CustomActivity" @@ -20433,7 +20862,7 @@ msgstr "存在する場合、アクティビティに渡す絵文字。" msgid "It always returns :attr:`ActivityType.custom`." msgstr "これは常に :attr:`ActivityType.custom` を返します。" -#: ../../api.rst:4797 +#: ../../api.rst:4926 msgid "Permissions" msgstr "Permissions" @@ -20499,6 +20928,10 @@ msgid "Returns an iterator of ``(perm, value)`` pairs. This allows it to be, for msgstr "``(perm, value)`` ペアのイテレータを返します。これにより、例えば、辞書型やペアのリストに変換できます。エイリアスは含まれません。" #: ../../../discord/permissions.py:docstring of discord.permissions.Permissions:70 +msgid "Returns whether the permissions object has any permissions set to ``True``." +msgstr "" + +#: ../../../discord/permissions.py:docstring of discord.permissions.Permissions:76 msgid "The raw value. This value is a bit array field of a 53-bit integer representing the currently available permissions. You should query permissions via the properties rather than using this raw value." msgstr "生の値。この値は、現在使用可能な権限を表す 53 ビット整数のビット配列フィールドです。権限の取得には、この生の値ではなくプロパティを使用すべきです。" @@ -20531,8 +20964,9 @@ msgid "A :class:`Permissions` with all channel-specific permissions set to ``Tru msgstr "チャンネル特有の権限が ``True`` に、ギルド特有の権限が ``False`` に設定された :class:`Permissions` 。ギルド特有の権限は現在以下の通りです:" #: ../../../discord/permissions.py:docstring of discord.permissions.Permissions.all_channel:5 -msgid ":attr:`manage_emojis`" -msgstr ":attr:`manage_emojis`" +#: ../../../discord/permissions.py:docstring of discord.permissions.Permissions.elevated:12 +msgid ":attr:`manage_expressions`" +msgstr "" #: ../../../discord/permissions.py:docstring of discord.permissions.Permissions.all_channel:6 msgid ":attr:`view_audit_log`" @@ -20570,14 +21004,22 @@ msgstr ":attr:`ban_members`" msgid ":attr:`administrator`" msgstr ":attr:`administrator`" -#: ../../../discord/permissions.py:docstring of discord.permissions.Permissions.all_channel:15 +#: ../../../discord/permissions.py:docstring of discord.permissions.Permissions.all_channel:14 +msgid ":attr:`create_expressions`" +msgstr "" + +#: ../../../discord/permissions.py:docstring of discord.permissions.Permissions.all_channel:16 msgid "Added :attr:`stream`, :attr:`priority_speaker` and :attr:`use_application_commands` permissions." msgstr ":attr:`stream` 、 :attr:`priority_speaker` 、 :attr:`use_application_commands` 権限を追加しました。" -#: ../../../discord/permissions.py:docstring of discord.permissions.Permissions.all_channel:18 +#: ../../../discord/permissions.py:docstring of discord.permissions.Permissions.all_channel:19 msgid "Added :attr:`create_public_threads`, :attr:`create_private_threads`, :attr:`manage_threads`, :attr:`use_external_stickers`, :attr:`send_messages_in_threads` and :attr:`request_to_speak` permissions." msgstr ":attr:`create_public_threads` 、 :attr:`create_private_threads` 、 :attr:`manage_threads` 、 :attr:`use_external_stickers` 、 :attr:`send_messages_in_threads` 、 :attr:`request_to_speak` 権限を追加しました。" +#: ../../../discord/permissions.py:docstring of discord.permissions.Permissions.all_channel:24 +msgid "Added :attr:`use_soundboard`, :attr:`create_expressions` permissions." +msgstr "" + #: ../../../discord/permissions.py:docstring of discord.permissions.Permissions.general:1 msgid "A factory method that creates a :class:`Permissions` with all \"General\" permissions from the official Discord UI set to ``True``." msgstr "Discord公式UIの「サーバー全般の権限」をすべて ``True`` に設定した :class:`Permissions` を作成するファクトリメソッド。" @@ -20586,6 +21028,10 @@ msgstr "Discord公式UIの「サーバー全般の権限」をすべて ``True`` msgid "Permission :attr:`read_messages` is now included in the general permissions, but permissions :attr:`administrator`, :attr:`create_instant_invite`, :attr:`kick_members`, :attr:`ban_members`, :attr:`change_nickname` and :attr:`manage_nicknames` are no longer part of the general permissions." msgstr ":attr:`read_messages` が全般の権限に含まれるようになり、 :attr:`administrator` 、 :attr:`create_instant_invite` 、 :attr:`kick_members` 、 :attr:`ban_members` 、 :attr:`change_nickname` 、 :attr:`manage_nicknames` は全般の権限に含まれなくなりました。" +#: ../../../discord/permissions.py:docstring of discord.permissions.Permissions.general:10 +msgid "Added :attr:`create_expressions` permission." +msgstr "" + #: ../../../discord/permissions.py:docstring of discord.permissions.Permissions.membership:1 msgid "A factory method that creates a :class:`Permissions` with all \"Membership\" permissions from the official Discord UI set to ``True``." msgstr "Discord公式UIの「メンバーシップ権限」をすべて ``True`` に設定した :class:`Permissions` を作成するファクトリメソッド。" @@ -20602,6 +21048,10 @@ msgstr ":attr:`read_messages` がテキストチャンネル権限に含まれ msgid "Added :attr:`create_public_threads`, :attr:`create_private_threads`, :attr:`manage_threads`, :attr:`send_messages_in_threads` and :attr:`use_external_stickers` permissions." msgstr ":attr:`create_public_threads` 、 :attr:`create_private_threads` 、 :attr:`manage_threads` 、 :attr:`send_messages_in_threads` 、 :attr:`use_external_stickers` 権限が追加されました。" +#: ../../../discord/permissions.py:docstring of discord.permissions.Permissions.text:12 +msgid "Added :attr:`send_voice_messages` permission." +msgstr "" + #: ../../../discord/permissions.py:docstring of discord.permissions.Permissions.voice:1 msgid "A factory method that creates a :class:`Permissions` with all \"Voice\" permissions from the official Discord UI set to ``True``." msgstr "Discord公式UIの「ボイスチャンネル権限」をすべて ``True`` に設定した :class:`Permissions` を作成するファクトリメソッド。" @@ -20647,10 +21097,6 @@ msgstr ":attr:`manage_roles`" msgid ":attr:`manage_webhooks`" msgstr ":attr:`manage_webhooks`" -#: ../../../discord/permissions.py:docstring of discord.permissions.Permissions.elevated:12 -msgid ":attr:`manage_emojis_and_stickers`" -msgstr ":attr:`manage_emojis_and_stickers`" - #: ../../../discord/permissions.py:docstring of discord.permissions.Permissions.elevated:13 msgid ":attr:`manage_threads`" msgstr ":attr:`manage_threads`" @@ -20824,13 +21270,14 @@ msgstr ":attr:`manage_roles` のエイリアス。" msgid "Returns ``True`` if a user can create, edit, or delete webhooks." msgstr "ユーザーがWebhookを作成、編集、削除できる場合は、``True`` を返します。" -#: ../../docstring of discord.Permissions.manage_emojis:1 -msgid "Returns ``True`` if a user can create, edit, or delete emojis." -msgstr "ユーザーが絵文字を作成、編集、削除できる場合は ``True`` を返します。" +#: ../../docstring of discord.Permissions.manage_expressions:1 +msgid "Returns ``True`` if a user can edit or delete emojis, stickers, and soundboard sounds." +msgstr "" +#: ../../docstring of discord.Permissions.manage_emojis:1 #: ../../docstring of discord.Permissions.manage_emojis_and_stickers:1 -msgid "An alias for :attr:`manage_emojis`." -msgstr ":attr:`manage_emojis` のエイリアス。" +msgid "An alias for :attr:`manage_expressions`." +msgstr "" #: ../../docstring of discord.Permissions.use_application_commands:1 msgid "Returns ``True`` if a user can use slash commands." @@ -20876,7 +21323,23 @@ msgstr "ユーザーがボイスチャンネルにて埋め込みアプリケー msgid "Returns ``True`` if a user can time out other members." msgstr "ユーザーが他のユーザーをタイムアウトできる場合は ``True`` を返します。" -#: ../../api.rst:4805 +#: ../../docstring of discord.Permissions.use_soundboard:1 +msgid "Returns ``True`` if a user can use the soundboard." +msgstr "" + +#: ../../docstring of discord.Permissions.create_expressions:1 +msgid "Returns ``True`` if a user can create emojis, stickers, and soundboard sounds." +msgstr "" + +#: ../../docstring of discord.Permissions.use_external_sounds:1 +msgid "Returns ``True`` if a user can use sounds from other guilds." +msgstr "" + +#: ../../docstring of discord.Permissions.send_voice_messages:1 +msgid "Returns ``True`` if a user can send voice messages." +msgstr "" + +#: ../../api.rst:4934 msgid "PermissionOverwrite" msgstr "PermissionOverwrite" @@ -20932,7 +21395,7 @@ msgstr "権限上書きオブジェクトを一括更新します。" msgid "A list of key/value pairs to bulk update with." msgstr "一括更新するためのキーと値のペアのリスト。" -#: ../../api.rst:4813 +#: ../../api.rst:4942 msgid "SystemChannelFlags" msgstr "SystemChannelFlags" @@ -20960,9 +21423,9 @@ msgstr "x と y のいずれか一方のみにて有効化されたフラグの msgid "Returns a SystemChannelFlags instance with all flags inverted from x." msgstr "x のすべてのフラグが反転したSystemChannelFlagsインスタンスを返します。" -#: ../../../discord/flags.py:docstring of discord.flags.SystemChannelFlags:58 -#: ../../../discord/flags.py:docstring of discord.flags.MessageFlags:53 -#: ../../../discord/flags.py:docstring of discord.flags.PublicUserFlags:52 +#: ../../../discord/flags.py:docstring of discord.flags.SystemChannelFlags:64 +#: ../../../discord/flags.py:docstring of discord.flags.MessageFlags:59 +#: ../../../discord/flags.py:docstring of discord.flags.PublicUserFlags:58 msgid "The raw value. This value is a bit array field of a 53-bit integer representing the currently available flags. You should query flags via the properties rather than using this raw value." msgstr "生の値。この値は、現在使用可能なフラグを表す 53 ビット整数のビット配列フィールドです。フラグの取得には、この生の値ではなくプロパティを使用すべきです。" @@ -20990,7 +21453,7 @@ msgstr "ロールサブスクリプションの購入と更新通知が有効に msgid "Returns ``True`` if the role subscription notifications have a sticker reply button." msgstr "ロールサブスクリプション通知にスタンプの返信ボタンがある場合に ``True`` を返します。" -#: ../../api.rst:4821 +#: ../../api.rst:4950 msgid "MessageFlags" msgstr "MessageFlags" @@ -21058,7 +21521,19 @@ msgstr "メッセージがインタラクションの応答で、ボットが「 msgid "Returns ``True`` if the message failed to mention some roles in a thread and add their members to the thread." msgstr "メッセージがロールをメンションし、そのメンバーをスレッドに追加するのに失敗した場合に ``True`` を返します。" -#: ../../api.rst:4829 +#: ../../docstring of discord.MessageFlags.suppress_notifications:1 +msgid "Returns ``True`` if the message will not trigger push and desktop notifications." +msgstr "" + +#: ../../docstring of discord.MessageFlags.silent:1 +msgid "Alias for :attr:`suppress_notifications`." +msgstr "" + +#: ../../docstring of discord.MessageFlags.voice:1 +msgid "Returns ``True`` if the message is a voice message." +msgstr "" + +#: ../../api.rst:4958 msgid "PublicUserFlags" msgstr "PublicUserFlags" @@ -21166,7 +21641,7 @@ msgstr "ユーザーがアクティブな開発者の場合に ``True`` を返 msgid "List[:class:`UserFlags`]: Returns all public flags the user has." msgstr "List[:class:`UserFlags`]: ユーザーが持つすべての公開フラグを返します。" -#: ../../api.rst:4837 +#: ../../api.rst:4966 msgid "MemberFlags" msgstr "MemberFlags" @@ -21214,7 +21689,7 @@ msgstr "メンバーがギルドの認証要件をバイパスできる場合に msgid "Returns ``True`` if the member has started onboarding." msgstr "メンバーがオンボーディングを開始した場合に ``True`` を返します。" -#: ../../api.rst:4845 +#: ../../api.rst:4974 msgid "ForumTag" msgstr "ForumTag" @@ -21250,11 +21725,11 @@ msgstr ":attr:`~Permissions.manage_threads` 権限を有するモデレータの msgid "The emoji that is used to represent this tag. Note that if the emoji is a custom emoji, it will *not* have name information." msgstr "このタグを表すために使用される絵文字。絵文字がカスタム絵文字の場合、名前情報は *提供されません* 。" -#: ../../api.rst:4854 +#: ../../api.rst:4983 msgid "Exceptions" msgstr "例外" -#: ../../api.rst:4856 +#: ../../api.rst:4985 msgid "The following exceptions are thrown by the library." msgstr "以下の例外がライブラリにより送出されます。" @@ -21412,67 +21887,67 @@ msgstr "返されたエラーコード。" msgid "An exception that is thrown for when libopus is not loaded." msgstr "libopus がロードされていないときに送出される例外。" -#: ../../api.rst:4891 +#: ../../api.rst:5020 msgid "Exception Hierarchy" msgstr "例外の階層構造" -#: ../../api.rst:4908 +#: ../../api.rst:5037 msgid ":exc:`Exception`" msgstr ":exc:`Exception`" -#: ../../api.rst:4908 +#: ../../api.rst:5037 msgid ":exc:`DiscordException`" msgstr ":exc:`DiscordException`" -#: ../../api.rst:4901 +#: ../../api.rst:5030 msgid ":exc:`ClientException`" msgstr ":exc:`ClientException`" -#: ../../api.rst:4898 +#: ../../api.rst:5027 msgid ":exc:`InvalidData`" msgstr ":exc:`InvalidData`" -#: ../../api.rst:4899 +#: ../../api.rst:5028 msgid ":exc:`LoginFailure`" msgstr ":exc:`LoginFailure`" -#: ../../api.rst:4900 +#: ../../api.rst:5029 msgid ":exc:`ConnectionClosed`" msgstr ":exc:`ConnectionClosed`" -#: ../../api.rst:4901 +#: ../../api.rst:5030 msgid ":exc:`PrivilegedIntentsRequired`" msgstr ":exc:`PrivilegedIntentsRequired`" -#: ../../api.rst:4902 +#: ../../api.rst:5031 msgid ":exc:`InteractionResponded`" msgstr ":exc:`InteractionResponded`" -#: ../../api.rst:4903 +#: ../../api.rst:5032 msgid ":exc:`GatewayNotFound`" msgstr ":exc:`GatewayNotFound`" -#: ../../api.rst:4907 +#: ../../api.rst:5036 msgid ":exc:`HTTPException`" msgstr ":exc:`HTTPException`" -#: ../../api.rst:4905 +#: ../../api.rst:5034 msgid ":exc:`Forbidden`" msgstr ":exc:`Forbidden`" -#: ../../api.rst:4906 +#: ../../api.rst:5035 msgid ":exc:`NotFound`" msgstr ":exc:`NotFound`" -#: ../../api.rst:4907 +#: ../../api.rst:5036 msgid ":exc:`DiscordServerError`" msgstr ":exc:`DiscordServerError`" -#: ../../api.rst:4908 +#: ../../api.rst:5037 msgid ":exc:`app_commands.CommandSyncFailure`" msgstr ":exc:`app_commands.CommandSyncFailure`" -#: ../../api.rst:4909 +#: ../../api.rst:5038 msgid ":exc:`RateLimited`" msgstr ":exc:`RateLimited`" diff --git a/docs/locale/ja/LC_MESSAGES/discord.po b/docs/locale/ja/LC_MESSAGES/discord.po index 5cf4a9991..f088d7d90 100644 --- a/docs/locale/ja/LC_MESSAGES/discord.po +++ b/docs/locale/ja/LC_MESSAGES/discord.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: discordpy\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-24 11:01+0000\n" -"PO-Revision-Date: 2023-01-30 13:38\n" +"POT-Creation-Date: 2023-06-21 01:17+0000\n" +"PO-Revision-Date: 2023-06-21 01:20\n" "Last-Translator: \n" "Language-Team: Japanese\n" "MIME-Version: 1.0\n" @@ -30,12 +30,12 @@ msgid "Creating a Bot account is a pretty straightforward process." msgstr "Botのアカウント作成はとても簡単です。" #: ../../discord.rst:12 -#: ../../discord.rst:66 +#: ../../discord.rst:61 msgid "Make sure you're logged on to the `Discord website `_." msgstr "`Discordのウェブサイト `_ にログインできていることを確認してください。" #: ../../discord.rst:13 -#: ../../discord.rst:67 +#: ../../discord.rst:62 msgid "Navigate to the `application page `_" msgstr "`Applicationページ `_ に移動します。" @@ -56,22 +56,14 @@ msgid "The new application form filled in." msgstr "記入された新しいアプリケーションフォーム" #: ../../discord.rst:24 -msgid "Create a Bot User by navigating to the \"Bot\" tab and clicking \"Add Bot\"." -msgstr "「Bot」タブへ移動し、「Add Bot」をクリックしてBotユーザーを作成します。" - -#: ../../discord.rst:26 -msgid "Click \"Yes, do it!\" to continue." -msgstr "「Yes, do it!」をクリックして続行します。" - -#: ../../discord.rst:0 -msgid "The Add Bot button." -msgstr "「Add Bot」ボタン" +msgid "Navigate to the \"Bot\" tab to configure it." +msgstr "" -#: ../../discord.rst:30 +#: ../../discord.rst:25 msgid "Make sure that **Public Bot** is ticked if you want others to invite your bot." msgstr "他人にBotの招待を許可する場合には、 **Public Bot** にチェックを入れてください。" -#: ../../discord.rst:32 +#: ../../discord.rst:27 msgid "You should also make sure that **Require OAuth2 Code Grant** is unchecked unless you are developing a service that needs it. If you're unsure, then **leave it unchecked**." msgstr "また、必要なサービスを開発している場合を除いて、 **Require OAuth2 Code Grant** がオフになっていることを確認する必要があります。わからない場合は **チェックを外してください** 。" @@ -79,55 +71,55 @@ msgstr "また、必要なサービスを開発している場合を除いて、 msgid "How the Bot User options should look like for most people." msgstr "Botユーザーの設定がほとんどの人にとってどのように見えるか" -#: ../../discord.rst:38 +#: ../../discord.rst:33 msgid "Copy the token using the \"Copy\" button." msgstr "「Copy」ボタンを使ってトークンをコピーします。" -#: ../../discord.rst:40 +#: ../../discord.rst:35 msgid "**This is not the Client Secret at the General Information page.**" msgstr "**General InformationページのClient Secretではないので注意してください。**" -#: ../../discord.rst:44 +#: ../../discord.rst:39 msgid "It should be worth noting that this token is essentially your bot's password. You should **never** share this with someone else. In doing so, someone can log in to your bot and do malicious things, such as leaving servers, ban all members inside a server, or pinging everyone maliciously." msgstr "このトークンは、あなたのBotのパスワードと同義であることを覚えておきましょう。誰か他の人とトークンを共有することは絶対に避けてください。トークンがあれば、誰かがあなたのBotにログインし、サーバーから退出したり、サーバー内のすべてのメンバーをBANしたり、すべての人にメンションを送るなどといった悪質な行為を行える様になってしまいます。" -#: ../../discord.rst:49 +#: ../../discord.rst:44 msgid "The possibilities are endless, so **do not share this token.**" msgstr "可能性は無限にあるので、絶対に **トークンを共有しないでください** 。" -#: ../../discord.rst:51 +#: ../../discord.rst:46 msgid "If you accidentally leaked your token, click the \"Regenerate\" button as soon as possible. This revokes your old token and re-generates a new one. Now you need to use the new token to login." msgstr "誤ってトークンを流出させてしまった場合、可能な限り速急に「Regenerate」ボタンをクリックしましょう。これによって古いトークンが無効になり、新しいトークンが再生成されます。今度からは新しいトークンを利用してログインを行う必要があります。" -#: ../../discord.rst:55 +#: ../../discord.rst:50 msgid "And that's it. You now have a bot account and you can login with that token." msgstr "以上です。 これでボットアカウントが作成され、そのトークンでログインできます。" -#: ../../discord.rst:60 +#: ../../discord.rst:55 msgid "Inviting Your Bot" msgstr "Botを招待する" -#: ../../discord.rst:62 +#: ../../discord.rst:57 msgid "So you've made a Bot User but it's not actually in any server." msgstr "Botのユーザーを作成しましたが、現時点ではどのサーバーにも参加していない状態です。" -#: ../../discord.rst:64 +#: ../../discord.rst:59 msgid "If you want to invite your bot you must create an invite URL for it." msgstr "Botを招待したい場合は、そのための招待URLを作成する必要があります。" -#: ../../discord.rst:68 +#: ../../discord.rst:63 msgid "Click on your bot's page." msgstr "Botのページを開きます。" -#: ../../discord.rst:69 -msgid "Go to the \"OAuth2\" tab." -msgstr "「OAuth2」タブへ移動します。" +#: ../../discord.rst:64 +msgid "Go to the \"OAuth2 > URL Generator\" tab." +msgstr "" #: ../../discord.rst:0 msgid "How the OAuth2 page should look like." msgstr "OAuth2ページがどのように見えるか" -#: ../../discord.rst:74 +#: ../../discord.rst:69 msgid "Tick the \"bot\" checkbox under \"scopes\"." msgstr "「scopes」下にある「bot」チェックボックスを選択してください。" @@ -135,15 +127,15 @@ msgstr "「scopes」下にある「bot」チェックボックスを選択して msgid "The scopes checkbox with \"bot\" ticked." msgstr "「bot」がチェックされたスコープのチェックボックス" -#: ../../discord.rst:79 +#: ../../discord.rst:74 msgid "Tick the permissions required for your bot to function under \"Bot Permissions\"." msgstr "「Bot Permissions」からBotの機能に必要な権限を選択してください。" -#: ../../discord.rst:81 +#: ../../discord.rst:76 msgid "Please be aware of the consequences of requiring your bot to have the \"Administrator\" permission." msgstr "Botに「管理者」権限を要求させることによる影響は認識しておきましょう。" -#: ../../discord.rst:83 +#: ../../discord.rst:78 msgid "Bot owners must have 2FA enabled for certain actions and permissions when added in servers that have Server-Wide 2FA enabled. Check the `2FA support page `_ for more information." msgstr "二段階認証が有効になっているサーバーにボットを追加する場合、ボットの所有者は特定の動作や権限を与えるために二段階認証を有効化させる必要があります。詳細は `二段階認証のサポートページ `_ を参照してください。" @@ -151,15 +143,15 @@ msgstr "二段階認証が有効になっているサーバーにボットを追 msgid "The permission checkboxes with some permissions checked." msgstr "いくつかの権限にチェックが入った権限のチェックボックス" -#: ../../discord.rst:88 +#: ../../discord.rst:83 msgid "Now the resulting URL can be used to add your bot to a server. Copy and paste the URL into your browser, choose a server to invite the bot to, and click \"Authorize\"." msgstr "結果的に生成されたURLを使ってBotをサーバーに追加することができます。URLをコピーしてブラウザに貼り付け、Botを招待したいサーバーを選択した後、「認証」をクリックしてください。" -#: ../../discord.rst:93 +#: ../../discord.rst:88 msgid "The person adding the bot needs \"Manage Server\" permissions to do so." msgstr "Botを追加する人には「サーバー管理」権限が必要です。" -#: ../../discord.rst:95 +#: ../../discord.rst:90 msgid "If you want to generate this URL dynamically at run-time inside your bot and using the :class:`discord.Permissions` interface, you can use :func:`discord.utils.oauth_url`." msgstr "このURLを実行時に動的に生成したい場合は、 :class:`discord.Permissions` インターフェイスから :func:`discord.utils.oauth_url` を使用できます。" diff --git a/docs/locale/ja/LC_MESSAGES/ext/commands/api.po b/docs/locale/ja/LC_MESSAGES/ext/commands/api.po index aa1bf60c2..04d44642a 100644 --- a/docs/locale/ja/LC_MESSAGES/ext/commands/api.po +++ b/docs/locale/ja/LC_MESSAGES/ext/commands/api.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: discordpy\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-29 20:45+0000\n" -"PO-Revision-Date: 2023-01-30 13:38\n" +"POT-Creation-Date: 2023-06-21 01:17+0000\n" +"PO-Revision-Date: 2023-06-21 01:20\n" "Last-Translator: \n" "Language-Team: Japanese\n" "MIME-Version: 1.0\n" @@ -581,8 +581,8 @@ msgid "A view was not passed." msgstr "Viewが渡されなかった" #: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.add_view:16 -msgid "The view is not persistent. A persistent view has no timeout and all their components have an explicitly provided custom_id." -msgstr "Viewは永続的ではありません。永続的なViewにはタイムアウトがなく、すべてのコンポーネントには明示的に渡された custom_id があります" +msgid "The view is not persistent or is already finished. A persistent view has no timeout and all their components have an explicitly provided custom_id." +msgstr "" #: ../../../discord/ext/commands/bot.py:docstring of discord.ext.commands.Bot.allowed_mentions:1 msgid "The allowed mention configuration." @@ -932,14 +932,14 @@ msgid "Retrieves an :term:`asynchronous iterator` that enables receiving your gu msgstr "Botが所属するGuildを取得できる、 :term:`asynchronous iterator` を取得します。" #: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:5 -msgid "Using this, you will only receive :attr:`.Guild.owner`, :attr:`.Guild.icon`, :attr:`.Guild.id`, and :attr:`.Guild.name` per :class:`.Guild`." -msgstr "これを使った場合、各 :class:`Guild` の :attr:`Guild.owner` 、 :attr:`Guild.icon` 、 :attr:`Guild.id` 、 :attr:`Guild.name` のみ取得できます。" +msgid "Using this, you will only receive :attr:`.Guild.owner`, :attr:`.Guild.icon`, :attr:`.Guild.id`, :attr:`.Guild.name`, :attr:`.Guild.approximate_member_count`, and :attr:`.Guild.approximate_presence_count` per :class:`.Guild`." +msgstr "" -#: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:10 +#: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:11 msgid "This method is an API call. For general usage, consider :attr:`guilds` instead." msgstr "これはAPIを呼び出します。通常は :attr:`guilds` を代わりに使用してください。" -#: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:13 +#: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:14 #: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.wait_for:22 #: ../../../discord/ext/commands/core.py:docstring of discord.ext.commands.core.check:37 #: ../../../discord/ext/commands/core.py:docstring of discord.ext.commands.core.check_any:20 @@ -947,37 +947,41 @@ msgstr "これはAPIを呼び出します。通常は :attr:`guilds` を代わ msgid "Examples" msgstr "例" -#: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:14 +#: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:15 #: ../../../discord/ext/commands/context.py:docstring of discord.abc.Messageable.history:7 msgid "Usage ::" msgstr "使い方 ::" -#: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:19 +#: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:20 msgid "Flattening into a list ::" msgstr "リストへフラット化 ::" -#: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:24 +#: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:25 #: ../../../discord/ext/commands/context.py:docstring of discord.abc.Messageable.history:19 msgid "All parameters are optional." msgstr "すべてのパラメータがオプションです。" -#: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:26 +#: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:27 msgid "The number of guilds to retrieve. If ``None``, it retrieves every guild you have access to. Note, however, that this would make it a slow operation. Defaults to ``200``." msgstr "取得するギルドの数。 ``None`` の場合、Botがアクセスできるギルドすべてを取得します。ただし、これには時間が掛かることに注意してください。デフォルトは200です。" -#: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:33 +#: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:34 msgid "The default has been changed to 200." msgstr "デフォルトが200に変更されました。" -#: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:35 +#: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:36 msgid "Retrieves guilds before this date or object. If a datetime is provided, it is recommended to use a UTC aware datetime. If the datetime is naive, it is assumed to be local time." msgstr "渡された日付、またはギルドより前のギルドを取得します。日付を指定する場合、UTC aware datetimeを利用することを推奨します。naive datetimeである場合、これはローカル時間であるとみなされます。" -#: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:39 +#: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:40 msgid "Retrieve guilds after this date or object. If a datetime is provided, it is recommended to use a UTC aware datetime. If the datetime is naive, it is assumed to be local time." msgstr "渡された日付、またはオブジェクトより後のギルドを取得します。日付を指定する場合、UTC対応の「aware」を利用することを推奨します。日付が「naive」である場合、これは地域時間であるとみなされます。" #: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:44 +msgid "Whether to include count information in the guilds. This fills the :attr:`.Guild.approximate_member_count` and :attr:`.Guild.approximate_presence_count` attributes without needing any privileged intents. Defaults to ``True``." +msgstr "" + +#: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:51 msgid "Getting the guilds failed." msgstr "Guildの取得に失敗した場合。" @@ -989,7 +993,7 @@ msgstr "Guildの取得に失敗した場合。" msgid "Yields" msgstr "Yieldする値" -#: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:46 +#: ../../../discord/ext/commands/bot.py:docstring of discord.client.Client.fetch_guilds:53 msgid ":class:`.Guild` -- The guild with the guild data parsed." msgstr ":class:`.Guild` -- データを解析したGuild。" @@ -2171,7 +2175,7 @@ msgstr "``cls`` で指定されたクラスの構築時に渡すキーワード #: ../../../discord/ext/commands/core.py:docstring of discord.ext.commands.core.command:21 #: ../../../discord/ext/commands/hybrid.py:docstring of discord.ext.commands.hybrid.hybrid_command:29 -#: ../../../discord/ext/commands/hybrid.py:docstring of discord.ext.commands.hybrid.hybrid_group:9 +#: ../../../discord/ext/commands/hybrid.py:docstring of discord.ext.commands.hybrid.hybrid_group:12 msgid "If the function is not a coroutine or is already a command." msgstr "関数がコルーチンでない場合、またはすでにコマンドが登録されている場合。" @@ -2204,7 +2208,7 @@ msgid "Checks and error handlers are dispatched and called as-if they were comma msgstr "チェックとエラーハンドラは、 :class:`.Command` のようなコマンドであるかのように呼び出されます。つまり、パラメータには :class:`discord.Interaction` ではなく :class:`Context` を取ります。" #: ../../../discord/ext/commands/hybrid.py:docstring of discord.ext.commands.hybrid.hybrid_command:24 -#: ../../../discord/ext/commands/hybrid.py:docstring of discord.ext.commands.hybrid.hybrid_group:6 +#: ../../../discord/ext/commands/hybrid.py:docstring of discord.ext.commands.hybrid.hybrid_group:9 msgid "Whether to register the command also as an application command." msgstr "アプリケーションコマンドとしてもコマンドを登録するかどうか。" @@ -2220,6 +2224,10 @@ msgstr "関数を :class:`.HybridGroup` に変換するデコレータ。" msgid "This is similar to the :func:`~discord.ext.commands.group` decorator except it creates a hybrid group instead." msgstr "これは :func:`~discord.ext.commands.group` デコレータに似ていますが、代わりにハイブリッドグループを作成します。" +#: ../../../discord/ext/commands/hybrid.py:docstring of discord.ext.commands.hybrid.hybrid_group:6 +msgid "The name to create the group with. By default this uses the function name unchanged." +msgstr "" + #: ../../ext/commands/api.rst:131 msgid "Command" msgstr "Command" @@ -2925,7 +2933,11 @@ msgstr "コグが削除された際に呼び出される特別なメソッド。 msgid "Subclasses must replace this if they want special unloading behaviour." msgstr "サブクラスは特別なアンロード動作が必要な場合にこれを置き換えなければなりません。" -#: ../../../discord/ext/commands/cog.py:docstring of discord.ext.commands.cog.Cog.cog_unload:9 +#: ../../../discord/ext/commands/cog.py:docstring of discord.ext.commands.cog.Cog.cog_unload:7 +msgid "Exceptions raised in this method are ignored during extension unloading." +msgstr "" + +#: ../../../discord/ext/commands/cog.py:docstring of discord.ext.commands.cog.Cog.cog_unload:11 msgid "This method can now be a :term:`coroutine`." msgstr "このメソッドは現在 :term:`coroutine` になりました。" @@ -2947,6 +2959,16 @@ msgstr ":meth:`.Bot.check` チェックとして登録する特別なメソッ msgid "A special method that registers as a :func:`~discord.ext.commands.check` for every command and subcommand in this cog." msgstr "このコグのすべてのコマンドとサブコマンドに対して :func:`~discord.ext.commands.check` として登録する特別なメソッド。" +#: ../../../discord/ext/commands/cog.py:docstring of discord.ext.commands.cog.Cog.interaction_check:1 +#: ../../../discord/ext/commands/cog.py:docstring of discord.ext.commands.cog.Cog.interaction_check:1 +msgid "A special method that registers as a :func:`discord.app_commands.check` for every app command and subcommand in this cog." +msgstr "" + +#: ../../../discord/ext/commands/cog.py:docstring of discord.ext.commands.cog.Cog.interaction_check:4 +#: ../../../discord/ext/commands/cog.py:docstring of discord.ext.commands.cog.Cog.interaction_check:4 +msgid "This function **can** be a coroutine and must take a sole parameter, ``interaction``, to represent the :class:`~discord.Interaction`." +msgstr "" + #: ../../../discord/ext/commands/cog.py:docstring of discord.ext.commands.cog.Cog.cog_command_error:3 msgid "A special method that is called whenever an error is dispatched inside this cog." msgstr "このコグ内でエラーが発生するたびに呼び出される特別なメソッド。" @@ -3019,8 +3041,8 @@ msgid "Decorators such as :func:`~discord.app_commands.guild_only`, :func:`~disc msgstr ":func:`~discord.app_commands.guild_only` 、 :func:`~discord.app_commands.guilds` 、 :func:`~discord.app_commands.default_permissions` のようなデコレータはコグの上に使用されている場合、グループに適用されます。" #: ../../../discord/ext/commands/cog.py:docstring of discord.ext.commands.cog.GroupCog:11 -msgid "Hybrid commands will also be added to the Group, giving the ability categorize slash commands into groups, while keeping the prefix-style command as a root-level command." -msgstr "グループにもハイブリッドコマンドが追加され、プレフィックス形式のコマンドをルートレベルのコマンドとして保持しながら、スラッシュコマンドをグループに分類できるようになります。" +msgid "Hybrid commands will also be added to the Group, giving the ability to categorize slash commands into groups, while keeping the prefix-style command as a root-level command." +msgstr "" #: ../../../discord/ext/commands/cog.py:docstring of discord.ext.commands.cog.GroupCog:14 msgid "For example:" @@ -3311,7 +3333,7 @@ msgstr "コマンドの最大の幅。" #: ../../../discord/ext/commands/help.py:docstring of discord.ext.commands.help.DefaultHelpCommand:12 #: ../../../discord/ext/commands/help.py:docstring of discord.ext.commands.help.DefaultHelpCommand:42 #: ../../../discord/ext/commands/help.py:docstring of discord.ext.commands.help.Paginator:25 -#: ../../../discord/ext/commands/flags.py:docstring of discord.ext.commands.flags.Flag:42 +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.Context.filesize_limit:5 msgid ":class:`int`" msgstr ":class:`int`" @@ -4423,6 +4445,10 @@ msgstr "「クリーンアップ」されたプレフィックスを返します msgid "Returns the cog associated with this context's command. None if it does not exist." msgstr "このコンテキストのコマンドに関連付けられたコグを返します。存在しない場合はNoneを返します。" +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.Context.filesize_limit:1 +msgid "Returns the maximum number of bytes files can have when uploaded to this guild or DM channel associated with this context." +msgstr "" + #: ../../docstring of discord.ext.commands.Context.guild:1 msgid "Returns the guild associated with this context's command. None if not available." msgstr "このコンテキストのコマンドに関連付けられているギルドを返します。利用できない場合はNoneを返します。" @@ -4496,72 +4522,6 @@ msgstr "ヘルプを表示するエンティティ。" msgid "The result of the help command, if any." msgstr "もしあれば、ヘルプコマンドの結果。" -#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.reply:3 -msgid "A shortcut method to :meth:`send` to reply to the :class:`~discord.Message` referenced by this context." -msgstr "このコンテキストで参照されている :class:`~discord.Message` に返信するための、 :meth:`send` のショートカットメソッド。" - -#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.reply:6 -msgid "For interaction based contexts, this is the same as :meth:`send`." -msgstr "インタラクションベースのコンテキストでは、 :meth:`send` と同じです。" - -#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.reply:10 -#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.send:13 -msgid "This function will now raise :exc:`TypeError` or :exc:`ValueError` instead of ``InvalidArgument``." -msgstr "この関数は ``InvalidArgument`` の代わりに :exc:`TypeError` または :exc:`ValueError` を発生するようになりました。" - -#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.reply:14 -#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.send:80 -msgid "Sending the message failed." -msgstr "メッセージの送信に失敗しました。" - -#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.reply:15 -#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.send:81 -msgid "You do not have the proper permissions to send the message." -msgstr "メッセージを送信するための適切な権限がありません。" - -#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.reply:16 -msgid "The ``files`` list is not of the appropriate size" -msgstr "``files`` リストの大きさが適切ではありません。" - -#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.reply:17 -msgid "You specified both ``file`` and ``files``." -msgstr "``file`` と ``files`` の両方が指定されています。" - -#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.reply:19 -#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.send:85 -msgid "The message that was sent." -msgstr "送信されたメッセージ。" - -#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.reply:20 -#: ../../../discord/ext/commands/context.py:docstring of discord.abc.Messageable.fetch_message:13 -#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.send:86 -msgid ":class:`~discord.Message`" -msgstr ":class:`~discord.Message`" - -#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.defer:3 -msgid "Defers the interaction based contexts." -msgstr "インタラクションの応答を遅らせます。" - -#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.defer:5 -msgid "This is typically used when the interaction is acknowledged and a secondary action will be done later." -msgstr "これは通常、インタラクションを認識した後、後で他のことを実行する場合に使われます。" - -#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.defer:8 -msgid "If this isn't an interaction based context then it does nothing." -msgstr "これがインタラクションベースのコンテキストでない場合、何もしません。" - -#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.defer:10 -msgid "Indicates whether the deferred message will eventually be ephemeral." -msgstr "遅れて送信するメッセージが一時的になるかを示します。" - -#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.defer:13 -msgid "Deferring the interaction failed." -msgstr "インタラクションの遅延に失敗した場合。" - -#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.defer:14 -msgid "This interaction has already been responded to before." -msgstr "既にインタラクションに応答していた場合。" - #: ../../../discord/ext/commands/context.py:docstring of discord.abc.Messageable.fetch_message:3 msgid "Retrieves a single :class:`~discord.Message` from the destination." msgstr "出力先から、単一の :class:`~discord.Message` を取得します。" @@ -4586,6 +4546,12 @@ msgstr "メッセージの取得に失敗した場合。" msgid "The message asked for." msgstr "要求されたメッセージ。" +#: ../../../discord/ext/commands/context.py:docstring of discord.abc.Messageable.fetch_message:13 +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.reply:20 +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.send:91 +msgid ":class:`~discord.Message`" +msgstr ":class:`~discord.Message`" + #: ../../../discord/ext/commands/context.py:docstring of discord.abc.Messageable.history:1 msgid "Returns an :term:`asynchronous iterator` that enables receiving the destination's message history." msgstr "出力先のメッセージ履歴を取得する :term:`asynchronous iterator` を返します。" @@ -4654,6 +4620,66 @@ msgstr "現時点でピン留めされているメッセージ。" msgid "List[:class:`~discord.Message`]" msgstr "List[:class:`~discord.Message`]" +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.reply:3 +msgid "A shortcut method to :meth:`send` to reply to the :class:`~discord.Message` referenced by this context." +msgstr "このコンテキストで参照されている :class:`~discord.Message` に返信するための、 :meth:`send` のショートカットメソッド。" + +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.reply:6 +msgid "For interaction based contexts, this is the same as :meth:`send`." +msgstr "インタラクションベースのコンテキストでは、 :meth:`send` と同じです。" + +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.reply:10 +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.send:13 +msgid "This function will now raise :exc:`TypeError` or :exc:`ValueError` instead of ``InvalidArgument``." +msgstr "この関数は ``InvalidArgument`` の代わりに :exc:`TypeError` または :exc:`ValueError` を発生するようになりました。" + +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.reply:14 +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.send:85 +msgid "Sending the message failed." +msgstr "メッセージの送信に失敗しました。" + +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.reply:15 +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.send:86 +msgid "You do not have the proper permissions to send the message." +msgstr "メッセージを送信するための適切な権限がありません。" + +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.reply:16 +msgid "The ``files`` list is not of the appropriate size" +msgstr "``files`` リストの大きさが適切ではありません。" + +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.reply:17 +msgid "You specified both ``file`` and ``files``." +msgstr "``file`` と ``files`` の両方が指定されています。" + +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.reply:19 +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.send:90 +msgid "The message that was sent." +msgstr "送信されたメッセージ。" + +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.defer:3 +msgid "Defers the interaction based contexts." +msgstr "インタラクションの応答を遅らせます。" + +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.defer:5 +msgid "This is typically used when the interaction is acknowledged and a secondary action will be done later." +msgstr "これは通常、インタラクションを認識した後、後で他のことを実行する場合に使われます。" + +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.defer:8 +msgid "If this isn't an interaction based context then it does nothing." +msgstr "これがインタラクションベースのコンテキストでない場合、何もしません。" + +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.defer:10 +msgid "Indicates whether the deferred message will eventually be ephemeral." +msgstr "遅れて送信するメッセージが一時的になるかを示します。" + +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.defer:13 +msgid "Deferring the interaction failed." +msgstr "インタラクションの遅延に失敗した場合。" + +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.defer:14 +msgid "This interaction has already been responded to before." +msgstr "既にインタラクションに応答していた場合。" + #: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.send:3 msgid "Sends a message to the destination with the content given." msgstr "指定された内容のメッセージを出力先に送信します。" @@ -4742,11 +4768,15 @@ msgstr "メッセージの埋め込みを抑制するかどうか。これが `` msgid "Indicates if the message should only be visible to the user who started the interaction. If a view is sent with an ephemeral message and it has no timeout set then the timeout is set to 15 minutes. **This is only applicable in contexts with an interaction**." msgstr "メッセージがインタラクションを開始したユーザーだけに表示されるかどうか。もしビューが一時的なメッセージで送信されている、かつタイムアウトが設定されていない場合、タイムアウトは15分に設定されます。 **これはインタラクションベースのコンテキストでのみ適用されます。**" -#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.send:82 +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.send:79 +msgid "Whether to suppress push and desktop notifications for the message. This will increment the mention counter in the UI, but will not actually send a notification." +msgstr "" + +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.send:87 msgid "The ``files`` list is not of the appropriate size." msgstr "``files`` リストの大きさが適切でない場合。" -#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.send:83 +#: ../../../discord/ext/commands/context.py:docstring of discord.ext.commands.context.Context.send:88 msgid "You specified both ``file`` and ``files``, or you specified both ``embed`` and ``embeds``, or the ``reference`` object is not a :class:`~discord.Message`, :class:`~discord.MessageReference` or :class:`~discord.PartialMessage`." msgstr "``file`` と ``files`` の両方が指定された場合、 ``embed`` と ``embeds`` の両方が指定された場合、または ``reference`` が :class:`~discord.Message` 、 :class:`~discord.MessageReference` 、 :class:`~discord.PartialMessage` でない場合。" @@ -4864,29 +4894,41 @@ msgstr "メンションで検索" #: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.MemberConverter:10 #: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.UserConverter:9 -msgid "Lookup by name#discrim" -msgstr "名前#タグ で検索" +msgid "Lookup by username#discriminator (deprecated)." +msgstr "" #: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.MemberConverter:11 #: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.UserConverter:10 -#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.TextChannelConverter:10 -#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.VoiceChannelConverter:10 -#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.StageChannelConverter:12 -msgid "Lookup by name" -msgstr "名前 で検索" +msgid "Lookup by username#0 (deprecated, only gets users that migrated from their discriminator)." +msgstr "" #: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.MemberConverter:12 -msgid "Lookup by nickname" -msgstr "ニックネーム で検索" +msgid "Lookup by guild nickname." +msgstr "" + +#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.MemberConverter:13 +#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.UserConverter:11 +msgid "Lookup by global name." +msgstr "" #: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.MemberConverter:14 +#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.UserConverter:12 +msgid "Lookup by user name." +msgstr "" + +#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.MemberConverter:16 msgid "Raise :exc:`.MemberNotFound` instead of generic :exc:`.BadArgument`" msgstr "一般的な :exc:`.BadArgument` の代わりに :exc:`.MemberNotFound` を発生させます。" -#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.MemberConverter:17 +#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.MemberConverter:19 msgid "This converter now lazily fetches members from the gateway and HTTP APIs, optionally caching the result if :attr:`.MemberCacheFlags.joined` is enabled." msgstr "このコンバータは、ゲートウェイやHTTP APIからメンバーを取得でき、 :attr:`.MemberCacheFlags.joined` が有効な場合には結果がキャッシュされるようになりました。" +#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.MemberConverter:23 +#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.UserConverter:21 +msgid "Looking up users by discriminator will be removed in a future version due to the removal of discriminators in an API change." +msgstr "" + #: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.UserConverter:1 msgid "Converts to a :class:`~discord.User`." msgstr ":class:`~discord.User` に変換します。" @@ -4895,11 +4937,11 @@ msgstr ":class:`~discord.User` に変換します。" msgid "All lookups are via the global user cache." msgstr "すべての検索はグローバルユーザーキャッシュを介して行われます。" -#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.UserConverter:12 +#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.UserConverter:14 msgid "Raise :exc:`.UserNotFound` instead of generic :exc:`.BadArgument`" msgstr "一般的な :exc:`.BadArgument` の代わりに :exc:`.UserNotFound` を発生させます。" -#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.UserConverter:15 +#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.UserConverter:17 msgid "This converter now lazily fetches users from the HTTP APIs if an ID is passed and it's not available in cache." msgstr "このコンバータは、ID が渡され、キャッシュされていない場合、HTTP API からユーザーを取得するようになりました。" @@ -4958,6 +5000,14 @@ msgstr "名前で検索" msgid "Converts to a :class:`~discord.TextChannel`." msgstr ":class:`~discord.TextChannel` に変換します。" +#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.TextChannelConverter:10 +#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.VoiceChannelConverter:10 +#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.StageChannelConverter:12 +#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.CategoryChannelConverter:10 +#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.ForumChannelConverter:10 +msgid "Lookup by name" +msgstr "名前 で検索" + #: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.TextChannelConverter:12 #: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.VoiceChannelConverter:12 #: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.CategoryChannelConverter:12 @@ -5189,11 +5239,19 @@ msgstr "``Range[int, None, 10]`` は最小値なし、最大値10を意味しま msgid "``Range[int, 1, 10]`` means the minimum is 1 and the maximum is 10." msgstr "``Range[int, 1, 10]`` は最小値1、最大値10を意味します。" +#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.Range:12 +msgid "``Range[float, 1.0, 5.0]`` means the minimum is 1.0 and the maximum is 5.0." +msgstr "" + #: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.Range:13 +msgid "``Range[str, 1, 10]`` means the minimum length is 1 and the maximum length is 10." +msgstr "" + +#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.Range:15 msgid "Inside a :class:`HybridCommand` this functions equivalently to :class:`discord.app_commands.Range`." msgstr ":class:`HybridCommand` 内では、この関数は :class:`discord.app_commands.Range` と同様に動作します。" -#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.Range:15 +#: ../../../discord/ext/commands/converter.py:docstring of discord.ext.commands.converter.Range:17 msgid "If the value cannot be converted to the provided type or is outside the given range, :class:`~.ext.commands.BadArgument` or :class:`~.ext.commands.RangeError` is raised to the appropriate error handlers respectively." msgstr "もし値が渡された型に変換できず、または指定された範囲外である場合、:class:`~.ext.commands.BadArgument` や :class:`~.ext.commands.RangeError` が適切なエラーハンドラに送出されます。" @@ -5412,6 +5470,11 @@ msgstr "このパラメータの説明。" msgid "The displayed default in :class:`Command.signature`." msgstr ":class:`Command.signature` で表示される既定値。" +#: ../../../discord/ext/commands/parameters.py:docstring of discord.ext.commands.Parameter.displayed_name:1 +#: ../../../discord/ext/commands/parameters.py:docstring of discord.ext.commands.parameters.parameter:24 +msgid "The name that is displayed to the user." +msgstr "" + #: ../../../discord/ext/commands/parameters.py:docstring of discord.ext.commands.parameters.Parameter.get_default:3 msgid "Gets this parameter's default value." msgstr "このパラメータの既定値を取得します。" @@ -5441,8 +5504,8 @@ msgid "The displayed default in :attr:`Command.signature`." msgstr ":attr:`Command.signature` で表示される既定値。" #: ../../../discord/ext/commands/parameters.py:docstring of discord.ext.commands.parameters.parameter:1 -msgid "param(\\*, converter=..., default=..., description=..., displayed_default=...)" -msgstr "param(\\*, converter=..., default=..., description=..., displayed_default=...)" +msgid "param(\\*, converter=..., default=..., description=..., displayed_default=..., displayed_name=...)" +msgstr "" #: ../../../discord/ext/commands/parameters.py:docstring of discord.ext.commands.parameters.parameter:3 msgid "An alias for :func:`parameter`." @@ -5628,6 +5691,10 @@ msgstr "比較が失敗した値の、失敗した順のタプル。" msgid "Tuple[Any, ``...``]" msgstr "Tuple[Any, ``...``]" +#: ../../../discord/ext/commands/errors.py:docstring of discord.ext.commands.errors.BadLiteralArgument:28 +msgid "The argument's value that failed to be converted. Defaults to an empty string." +msgstr "" + #: ../../../discord/ext/commands/errors.py:docstring of discord.ext.commands.errors.PrivateMessageOnly:1 msgid "Exception raised when an operation does not work outside of private message contexts." msgstr "プライベートメッセージコンテキスト外で、要求された処理が実行できない場合に発生する例外。" diff --git a/docs/locale/ja/LC_MESSAGES/ext/commands/cogs.po b/docs/locale/ja/LC_MESSAGES/ext/commands/cogs.po index e7b02f5e6..2f87a1d27 100644 --- a/docs/locale/ja/LC_MESSAGES/ext/commands/cogs.po +++ b/docs/locale/ja/LC_MESSAGES/ext/commands/cogs.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: discordpy\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-24 11:01+0000\n" -"PO-Revision-Date: 2023-01-30 13:38\n" +"POT-Creation-Date: 2023-06-21 01:17+0000\n" +"PO-Revision-Date: 2023-06-21 01:20\n" "Last-Translator: \n" "Language-Team: Japanese\n" "MIME-Version: 1.0\n" diff --git a/docs/locale/ja/LC_MESSAGES/ext/commands/commands.po b/docs/locale/ja/LC_MESSAGES/ext/commands/commands.po index bac6599fa..ee29cded9 100644 --- a/docs/locale/ja/LC_MESSAGES/ext/commands/commands.po +++ b/docs/locale/ja/LC_MESSAGES/ext/commands/commands.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: discordpy\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-24 11:01+0000\n" -"PO-Revision-Date: 2023-01-30 13:38\n" +"POT-Creation-Date: 2023-06-21 01:17+0000\n" +"PO-Revision-Date: 2023-06-21 01:20\n" "Last-Translator: \n" "Language-Team: Japanese\n" "MIME-Version: 1.0\n" @@ -953,103 +953,103 @@ msgstr "もし例外が発生した場合、 :ref:`エラーハンドラ