Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating with master #10

Closed
wants to merge 112 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
2731d21
chore(bridge): use BridgeOption instead of Option (#2252)
Middledot Jan 25, 2024
60097c5
fix: initialize group copies with right arguments (#2331)
Dorukyum Jan 25, 2024
f0c33dd
fix: slash options broken when declared explicitly (#2332)
plun1331 Jan 28, 2024
5d2ec72
fix: setting options using default syntax makes option optional (#2333)
plun1331 Jan 28, 2024
7192260
fix: skip BridgeContext when parsing options (#2337)
Dorukyum Jan 29, 2024
7f9dec2
chore(deps-dev): update pytest requirement from ~=7.4.4 to ~=8.0.0 (#…
dependabot[bot] Jan 30, 2024
73ef733
fix: add accurate type hints to `HistoryIterator` (#2340)
honzajavorek Jan 30, 2024
bdf604d
feat: implement Avatar Decorations (#2131)
NeloBlivion Jan 31, 2024
90f9023
feat: Implement Attachmentflags and Attachment expiry attributes (#2342)
NeloBlivion Jan 31, 2024
6ba54b4
feat: implement onboarding features (#2127)
NeloBlivion Jan 31, 2024
98d6018
feat: implement monetization (#2273)
plun1331 Feb 1, 2024
7555fc2
fix: `(Sync)WebhookMessage._thread_id` could be `None` (#2343)
Dorukyum Feb 1, 2024
9683629
chore: clean up changelog (#2341)
Dorukyum Feb 1, 2024
741851b
fix: add `entitlements` to slots of `Interaction` (#2345)
Dorukyum Feb 1, 2024
e9efa2c
docs: fix incorrect documentation about `discord.Option.autocomplete`…
Blue-Robin-Taken Feb 2, 2024
33cbe88
fix: add missing kwargs to TextChannel.create_thread and similar meth…
NeloBlivion Feb 3, 2024
cc0cf1a
fix: Improve Thread.members Reliability (#2351)
Icebluewolf Feb 5, 2024
7d03c49
chore(stonks): improve pycord (#2347)
ShackledMars261 Feb 5, 2024
8a7ea47
Revert "chore(stonks): improve pycord" (#2352)
Lulalaby Feb 5, 2024
e07d0d9
chore(pre-commit): pre-commit autoupdate (#2336)
pre-commit-ci[bot] Feb 19, 2024
845f7c7
chore(pre-commit): pre-commit autoupdate (#2361)
pre-commit-ci[bot] Feb 19, 2024
d5ed476
chore(deps-dev): update pytest requirement from ~=8.0.0 to ~=8.0.1 (#…
dependabot[bot] Feb 21, 2024
4f949a8
chore(deps-dev): update pylint requirement from ~=3.0.3 to ~=3.0.4 (#…
dependabot[bot] Feb 23, 2024
52d7719
fix: type hint kwargs properly (#2364)
Dorukyum Feb 26, 2024
b478e5b
chore(deps-dev): update pytest requirement from ~=8.0.1 to ~=8.0.2 (#…
dependabot[bot] Feb 28, 2024
8984b86
chore(deps-dev): update pylint requirement from ~=3.0.4 to ~=3.1.0 (#…
dependabot[bot] Feb 28, 2024
2276914
fix: fixes enum to support stringified annotations (#2367)
jab416171 Feb 28, 2024
76a3e4c
feat: implement voice channel statuses (#2368)
Icebluewolf Feb 28, 2024
752a38c
feat: Message.enforce_nonce (#2370)
Dorukyum Feb 28, 2024
be87ae7
feat: audit logs for voice channel status (#2373)
Dorukyum Mar 2, 2024
d06b72c
add missing docs for voice channel status audit log (#2374)
Lulalaby Mar 2, 2024
a86145f
fix: correct `enforce_nonce` implementation (#2376)
Lulalaby Mar 2, 2024
35bb80e
chore: bump changelog version (#2375)
Lulalaby Mar 2, 2024
87d2331
chore(deps): use furo from pypi (#2377)
Lulalaby Mar 2, 2024
9b1c86c
feat: Change type of `Guild.bitrate_limit` to `int`. (#2387)
yoggys Mar 8, 2024
d6693d3
fix: Proper type-hinting & docstring of `Member.move_to` and `Member…
yoggys Mar 8, 2024
d4d3d20
chore(deps-dev): bump bandit from 1.7.7 to 1.7.8 (#2388)
dependabot[bot] Mar 9, 2024
7c06892
chore(deps-dev): update mypy requirement from ~=1.8.0 to ~=1.9.0 (#2389)
dependabot[bot] Mar 9, 2024
0c68e5f
fix: Replace deprecated pkg_resources with importlib.metadata to clea…
Revnoplex Mar 17, 2024
530f3d4
feat: add `banner` to `ClientUser.edit` (#2396)
Braandn Mar 17, 2024
bfe7827
chore(pre-commit): pre-commit autoupdate (#2398)
pre-commit-ci[bot] Mar 19, 2024
ca07054
chore(deps-dev): update pytest requirement from ~=8.0.2 to ~=8.1.1 (#…
dependabot[bot] Mar 19, 2024
43a9ee7
fix: add user argument to paginator.edit (#2390)
NeloBlivion Mar 19, 2024
6f1ad85
docs: fix typo (#2401)
JustaSqu1d Mar 20, 2024
7a6fcda
fix: NameError in interaction edge cases (#2402)
NeloBlivion Mar 21, 2024
532db98
feat: retry http requests that fail with a 503 status (#2395)
D4rk-S0ul Mar 22, 2024
a29bc14
fix: type-hinting in ScheduledEvent.subscribers (#2400)
yoggys Mar 22, 2024
548ca85
fix: TypeError when `ScheduledEvent.subscribers` limit is None (#2407)
yoggys Mar 23, 2024
ac7c341
feat: add once kwarg to Cog.listener (#2403)
NeloBlivion Mar 24, 2024
fbd9d7e
chore(pre-commit): pre-commit autoupdate (#2410)
pre-commit-ci[bot] Mar 26, 2024
8cec636
fix: pass proper state to interaction._guild (#2411)
NeloBlivion Mar 30, 2024
bb61cf7
fix: option and BridgeOption adjustments (#2417)
NeloBlivion Apr 9, 2024
59b9b32
chore(pre-commit): pre-commit autoupdate (#2416)
pre-commit-ci[bot] Apr 9, 2024
90d27c5
feat: implement Guild.search_members (#2418)
NeloBlivion Apr 12, 2024
2df4ac9
ci(deps): bump ribtoks/tdg-github-action from 0.4.7.pre.beta to 0.4.1…
dependabot[bot] Apr 12, 2024
c10022c
fix: Added member data to the raw_reaction_remove event (#2412)
jordan-day Apr 15, 2024
7a7f364
chore(pre-commit): pre-commit autoupdate (#2422)
pre-commit-ci[bot] Apr 16, 2024
929e15e
docs: remove false optional (#2424)
Dorukyum Apr 16, 2024
f5683c5
fix: Guild.query_members may accept empty query and limit (#2419)
NeloBlivion Apr 16, 2024
fe0a5f4
fix(actions): fallback to macos-13 in test suite for python 3.8 & 3.9…
Lulalaby Apr 25, 2024
65d9aaf
chore(deps-dev): update mypy requirement from ~=1.9.0 to ~=1.10.0 (#2…
dependabot[bot] Apr 25, 2024
c12670a
chore(deps-dev): update coverage requirement from ~=7.4 to ~=7.5 (#2432)
dependabot[bot] Apr 25, 2024
0536899
fix: Raise WebSocketClosure on protocol level errors (#2435)
Jegarde Apr 26, 2024
a1439ba
feat: Support bulk banning in guilds (#2421)
NeloBlivion Apr 26, 2024
1f7225f
fix: type-hinting in Guild.bulk_ban (#2440)
yoggys Apr 26, 2024
3734bb4
chore(deps-dev): update pytest requirement from ~=8.1.1 to ~=8.1.2 (#…
dependabot[bot] Apr 26, 2024
c3a5f1e
chore(deps-dev): update pytest requirement from ~=8.1.2 to ~=8.2.0 (#…
dependabot[bot] Apr 30, 2024
2cc5502
chore(pre-commit): pre-commit autoupdate (#2441)
pre-commit-ci[bot] Apr 30, 2024
08370b5
fix: AttributeError using PartialMessage.edit(embed=None) (#2446)
Readeem May 7, 2024
6c990b9
fix(ext-pages): revert paginator on callback fail (#2448)
BobDotCom May 10, 2024
ea8a6fe
fix: remove module-level deprecation warn (#2450)
BobDotCom May 13, 2024
f78caa4
chore(deps-dev): update pylint requirement from ~=3.1.0 to ~=3.1.1 (#…
dependabot[bot] May 13, 2024
e7e0146
chore(deps-dev): update pylint requirement from ~=3.1.1 to ~=3.2.0 (#…
dependabot[bot] May 15, 2024
d0b9f5e
fix: missing `application_id` in `Entitlement.delete` (#2458)
yoggys May 19, 2024
a173a76
chore(deps-dev): update pytest requirement from ~=8.2.0 to ~=8.2.1 (#…
dependabot[bot] May 24, 2024
2c4ef46
chore(deps-dev): bump codespell from 2.2.6 to 2.3.0 (#2461)
dependabot[bot] May 24, 2024
9fc3d7b
chore(deps-dev): update pylint requirement from ~=3.2.0 to ~=3.2.2 (#…
dependabot[bot] May 24, 2024
61cc544
fix: overall type-hinting improvements (#2457)
yoggys Jun 5, 2024
e33fdb9
chore(deps-dev): update pylint requirement from ~=3.2.2 to ~=3.2.3 (#…
dependabot[bot] Jun 7, 2024
540e064
chore(deps-dev): update pytest requirement from ~=8.2.1 to ~=8.2.2 (#…
dependabot[bot] Jun 7, 2024
f015bc4
chore(pre-commit): pre-commit autoupdate (#2471)
pre-commit-ci[bot] Jun 14, 2024
58a329f
chore(deps-dev): bump bandit from 1.7.8 to 1.7.9 (#2472)
dependabot[bot] Jun 14, 2024
cd9ca50
feat: Polls (#2408)
NeloBlivion Jun 15, 2024
58bd10f
fix: wrong var name (#2475)
Lulalaby Jun 16, 2024
731fd02
ci(deps): bump ribtoks/tdg-github-action from 0.4.10.pre.beta to 0.4.…
dependabot[bot] Jun 16, 2024
9ab4bd6
chore(deps-dev): bump flake8 from 7.0.0 to 7.1.0 (#2476)
dependabot[bot] Jun 18, 2024
284d40c
fix: options initializing with null input type (#2464)
nexy7574 Jun 23, 2024
59b919f
feat: user-installable apps (#2409)
plun1331 Jun 25, 2024
a4b44ca
chore(deps-dev): update mypy requirement from ~=1.10.0 to ~=1.10.1 (#…
dependabot[bot] Jun 26, 2024
7ae3928
chore(deps-dev): update pylint requirement from ~=3.2.3 to ~=3.2.4 (#…
dependabot[bot] Jun 27, 2024
e65c717
docs: limits on integer and number option types (#2462)
JustaSqu1d Jun 28, 2024
abef1ce
feat: update monetization (#2438)
plun1331 Jun 29, 2024
a344a50
fix: always cast PartialMessage(able) IDs to int (#2406)
NeloBlivion Jun 30, 2024
267a644
feat: add Attachment.title (#2486)
NeloBlivion Jun 30, 2024
de117fe
feat: implement MemberFlags (#2489)
NeloBlivion Jun 30, 2024
af87860
feat: implement RoleFlags (#2487)
NeloBlivion Jul 1, 2024
99b40e2
fix: enum option issues (#2463)
NeloBlivion Jul 1, 2024
02e9d96
feat: implement MessageCall (#2488)
NeloBlivion Jul 1, 2024
6bc8309
chore(deps-dev): update pylint requirement from ~=3.2.4 to ~=3.2.5 (#…
dependabot[bot] Jul 1, 2024
109a294
fix: remove_application_command missing case (#2480)
Dorukyum Jul 1, 2024
ec3cf16
fix: premium buttons and entitlement iterator (#2490)
tibue99 Jul 3, 2024
d1702cf
fix: update audit log filtering & sorting (#2371)
Lulalaby Jul 5, 2024
73e4e37
chore: remove `vanity_code` from `Guild.edit` (#2491)
Dorukyum Jul 7, 2024
e25527f
fix: further address audit log issues (#2492)
NeloBlivion Jul 8, 2024
63da813
chore: improve nesting error message (#2275)
Dorukyum Jul 8, 2024
81dfa98
docs: add missing attributes to UserCommand and MessageCommand (#2494)
Icebluewolf Jul 8, 2024
77c9ff9
chore: update readme and changelog (#2493)
Dorukyum Jul 9, 2024
ed1f73c
docs: add docs for Interaction.entitlements (#2495)
plun1331 Jul 10, 2024
c342e92
fix: Rename 'cover' to 'image' in relation to ScheduledEvent (#2496)
Icebluewolf Jul 12, 2024
7b617da
chore(deps-dev): update coverage requirement from ~=7.5 to ~=7.6 (#2497)
dependabot[bot] Jul 12, 2024
87ff7af
fix: inverted type hints in `CheckAnyFailure` (#2502)
Paillat-dev Jul 19, 2024
5ad95dc
chore(deps-dev): update mypy requirement from ~=1.10.1 to ~=1.11.0 (#…
dependabot[bot] Jul 20, 2024
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
9 changes: 9 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
# Python 3.8/3.9 are on macos-13 but not macos-latest (macos-14-arm64)
# https://github.com/actions/setup-python/issues/696#issuecomment-1637587760
exclude:
- { python-version: "3.8", os: "macos-latest" }
- { python-version: "3.9", os: "macos-latest" }
include:
- { python-version: "3.8", os: "macos-13" }
- { python-version: "3.9", os: "macos-13" }

env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Run tdg-github-action
uses: ribtoks/tdg-github-action@v0.4.7-beta
uses: ribtoks/tdg-github-action@v0.4.11-beta
with:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/PyCQA/autoflake
rev: v2.2.1
rev: v2.3.1
hooks:
- id: autoflake
# args:
Expand All @@ -19,7 +19,7 @@ repos:
# - --remove-duplicate-keys
# - --remove-unused-variables
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.16.0
hooks:
- id: pyupgrade
args: [--py38-plus]
Expand All @@ -28,7 +28,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.4.2
hooks:
- id: black
args: [--safe, --quiet]
Expand Down
245 changes: 199 additions & 46 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Key Features
- Modern Pythonic API using ``async`` and ``await``.
- Proper rate limit handling.
- Optimised for both speed and memory usage.
- Full Application Command Support
- Full application API support.

Installing
----------
Expand Down
3 changes: 3 additions & 0 deletions discord/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,13 @@
from .member import *
from .mentions import *
from .message import *
from .monetization import *
from .object import *
from .onboarding import *
from .partial_emoji import *
from .permissions import *
from .player import *
from .poll import *
from .raw_models import *
from .reaction import *
from .role import *
Expand Down
8 changes: 4 additions & 4 deletions discord/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
"""

import argparse
import importlib.metadata
import platform
import sys
from pathlib import Path
from typing import Tuple

import aiohttp
import pkg_resources

import discord

Expand All @@ -47,9 +47,9 @@ def show_version() -> None:
"- py-cord v{0.major}.{0.minor}.{0.micro}-{0.releaselevel}".format(version_info)
)
if version_info.releaselevel != "final":
pkg = pkg_resources.get_distribution("py-cord")
if pkg:
entries.append(f" - py-cord pkg_resources: v{pkg.version}")
version = importlib.metadata.version("py-cord")
if version:
entries.append(f" - py-cord importlib.metadata: v{version}")

entries.append(f"- aiohttp v{aiohttp.__version__}")
uname = platform.uname()
Expand Down
1 change: 1 addition & 0 deletions discord/_typed_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""

import sys

# PEP 655 Required and NotRequired were added in python 3.11. This file is simply a
Expand Down
1 change: 1 addition & 0 deletions discord/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""

from __future__ import annotations

import datetime
Expand Down
79 changes: 48 additions & 31 deletions discord/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
from .guild import Guild
from .member import Member
from .message import Message, MessageReference, PartialMessage
from .poll import Poll
from .state import ConnectionState
from .threads import Thread
from .types.channel import Channel as ChannelPayload
Expand All @@ -115,7 +116,7 @@ async def _single_delete_strategy(


async def _purge_messages_helper(
channel: TextChannel | Thread | VoiceChannel,
channel: TextChannel | StageChannel | Thread | VoiceChannel,
*,
limit: int | None = 100,
check: Callable[[Message], bool] = MISSING,
Expand Down Expand Up @@ -341,8 +342,7 @@ class GuildChannel:

def __init__(
self, *, state: ConnectionState, guild: Guild, data: dict[str, Any]
):
...
): ...

def __str__(self) -> str:
return self.name
Expand Down Expand Up @@ -526,9 +526,9 @@ async def _edit(
"default_reaction_emoji must be of type: Emoji | int | str"
)

options[
"default_reaction_emoji"
] = default_reaction_emoji._to_forum_reaction_payload()
options["default_reaction_emoji"] = (
default_reaction_emoji._to_forum_reaction_payload()
)

if options:
return await self._state.http.edit_channel(
Expand Down Expand Up @@ -853,8 +853,7 @@ async def set_permissions(
*,
overwrite: PermissionOverwrite | None = ...,
reason: str | None = ...,
) -> None:
...
) -> None: ...

@overload
async def set_permissions(
Expand All @@ -863,8 +862,7 @@ async def set_permissions(
*,
reason: str | None = ...,
**permissions: bool,
) -> None:
...
) -> None: ...

async def set_permissions(
self, target, *, overwrite=MISSING, reason=None, **permissions
Expand Down Expand Up @@ -1033,8 +1031,7 @@ async def move(
category: Snowflake | None = MISSING,
sync_permissions: bool = MISSING,
reason: str | None = MISSING,
) -> None:
...
) -> None: ...

@overload
async def move(
Expand All @@ -1045,8 +1042,7 @@ async def move(
category: Snowflake | None = MISSING,
sync_permissions: bool = MISSING,
reason: str = MISSING,
) -> None:
...
) -> None: ...

@overload
async def move(
Expand All @@ -1057,8 +1053,7 @@ async def move(
category: Snowflake | None = MISSING,
sync_permissions: bool = MISSING,
reason: str = MISSING,
) -> None:
...
) -> None: ...

@overload
async def move(
Expand All @@ -1069,8 +1064,7 @@ async def move(
category: Snowflake | None = MISSING,
sync_permissions: bool = MISSING,
reason: str = MISSING,
) -> None:
...
) -> None: ...

async def move(self, **kwargs) -> None:
"""|coro|
Expand Down Expand Up @@ -1352,15 +1346,16 @@ async def send(
file: File = ...,
stickers: Sequence[GuildSticker | StickerItem] = ...,
delete_after: float = ...,
nonce: str | int = ...,
nonce: int | str = ...,
enforce_nonce: bool = ...,
allowed_mentions: AllowedMentions = ...,
reference: Message | MessageReference | PartialMessage = ...,
mention_author: bool = ...,
view: View = ...,
poll: Poll = ...,
suppress: bool = ...,
silent: bool = ...,
) -> Message:
...
) -> Message: ...

@overload
async def send(
Expand All @@ -1372,15 +1367,16 @@ async def send(
files: list[File] = ...,
stickers: Sequence[GuildSticker | StickerItem] = ...,
delete_after: float = ...,
nonce: str | int = ...,
nonce: int | str = ...,
enforce_nonce: bool = ...,
allowed_mentions: AllowedMentions = ...,
reference: Message | MessageReference | PartialMessage = ...,
mention_author: bool = ...,
view: View = ...,
poll: Poll = ...,
suppress: bool = ...,
silent: bool = ...,
) -> Message:
...
) -> Message: ...

@overload
async def send(
Expand All @@ -1392,15 +1388,16 @@ async def send(
file: File = ...,
stickers: Sequence[GuildSticker | StickerItem] = ...,
delete_after: float = ...,
nonce: str | int = ...,
nonce: int | str = ...,
enforce_nonce: bool = ...,
allowed_mentions: AllowedMentions = ...,
reference: Message | MessageReference | PartialMessage = ...,
mention_author: bool = ...,
view: View = ...,
poll: Poll = ...,
suppress: bool = ...,
silent: bool = ...,
) -> Message:
...
) -> Message: ...

@overload
async def send(
Expand All @@ -1412,15 +1409,16 @@ async def send(
files: list[File] = ...,
stickers: Sequence[GuildSticker | StickerItem] = ...,
delete_after: float = ...,
nonce: str | int = ...,
nonce: int | str = ...,
enforce_nonce: bool = ...,
allowed_mentions: AllowedMentions = ...,
reference: Message | MessageReference | PartialMessage = ...,
mention_author: bool = ...,
view: View = ...,
poll: Poll = ...,
suppress: bool = ...,
silent: bool = ...,
) -> Message:
...
) -> Message: ...

async def send(
self,
Expand All @@ -1434,10 +1432,12 @@ async def send(
stickers=None,
delete_after=None,
nonce=None,
enforce_nonce=None,
allowed_mentions=None,
reference=None,
mention_author=None,
view=None,
poll=None,
suppress=None,
silent=None,
):
Expand Down Expand Up @@ -1471,9 +1471,13 @@ async def send(
The file to upload.
files: List[:class:`~discord.File`]
A list of files to upload. Must be a maximum of 10.
nonce: :class:`int`
nonce: Union[:class:`str`, :class:`int`]
The nonce to use for sending this message. If the message was successfully sent,
then the message will have a nonce with this value.
enforce_nonce: Optional[:class:`bool`]
Whether :attr:`nonce` is enforced to be validated.

.. versionadded:: 2.5
delete_after: :class:`float`
If provided, the number of seconds to wait in the background
before deleting the message we just sent. If the deletion fails,
Expand Down Expand Up @@ -1517,6 +1521,10 @@ async def send(
Whether to suppress push and desktop notifications for the message.

.. versionadded:: 2.4
poll: :class:`Poll`
The poll to send.

.. versionadded:: 2.6

Returns
-------
Expand Down Expand Up @@ -1596,6 +1604,9 @@ async def send(
else:
components = None

if poll:
poll = poll.to_dict()

if file is not None and files is not None:
raise InvalidArgument("cannot pass both file and files parameter to send()")

Expand All @@ -1613,10 +1624,12 @@ async def send(
embed=embed,
embeds=embeds,
nonce=nonce,
enforce_nonce=enforce_nonce,
message_reference=reference,
stickers=stickers,
components=components,
flags=flags,
poll=poll,
)
finally:
file.close()
Expand All @@ -1638,11 +1651,13 @@ async def send(
embed=embed,
embeds=embeds,
nonce=nonce,
enforce_nonce=enforce_nonce,
allowed_mentions=allowed_mentions,
message_reference=reference,
stickers=stickers,
components=components,
flags=flags,
poll=poll,
)
finally:
for f in files:
Expand All @@ -1655,11 +1670,13 @@ async def send(
embed=embed,
embeds=embeds,
nonce=nonce,
enforce_nonce=enforce_nonce,
allowed_mentions=allowed_mentions,
message_reference=reference,
stickers=stickers,
components=components,
flags=flags,
poll=poll,
)

ret = state.create_message(channel=channel, data=data)
Expand Down
Loading
Loading