Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
17766df
Move utils.py to utils/
Paillat-dev May 29, 2025
195e2a0
:fire: Remove `filter_params`
Paillat-dev May 29, 2025
fafa149
:recycle: Merge `time_snowflake` and `generate_snowflake`, move `basi…
Paillat-dev May 29, 2025
e2d8eb1
:recycle: Merge `time_snowflake` and `generate_snowflake`, move `basi…
Paillat-dev May 29, 2025
86bd168
:fire: Remove `utils.sleep_until`
Paillat-dev May 29, 2025
23c2c49
chore: Start migration to uv & ruff & hatch (#4)
Paillat-dev May 29, 2025
97ccda5
Setup CHANGELOG.md (#6)
Paillat-dev May 29, 2025
a5b70e6
fix: Role Edit TypeHint (#2795)
Lumabots May 30, 2025
f2a4eb6
chore: update docs workflows to use 'uv' for dependency management (#33)
Paillat-dev May 30, 2025
e391c82
fix: command syncing edge cases (#2797)
NeloBlivion May 31, 2025
40e20c0
:fire: Move stuff to private
Paillat-dev May 31, 2025
6e5ccb5
Merge branch 'master' into refactor-utils
Paillat-dev May 31, 2025
cd1531d
fix: VoiceClient crashes while receiving audio (#2800)
Hema2-official Jun 3, 2025
1575a27
chore(deps): bump typing-extensions from 4.13.1 to 4.13.2 in the patc…
dependabot[bot] Jun 4, 2025
509569b
feat: add created_at property to Interaction (#2801)
Lumabots Jun 4, 2025
f944b25
chore(deps): update setuptools requirement from <=78.1.0,>=62.6 to >=…
dependabot[bot] Jun 4, 2025
acf0c7a
chore!: :fire: Remove deprecated support for Option in bridge command…
Paillat-dev Jun 4, 2025
7efe9a2
fix: :bug: `TypeError` when specifying `thread_name` in Webhook.send …
Paillat-dev Jun 4, 2025
aeacfed
fix: add BanEntry to __all__ exports in guild.py (#2798)
Lumabots Jun 4, 2025
0571244
fix: correct generic return type in component utils (#2796)
Lumabots Jun 4, 2025
5ddd1e2
chore(deps): update setuptools-scm requirement from <=8.2.1,>=6.2 to …
dependabot[bot] Jun 4, 2025
0618653
chore(deps-dev): update pylint requirement from ~=3.3.6 to ~=3.3.7 (#…
dependabot[bot] Jun 4, 2025
2377245
chore(pre-commit): pre-commit autoupdate (#2792)
pre-commit-ci[bot] Jun 4, 2025
5eaebfb
docs: :memo: Fix malformed CHANGELOG.md hyperlinks (#2804)
Paillat-dev Jun 5, 2025
ad3d2a8
fix: :bug: Fix `ValueError` when using `Flag` (#2759)
Paillat-dev Jun 5, 2025
f17fedd
ci(deps): bump crowdin/github-action from 2.7.0 to 2.7.1 in the patch…
dependabot[bot] Jun 5, 2025
8e97cb5
fix: resolve regex library warnings (#2807)
emmanuel-ferdman Jun 6, 2025
735673b
fix: support emoji aliases like `:smile:` in PartialEmoji.from_str (#…
Lumabots Jun 20, 2025
8619b69
Revert "fix: support emoji aliases like `:smile:` in PartialEmoji.fro…
Lulalaby Jun 20, 2025
1da5de0
:refactor: move parse_time function to private utils and update refer…
Paillat-dev Jun 24, 2025
88180b2
:memo: update CHANGELOG to reflect utility function changes
Paillat-dev Jun 24, 2025
b5c8a58
:art: Format
Paillat-dev Jun 24, 2025
0cdcb31
:recycle: move deprecation utilities to private utils and update refe…
Paillat-dev Jun 24, 2025
09a11a9
:recycle: move snowflake_time function to public.py
Paillat-dev Jun 24, 2025
4a2753c
:recycle: move oauth_url and Undefined class to public.py; update imp…
Paillat-dev Jun 24, 2025
ca89539
Merge branch 'master' into refactor-utils
Paillat-dev Jun 24, 2025
1cf53ab
:memo: remove deprecated utility functions from documentation
Paillat-dev Jun 24, 2025
2ac8152
:memo: remove (re)moved utility functions from documentation
Paillat-dev Jun 24, 2025
24a367c
:memo: add utils.resolve_template to changelog and remove from docume…
Paillat-dev Jun 24, 2025
0c6270a
:bug: fix import path for warn_deprecated utility function
Paillat-dev Jun 24, 2025
84ff9df
:refactor: reorganize utility function imports and move evaluate_anno…
Paillat-dev Jun 24, 2025
8474f05
:recycle: update import paths for utility functions to use relative i…
Paillat-dev Jun 24, 2025
1c65fc8
chore: :memo: update license format in pyproject.toml (#2824)
Paillat-dev Jul 7, 2025
c8ddcb5
:recycle: move delay_task function to private
Paillat-dev Jul 7, 2025
8a02d54
:recycle: removed `utils.get` in favor of `utils.find`
Paillat-dev Jul 7, 2025
39aef0f
:recycle: removed `utils._unique`
Paillat-dev Jul 7, 2025
6b0379c
:recycle: move `async_all` to private
Paillat-dev Jul 7, 2025
cc8f27f
:recycle: move `maybe_coroutine` to private
Paillat-dev Jul 7, 2025
1d70dec
:recycle: rename `maybe_coroutine` to `maybe_awaitable`
Paillat-dev Jul 7, 2025
b2b8625
:recycle: move `sane_wait_for` to private
Paillat-dev Jul 7, 2025
d0a094d
:recycle: move `format_dt` to public
Paillat-dev Jul 7, 2025
fb554fd
:recycle: remove `as_chunks` function
Paillat-dev Jul 7, 2025
1a551cb
:memo: update `utils.sleep_until` and `utils.parse_time` changelog to…
Paillat-dev Jul 7, 2025
295ed46
:recycle: move `compute_timedelta` function
Paillat-dev Jul 7, 2025
4afe54a
:recycle: move `valid_icon_size` to `asset.py`
Paillat-dev Jul 7, 2025
a021450
:recycle: refactor `utils.get` to `utils.find` across multiple files
Paillat-dev Jul 7, 2025
c6f7914
:recycle: refactor markdown and mention handling functions in `__init…
Paillat-dev Jul 7, 2025
c29cdc2
:recycle: move SnowflakeList to `private.py`
Paillat-dev Jul 7, 2025
6c57d5e
:recycle: move `find` function from `__init__.py` to `public.py`
Paillat-dev Jul 7, 2025
d079c7c
:recycle: move `copy_doc` to private
Paillat-dev Jul 7, 2025
611c7c7
:recycle: refactor `get` to `find` in onboarding and sticker modules
Paillat-dev Jul 7, 2025
cd4e436
:bug: fix `copy_doc` decorator usage in context.py
Paillat-dev Jul 7, 2025
ad777e4
Merge branch 'master' into refactor-utils
Paillat-dev Jul 7, 2025
aec45a2
:recycle: move SequenceProxy to private module
Paillat-dev Jul 7, 2025
9755fe8
:recycle: move cached_slot_property to private
Paillat-dev Jul 7, 2025
006a7f8
:rotating_light: add noqa comments to prevent linting errors
Paillat-dev Jul 7, 2025
d5263c7
:recycle: move get_slots function to private module
Paillat-dev Jul 7, 2025
44f753e
:recycle: refactor JSON serialization functions to private module
Paillat-dev Jul 7, 2025
c961e36
:recycle: replace custom cached_property implementation with functool…
Paillat-dev Jul 7, 2025
a4bda5f
:pencil2: fix typo in CHANGELOG-V3.md
Paillat-dev Jul 7, 2025
b81d2d5
:heavy_minus_sign: remove unused dependencies from pyproject.toml and…
Paillat-dev Jul 7, 2025
a84e06d
:coffin: remove test.py
Paillat-dev Jul 7, 2025
330161c
:recycle: remove duplicate import of raw_mentions in __init__.py
Paillat-dev Jul 7, 2025
b3f919e
:bug: fix raw_role_mentions import in utils/__init__.py
Paillat-dev Jul 8, 2025
450140d
chore(pre-commit): pre-commit autoupdate (#2829)
pre-commit-ci[bot] Jul 21, 2025
5a23100
chore(deps-dev): update coverage requirement from ~=7.8 to ~=7.9 (#2811)
dependabot[bot] Jul 21, 2025
1214a70
docs: :memo: Fix malformed hyperlink in CHANGELOG.md number 2 (#2806)
Paillat-dev Jul 21, 2025
b44e13f
chore(deps-dev): update pytest requirement from ~=8.3.5 to ~=8.4.0 (#…
dependabot[bot] Jul 21, 2025
a5aa21f
feat: components v2 & `View` improvements (#2707)
NeloBlivion Jul 21, 2025
2ae01b7
fix: 4006 voice crashes and upgrade to voice v8 (#2812)
DA-344 Jul 25, 2025
fce3fc1
ci(deps): bump crowdin/github-action from 2.7.1 to 2.8.0 in the minor…
dependabot[bot] Jul 27, 2025
268d71e
Merge remote-tracking branch 'pycord/master' into viewless-components
Paillat-dev Jul 29, 2025
e075e1f
WIP
Paillat-dev Jul 31, 2025
0011382
WIP
Paillat-dev Aug 3, 2025
0c9272d
:fire: Duplicate `Iterable` import
Paillat-dev Aug 4, 2025
2b981dd
Apply suggestion from @Lumabots
Paillat-dev Aug 4, 2025
488c4de
Merge branch 'master' into refactor-utils
Paillat-dev Aug 4, 2025
7053daf
Merge branch 'master' into viewless-components
Paillat-dev Aug 6, 2025
6a27770
WIP
Paillat-dev Aug 6, 2025
df155d6
:fire: Simplify imports
Paillat-dev Aug 6, 2025
7d92da0
:fire: Simplify imports number 2
Paillat-dev Aug 6, 2025
856853f
:fire: Simplify imports number 3 omg this is amazing
Paillat-dev Aug 6, 2025
e32ba97
:fire: Simplify imports number 4 omg this is amazing yee
Paillat-dev Aug 6, 2025
d1be746
:fire: Simplify imports number 5
Paillat-dev Aug 6, 2025
bd59784
Update discord/ext/commands/converter.py
Paillat-dev Aug 6, 2025
34d5fde
Apply suggestions from code review
Paillat-dev Aug 6, 2025
5ef78ca
Update discord/state.py
Paillat-dev Aug 6, 2025
0acef26
Update discord/state.py
Paillat-dev Aug 6, 2025
c7db59c
:recycle: Remove _ prefix in from and to json
Paillat-dev Aug 6, 2025
0ca346d
:recycle: Make import less weird
Paillat-dev Aug 6, 2025
2a0427c
Update utils.po
Paillat-dev Aug 6, 2025
fc2beaa
Merge branch 'refactor-utils' into viewless-components
Paillat-dev Aug 7, 2025
8a47e6a
Progress
Paillat-dev Aug 7, 2025
571a522
WIP
Paillat-dev Aug 7, 2025
8ae7503
WIP 2
Paillat-dev Aug 7, 2025
192f6b6
Some more work
Paillat-dev Aug 9, 2025
979b860
Wow so this is starting to look like something
Paillat-dev Aug 11, 2025
06dadcc
slurp
Paillat-dev Aug 17, 2025
c186317
IT WORKS
Paillat-dev Aug 17, 2025
d344b09
So many things
Paillat-dev Aug 17, 2025
dfb1dee
fix typing
Paillat-dev Aug 17, 2025
701cc66
del thing.py
Paillat-dev Aug 17, 2025
ff9ad33
:label: Typing stuff
Paillat-dev Aug 18, 2025
bfbd2b7
docs stuff and remove ext.pages from docs
Paillat-dev Aug 18, 2025
955e0d5
pages.old -> pages_old
Paillat-dev Aug 18, 2025
ae845f4
Make ruff happy
Paillat-dev Aug 18, 2025
341d73c
:memo: still docs stuff and some typing
Paillat-dev Aug 18, 2025
2eeafd2
:pencil2: Use relative imports
Paillat-dev Aug 18, 2025
ae22643
:memo: Update changelog
Paillat-dev Aug 18, 2025
581cea5
:memo: Add that pages was removed
Paillat-dev Aug 18, 2025
e260147
retrigger-ci
Paillat-dev Aug 19, 2025
c0869ae
:sparkles: add remove
Paillat-dev Aug 26, 2025
8ef7eb7
:memo: Docs stuff again
Paillat-dev Aug 26, 2025
11e311d
empty commit
Paillat-dev Aug 26, 2025
32ed673
Update discord/poll.py
Paillat-dev Aug 26, 2025
0df56df
Update discord/utils/private.py
Paillat-dev Aug 26, 2025
0c933ec
:memo: :label: Update typing to work better with docs
Paillat-dev Aug 27, 2025
98022d5
:sparkles: Add Modals support and phase 1 & 2 of "Modals v2", remove …
Paillat-dev Aug 27, 2025
1cdaa7e
:memo: Update docs
Paillat-dev Aug 27, 2025
b6775a5
:memo: `ModalComponent` -> `ModalComponentMixin`
Paillat-dev Aug 27, 2025
75c5cb3
:memo: Add `Modal` docstrings and fix some typings
Paillat-dev Aug 27, 2025
68031f4
Merge branch 'master' into viewless-components
Paillat-dev Aug 28, 2025
b71fd93
:memo: Fix component type in label.py docstring from `section` to `la…
Paillat-dev Aug 29, 2025
c9e4880
WIP
Paillat-dev Aug 29, 2025
e008f41
Somewhat typing
Paillat-dev Aug 29, 2025
015f604
Ok this works now
Paillat-dev Aug 29, 2025
d4bac3b
:truck: Rename Components to shorter and more efficient names
Paillat-dev Aug 29, 2025
278fc9d
:truck: Rename stuff for better namering
Paillat-dev Aug 30, 2025
cb5b0cd
Merge branch 'master' into refactor-utils
Paillat-dev Aug 31, 2025
51df432
:bug: Fix broken import after merge
Paillat-dev Aug 31, 2025
6ec99f2
:bug: Fix emojis.json path
Paillat-dev Aug 31, 2025
68a0fe3
:bug: Fix broken imports
Paillat-dev Aug 31, 2025
3dd1216
:art: Format stuff
Paillat-dev Aug 31, 2025
0d27afe
:bug: Fix import
Paillat-dev Sep 3, 2025
e202d7e
Merge branch 'master' into refactor-utils
Paillat-dev Sep 3, 2025
df659f4
Merge branch 'refactor-utils' into viewless-components
Paillat-dev Sep 4, 2025
f5bcb84
Merge branch 'master' into viewless-components
Paillat-dev Sep 4, 2025
14bf354
:art: Run ruff
Paillat-dev Sep 4, 2025
a402fcf
Merge branch 'master' into viewless-components
Paillat-dev Sep 4, 2025
43adf11
:rotating_light: Run ruff linter
Paillat-dev Sep 4, 2025
1384113
Merge branch 'master' into viewless-components
Paillat-dev Sep 5, 2025
550c68b
Merge branch 'master' into viewless-components
Paillat-dev Sep 5, 2025
8d0fa2a
Merge branch 'master' into viewless-components
Paillat-dev Sep 10, 2025
23c2632
:recycle: InteractionXyz -> PartialXyz
Paillat-dev Sep 10, 2025
33e93b0
Merge branch 'master' into viewless-components
Paillat-dev Sep 10, 2025
55e5af7
:fire: Actually remove pages entirely
Paillat-dev Sep 10, 2025
1331d76
Approximative component 19 implementation, make `StateComponent` a mi…
Paillat-dev Sep 17, 2025
b49227b
Merge branch 'master' into viewless-components
Paillat-dev Sep 17, 2025
97a7585
:memo: Changelog: move stuff around
Paillat-dev Sep 17, 2025
e6b47e0
Update discord/message.py
Paillat-dev Sep 18, 2025
15898dc
:sparkles: Add `ModalInteraction.attachments` with resolved attachmen…
Paillat-dev Oct 1, 2025
3c25abd
:memo: Fix imports in docs
Paillat-dev Oct 1, 2025
3fdd20b
:art: Format code
Paillat-dev Oct 1, 2025
aba0b38
Merge branch 'master' into viewless-components
Paillat-dev Oct 1, 2025
53dd07c
:rotating_light: Fix linter warnings
Paillat-dev Oct 1, 2025
88fc6ce
:recycle: Add examples, move types/components to types/component_type…
Paillat-dev Oct 4, 2025
7cca107
:rotating_light: Fix linter warnings and format code
Paillat-dev Oct 4, 2025
fe68835
:recycle: `WalkableComponent` -> `WalkableComponentMixin`
Paillat-dev Oct 6, 2025
5f2c416
:bug: Fix imports
Paillat-dev Oct 6, 2025
46aa671
:bug: Fix imports 2
Paillat-dev Oct 6, 2025
e09b9ee
:fix: Copilot suggest
Paillat-dev Oct 6, 2025
8bdcedd
:bug: Fix imports and env var name in examples
Paillat-dev Oct 6, 2025
dea292a
:bug: Fix `AllowedLabelComponents` typing
Paillat-dev Oct 6, 2025
19661cf
:bug: Fix `WalkableComponentMixin.__iter__`
Paillat-dev Oct 6, 2025
3f060c8
:fire: Remove `TextInputStyle` aliases
Paillat-dev Oct 6, 2025
28d9689
:recycle: Make `MediaGallery`'s items param a capture-all
Paillat-dev Oct 6, 2025
f814d86
:sparkles: Add simple_modal.py example
Paillat-dev Oct 6, 2025
d78132e
Merge branch 'master' into viewless-components
Paillat-dev Oct 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions CHANGELOG-V3.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ These changes are part of `pycord-test/pycord`, and are candidates for the next
release.

### Added
- `Interaction.components` available only during modal submissions

### Fixed

Expand All @@ -15,6 +16,18 @@ release.

### Removed


- `Interaction.original_message` use `Interaction.original_response` instead
- `Interaction.edit_original_message` use `Interaction.edit_original_response` instead
- `Interaction.delete_original_message` use `Interaction.delete_original_response`
instead
- `Interaction.premium_required` use a `Button` with type `ButtonType.premium` instead
- `Interaction.cached_channel` use `Interaction.channel` instead
- `Message.interaction` use `Message.interaction_metadata` instead
- `MessageInteraction` see `InteractionMetadata` instead

#### `discord.utils`

- `utils.filter_params`
- `utils.sleep_until` use `asyncio.sleep` combined with `datetime.datetime` instead
- `utils.compute_timedelta` use the `datetime` module instead
Expand All @@ -28,3 +41,24 @@ release.
- `AsyncIterator.get` use `AsyncIterator.find` with `lambda i: i.attr == val` instead
- `utils.as_chunks` use `itertools.batched` on Python 3.12+ or your own implementation
instead

#### `discord.ui`

Removed everything under `discord.ui`. Instead, use the new `discord.components` module
which provides a more flexible and powerful way to create interactive components. You
can read more in the migration guide.

<!-- TODO: Add link to migration guide -->

- `InputText` use `TextInput` instead
- `ComponentType.input_text` use `ComponentType.text_input` instead
- `InputTextStyle` use `TextInputStyle` instead
- `TextInputStyle.singleline` use `TextInputStyle.short` instead
- `TextInputStyle.multiline` and `TextInputStyle.long` use `TextInputStyle.paragraph` instead
- `ComponentType.select` use `ComponentType.string_select` instead

#### `discord.ext.pages`

Removed the `discord.ext.pages` module. Instead, use the new `discord.components` module
with your own pagination logic.

2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ These changes are available on the `master` branch, but have not yet been releas
([#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 `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
Expand Down
3 changes: 1 addition & 2 deletions discord/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# isort: on


from . import abc, opus, sinks, ui, utils
from . import abc, components, opus, sinks, utils
from .activity import *
from .appinfo import *
from .application_role_connection import *
Expand All @@ -38,7 +38,6 @@
from .collectibles import *
from .colour import *
from .commands import *
from .components import *
from .embeds import *
from .emoji import *
from .enums import *
Expand Down
47 changes: 21 additions & 26 deletions discord/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
import asyncio
import copy
import time
from collections.abc import Sequence
from typing import (
TYPE_CHECKING,
Any,
Callable,
Iterable,
Protocol,
Sequence,
TypeVar,
Union,
overload,
Expand Down Expand Up @@ -84,6 +84,7 @@
VoiceChannel,
)
from .client import Client
from .components import AnyComponent
from .embeds import Embed
from .enums import InviteTarget
from .guild import Guild
Expand All @@ -96,7 +97,6 @@
from .types.channel import GuildChannel as GuildChannelPayload
from .types.channel import OverwriteType
from .types.channel import PermissionOverwrite as PermissionOverwritePayload
from .ui.view import View
from .user import ClientUser

PartialMessageableChannel = TextChannel | VoiceChannel | StageChannel | Thread | DMChannel | PartialMessageable
Expand Down Expand Up @@ -1295,7 +1295,7 @@ async def send(
allowed_mentions: AllowedMentions = ...,
reference: Message | MessageReference | PartialMessage = ...,
mention_author: bool = ...,
view: View = ...,
components: Sequence[AnyComponent] = ...,
poll: Poll = ...,
suppress: bool = ...,
silent: bool = ...,
Expand All @@ -1316,7 +1316,7 @@ async def send(
allowed_mentions: AllowedMentions = ...,
reference: Message | MessageReference | PartialMessage = ...,
mention_author: bool = ...,
view: View = ...,
components: Sequence[AnyComponent] = ...,
poll: Poll = ...,
suppress: bool = ...,
silent: bool = ...,
Expand All @@ -1337,7 +1337,7 @@ async def send(
allowed_mentions: AllowedMentions = ...,
reference: Message | MessageReference | PartialMessage = ...,
mention_author: bool = ...,
view: View = ...,
components: Sequence[AnyComponent] = ...,
poll: Poll = ...,
suppress: bool = ...,
silent: bool = ...,
Expand All @@ -1358,7 +1358,7 @@ async def send(
allowed_mentions: AllowedMentions = ...,
reference: Message | MessageReference | PartialMessage = ...,
mention_author: bool = ...,
view: View = ...,
components: Sequence[AnyComponent] = ...,
poll: Poll = ...,
suppress: bool = ...,
silent: bool = ...,
Expand All @@ -1380,7 +1380,7 @@ async def send(
allowed_mentions=None,
reference=None,
mention_author=None,
view=None,
components=None,
poll=None,
suppress=None,
silent=None,
Expand Down Expand Up @@ -1449,8 +1449,10 @@ async def send(
If set, overrides the :attr:`~discord.AllowedMentions.replied_user` attribute of ``allowed_mentions``.

.. versionadded:: 1.6
view: :class:`discord.ui.View`
A Discord UI View to add to the message.
components: :class:`Sequence[AnyComponent]`
A sequence of components to add to the message.

.. versionadded:: 3.0
embeds: List[:class:`~discord.Embed`]
A list of embeds to upload. Must be a maximum of 10.

Expand Down Expand Up @@ -1541,17 +1543,15 @@ async def send(
"reference parameter must be Message, MessageReference, or PartialMessage"
) from None

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
if components is not None:
components_p = []
if components:
for c in components:
components_p.append(c.to_dict())
if c.any_is_v2():
flags.is_components_v2 = True
else:
components = None
components_p = None

if poll:
poll = poll.to_dict()
Expand Down Expand Up @@ -1584,7 +1584,7 @@ async def send(
allowed_mentions=allowed_mentions,
message_reference=_reference,
stickers=stickers,
components=components,
components=components_p,
flags=flags.value,
poll=poll,
)
Expand All @@ -1603,17 +1603,12 @@ async def send(
allowed_mentions=allowed_mentions,
message_reference=_reference,
stickers=stickers,
components=components,
components=components_p,
flags=flags.value,
poll=poll,
)

ret = state.create_message(channel=channel, data=data)
if view:
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
Loading