Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a761056
chore: :memo: update license format in pyproject.toml (#2824)
Paillat-dev Jul 7, 2025
bbed889
docs: :memo: Fix malformed hyperlink in CHANGELOG.md number 2 (#2806)
Paillat-dev Jul 21, 2025
9a5554f
feat: components v2 & `View` improvements (#2707)
NeloBlivion Jul 21, 2025
26a9420
fix: 4006 voice crashes and upgrade to voice v8 (#2812)
DA-344 Jul 25, 2025
3eb9923
fix: :bug: Fix missing self. attribution in File component (#2843)
Paillat-dev Aug 1, 2025
ca6bcca
fix: :bug: Fix issue in cv2 example (#2842)
Paillat-dev Aug 2, 2025
6fe0978
docs: :memo: update docstrings for Asset and Attachment classes to cl…
Paillat-dev Aug 2, 2025
4f3a729
fix: :bug: Issue in `@option` where some annotations could not be use…
Paillat-dev Aug 2, 2025
2036257
feat: allow conversion to Member in MentionableConverter (#2775)
Lumabots Aug 2, 2025
cdb9628
feat: :sparkles: Add missing feature flags to `Guild.edit` (#2672)
Paillat-dev Aug 2, 2025
c7da01f
feat(translations): add turkish
Lulalaby Aug 2, 2025
c706edc
docs: Update localizations from Crowdin (#2846)
NyuwBot Aug 2, 2025
b27b662
feat(commands): add support for typing.Literal[...] as command choice…
Lumabots Aug 2, 2025
94ec8f9
fix: retain original File item urls for editing (#2847)
NeloBlivion Aug 2, 2025
30e032c
feat: ✨ Add support for role gradient colors in Role (#2818)
Paillat-dev Aug 2, 2025
16058a9
feat: :sparkles: add Nameplate class and integration (#2817)
Paillat-dev Aug 2, 2025
2dfe1dc
feat: Added support for emoji aliases like `:smile:` in PartialEmoji.…
Lulalaby Aug 2, 2025
800b65d
Update readthedocs.yml
Lulalaby Aug 3, 2025
0c6a48e
chore(ci): update execute-whitelist-action
Lulalaby Aug 3, 2025
d9eda95
feat: added Interaction.attachment_size_limit (#2854)
hich4t Aug 5, 2025
9e23f4b
feat: Replaced useless `cached_property` with `property` and moved to…
RiccardoVaccari Aug 6, 2025
d151315
fix: support new voice encryption modes (#2651)
NeloBlivion Aug 7, 2025
c72b628
:arrow_up: Upgrade deps
Paillat-dev Aug 18, 2025
cdc56a5
:rotating_light: Fix ruff warnings and format code
Paillat-dev Aug 18, 2025
7171fae
:adhesive_bandage: Fix import
Paillat-dev Aug 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 2 additions & 13 deletions .github/workflows/readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,11 @@ jobs:
environment: documentation
strategy:
matrix:
rdt_projects: [
"pycord-spanish",
"pycord-japanese",
"pycord-brazilian",
"pycord-russian",
"pycord-german",
"pycord-hindi",
"pycord-korean",
"pycord-italian",
"pycord-chinese",
"pycord-french"
]
rdt_projects: ["pycord-spanish", "pycord-japanese", "pycord-brazilian", "pycord-russian", "pycord-german", "pycord-hindi", "pycord-korean", "pycord-italian", "pycord-chinese", "pycord-french", "pyord-turkish"]
steps:
- name: "Trigger RDT ${{ matrix.rdt_projects }}"
run: |
PROJECT=${{ matrix.rdt_projects }}
curl --location --request POST "https://readthedocs.org/api/v3/projects/$PROJECT/versions/master/builds/" \
--header 'Content-Type: application/json' \
--header "Authorization: Token ${{ secrets.READTHEDOCS_TOKEN }}"
--header "Authorization: Token ${{ secrets.READTHEDOCS_TOKEN }}"
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
environment: release
steps:
- name: "Security Check"
uses: Aiko-IT-Systems/execute-whitelist-action@v1.0.0
uses: Pycord-Development/execute-whitelist-action@v2.0.0
with:
whitelisted-github-ids: ${{ vars.ALLOWED_USER_IDS }}
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
exclude: \.(po|pot|yml|yaml)$
- id: end-of-file-fixer
exclude: \.(po|pot|yml|yaml)$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.9
rev: v0.12.9
hooks:
- id: ruff
args: [ --fix ]
Expand Down
27 changes: 25 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,24 @@ These changes are available on the `master` branch, but have not yet been releas
([#2564](https://github.com/Pycord-Development/pycord/pull/2564))
- Added `Message.forward_to`, `Message.snapshots`, and other related attributes.
([#2598](https://github.com/Pycord-Development/pycord/pull/2598))
- Add missing `Guild` feature flags and `Guild.edit` parameters.
([#2672](https://github.com/Pycord-Development/pycord/pull/2672))
- Added the ability to change the API's base URL with `Route.API_BASE_URL`.
([#2714](https://github.com/Pycord-Development/pycord/pull/2714))
- Added the ability to pass a `datetime.time` object to `format_dt`.
([#2747](https://github.com/Pycord-Development/pycord/pull/2747))
- Added support for type hinting slash command options with `typing.Annotated`.
([#2782](https://github.com/Pycord-Development/pycord/pull/2782))
- Added conversion to `Member` in `MentionableConverter`.
([#2775](https://github.com/Pycord-Development/pycord/pull/2775))
- Added `discord.Interaction.created_at`.
([#2801](https://github.com/Pycord-Development/pycord/pull/2801))
- Added `User.nameplate` property.
([#2817](https://github.com/Pycord-Development/pycord/pull/2817))
- Added role gradients support with `Role.colours` and the `RoleColours` class.
([#2818](https://github.com/Pycord-Development/pycord/pull/2818))
- Added `Interaction.attachment_size_limit`.
([#2854](https://github.com/Pycord-Development/pycord/pull/2854))

### Fixed

Expand Down Expand Up @@ -113,12 +125,21 @@ These changes are available on the `master` branch, but have not yet been releas
([#2761](https://github.com/Pycord-Development/pycord/pull/2761))
- Updated `valid_locales` to support `in` and `es-419`.
([#2767](https://github.com/Pycord-Development/pycord/pull/2767))
- Added support for emoji aliases like `:smile:` in PartialEmoji.from_str. Also applied
the same logic in PartialEmojiConverter.
([#2815](https://github.com/Pycord-Development/pycord/pull/2815))
- Fixed `Webhook.edit` not working with `attachments=[]`.
([#2779](https://github.com/Pycord-Development/pycord/pull/2779))
- Fixed GIF-based `Sticker` returning the wrong `url`.
([#2781](https://github.com/Pycord-Development/pycord/pull/2781))
- Fixed `VoiceClient` crashing randomly while receiving audio
([#2800](https://github.com/Pycord-Development/pycord/pull/2800))
- Fixed `VoiceClient.connect` failing to do initial connection.
([#2812](https://github.com/Pycord-Development/pycord/pull/2812))
- Fixed `AttributeError` when printing a File component's `__repr__`.
([#2843](https://github.com/Pycord-Development/pycord/pull/2843))
- Fixed `TypeError` when using `@option` with certain annotations and along with
`channel_types`. ([#2835](https://github.com/Pycord-Development/pycord/pull/2835))

### Changed

Expand All @@ -138,6 +159,8 @@ These changes are available on the `master` branch, but have not yet been releas
([#2564](https://github.com/Pycord-Development/pycord/pull/2564))
- Changed the default value of `ApplicationCommand.nsfw` to `False`.
([#2797](https://github.com/Pycord-Development/pycord/pull/2797))
- Upgraded voice websocket version to v8.
([#2812](https://github.com/Pycord-Development/pycord/pull/2812))

### Deprecated

Expand All @@ -150,8 +173,8 @@ These changes are available on the `master` branch, but have not yet been releas

### Removed

- Removed deprecated support for `Option` in `BridgeCommand`. Use `BridgeOption`
instead. ([#2731])(https://github.com/Pycord-Development/pycord/pull/2731))
- Removed deprecated support for `Option` in `BridgeCommand`, use `BridgeOption`
instead. ([#2731](https://github.com/Pycord-Development/pycord/pull/2731))

## [2.6.1] - 2024-09-15

Expand Down
2 changes: 1 addition & 1 deletion crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ preserve_hierarchy: true

commit_message: "docs: Update translations"

export_languages: ["de", "ja", "fr", "it", "hi", "ko", "pt-BR", "es-ES", "zh-CN"]
export_languages: ["de", "ja", "fr", "it", "hi", "ko", "pt-BR", "es-ES", "zh-CN", "tr"]

bundles:
- 1
Expand Down
1 change: 1 addition & 0 deletions discord/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from .channel import *
from .client import *
from .cog import *
from .collectibles import *
from .colour import *
from .commands import *
from .components import *
Expand Down
8 changes: 7 additions & 1 deletion discord/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1545,6 +1545,10 @@ async def send(
raise InvalidArgument(f"view parameter must be View not {view.__class__!r}")

components = view.to_components()
if view.is_components_v2():
if embeds or content:
raise TypeError("cannot send embeds or content with a view using v2 component logic")
flags.is_components_v2 = True
else:
components = None

Expand Down Expand Up @@ -1605,8 +1609,10 @@ async def send(

ret = state.create_message(channel=channel, data=data)
if view:
state.store_view(view, ret.id)
if view.is_dispatchable():
state.store_view(view, ret.id)
view.message = ret
view.refresh(ret.components)

if delete_after is not None:
await ret.delete(delay=delete_after)
Expand Down
4 changes: 3 additions & 1 deletion discord/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ class Asset(AssetMixin):

.. describe:: hash(x)

Returns the hash of the asset.
Returns the asset's url's hash.

This is equivalent to hash(:attr:`url`).
"""

__slots__: tuple[str, ...] = (
Expand Down
12 changes: 6 additions & 6 deletions discord/audit_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,12 +568,12 @@ def _get_member(self, user_id: int) -> Member | User | None:
def __repr__(self) -> str:
return f"<AuditLogEntry id={self.id} action={self.action} user={self.user!r}>"

@utils.cached_property
@property
def created_at(self) -> datetime.datetime:
"""Returns the entry's creation time in UTC."""
return utils.snowflake_time(self.id)

@utils.cached_property
@property
def target(
self,
) -> (
Expand All @@ -597,24 +597,24 @@ def target(
else:
return converter(self._target_id)

@utils.cached_property
@property
def category(self) -> enums.AuditLogActionCategory:
"""The category of the action, if applicable."""
return self.action.category

@utils.cached_property
@property
def changes(self) -> AuditLogChanges:
"""The list of changes this entry has."""
obj = AuditLogChanges(self, self._changes, state=self._state)
del self._changes
return obj

@utils.cached_property
@property
def before(self) -> AuditLogDiff:
"""The target's prior state."""
return self.changes.before

@utils.cached_property
@property
def after(self) -> AuditLogDiff:
"""The target's subsequent state."""
return self.changes.after
Expand Down
4 changes: 2 additions & 2 deletions discord/automod.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,12 @@ def __repr__(self) -> str:
def __str__(self) -> str:
return self.name

@cached_property
@property
def guild(self) -> Guild | None:
"""The guild this rule belongs to."""
return self._state._get_guild(self.guild_id)

@cached_property
@property
def creator(self) -> Member | None:
"""The member who created this rule."""
if self.guild is None:
Expand Down
4 changes: 2 additions & 2 deletions discord/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,13 +803,13 @@ async def process_application_commands(self, interaction: Interaction, auto_sync

ctx = await self.get_application_context(interaction)
if command:
ctx.command = command
interaction.command = command
await self.invoke_application_command(ctx)

async def on_application_command_auto_complete(self, interaction: Interaction, command: ApplicationCommand) -> None:
async def callback() -> None:
ctx = await self.get_autocomplete_context(interaction)
ctx.command = command
interaction.command = command
return await command.invoke_autocomplete_callback(ctx)

autocomplete_task = self._bot.loop.create_task(callback())
Expand Down
53 changes: 39 additions & 14 deletions discord/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,16 @@
from __future__ import annotations

import datetime
from typing import TYPE_CHECKING, Any, Callable, Iterable, Mapping, TypeVar, overload
from typing import (
TYPE_CHECKING,
Any,
Callable,
Iterable,
Mapping,
Sequence,
TypeVar,
overload,
)

import discord.abc

Expand All @@ -45,7 +54,7 @@
)
from .errors import ClientException, InvalidArgument
from .file import File
from .flags import ChannelFlags
from .flags import ChannelFlags, MessageFlags
from .invite import Invite
from .iterators import ArchivedThreadIterator
from .mixins import Hashable
Expand All @@ -71,12 +80,15 @@

if TYPE_CHECKING:
from .abc import Snowflake, SnowflakeTime
from .embeds import Embed
from .guild import Guild
from .guild import GuildChannel as GuildChannelType
from .member import Member, VoiceState
from .mentions import AllowedMentions
from .message import EmojiInputType, Message, PartialMessage
from .role import Role
from .state import ConnectionState
from .sticker import GuildSticker, StickerItem
from .types.channel import CategoryChannel as CategoryChannelPayload
from .types.channel import DMChannel as DMChannelPayload
from .types.channel import ForumChannel as ForumChannelPayload
Expand All @@ -87,6 +99,7 @@
from .types.channel import VoiceChannel as VoiceChannelPayload
from .types.snowflake import SnowflakeList
from .types.threads import ThreadArchiveDuration
from .ui.view import View
from .user import BaseUser, ClientUser, User
from .webhook import Webhook

Expand Down Expand Up @@ -1137,18 +1150,20 @@ async def edit(self, *, reason=None, **options):
async def create_thread(
self,
name: str,
content=None,
content: str | None = None,
*,
embed=None,
embeds=None,
file=None,
files=None,
stickers=None,
delete_message_after=None,
nonce=None,
allowed_mentions=None,
view=None,
applied_tags=None,
embed: Embed | None = None,
embeds: list[Embed] | None = None,
file: File | None = None,
files: list[File] | None = None,
stickers: Sequence[GuildSticker | StickerItem] | None = None,
delete_message_after: float | None = None,
nonce: int | str | None = None,
allowed_mentions: AllowedMentions | None = None,
view: View | None = None,
applied_tags: list[ForumTag] | None = None,
suppress: bool = False,
silent: bool = False,
auto_archive_duration: ThreadArchiveDuration | utils.Undefined = MISSING,
slowmode_delay: int | utils.Undefined = MISSING,
reason: str | None = None,
Expand Down Expand Up @@ -1242,11 +1257,20 @@ async def create_thread(
else:
allowed_mentions = allowed_mentions.to_dict()

flags = MessageFlags(
suppress_embeds=bool(suppress),
suppress_notifications=bool(silent),
)

if view:
if not hasattr(view, "__discord_ui_view__"):
raise InvalidArgument(f"view parameter must be View not {view.__class__!r}")

components = view.to_components()
if view.is_components_v2():
if embeds or content:
raise TypeError("cannot send embeds or content with a view using v2 component logic")
flags.is_components_v2 = True
else:
components = None

Expand Down Expand Up @@ -1282,6 +1306,7 @@ async def create_thread(
auto_archive_duration=auto_archive_duration or self.default_auto_archive_duration,
rate_limit_per_user=slowmode_delay or self.slowmode_delay,
applied_tags=applied_tags,
flags=flags.value,
reason=reason,
)
finally:
Expand All @@ -1291,7 +1316,7 @@ async def create_thread(

ret = Thread(guild=self.guild, state=self._state, data=data)
msg = ret.get_partial_message(int(data["last_message_id"]))
if view:
if view and view.is_dispatchable():
state.store_view(view, msg.id)

if delete_message_after is not None:
Expand Down
Loading
Loading