Skip to content

Commit 02375a5

Browse files
authored
Merge branch 'master' into feat/subscriptions
Signed-off-by: plun1331 <[email protected]>
2 parents f60cef1 + 19721e2 commit 02375a5

File tree

109 files changed

+5103
-4516
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+5103
-4516
lines changed

.github/workflows/docs-localization-download.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
working-directory: ./docs
4141
- name: "Crowdin"
4242
id: crowdin
43-
uses: crowdin/github-action@v2
43+
uses: crowdin/github-action@v2.5.2
4444
with:
4545
upload_sources: false
4646
upload_translations: false

.github/workflows/docs-localization-upload.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
sphinx-intl update -p ./build/locales ${{ vars.SPHINX_LANGUAGES }}
4545
working-directory: ./docs
4646
- name: "Crowdin"
47-
uses: crowdin/github-action@v2
47+
uses: crowdin/github-action@v2.5.2
4848
with:
4949
upload_sources: true
5050
upload_translations: false

.github/workflows/todo-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: "Checkout Repository"
2424
uses: actions/checkout@v4
2525
- name: "Track TODO Action"
26-
uses: ribtoks/[email protected].13-beta
26+
uses: ribtoks/[email protected].14-beta
2727
with:
2828
TOKEN: ${{ secrets.GITHUB_TOKEN }}
2929
REPO: ${{ github.repository }}

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ repos:
2121
# - --remove-duplicate-keys
2222
# - --remove-unused-variables
2323
- repo: https://github.com/asottile/pyupgrade
24-
rev: v3.18.0
24+
rev: v3.19.1
2525
hooks:
2626
- id: pyupgrade
2727
exclude: \.(po|pot|yml|yaml)$

CHANGELOG.md

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,23 @@ These changes are available on the `master` branch, but have not yet been releas
3030
([#2587](https://github.com/Pycord-Development/pycord/pull/2587/))
3131
- Added optional `filter` parameter to `utils.basic_autocomplete()`.
3232
([#2590](https://github.com/Pycord-Development/pycord/pull/2590))
33+
- Added role tags: `subscription_listing_id`, `guild_connections`, and
34+
`available_for_purchase`.
35+
([#2606](https://github.com/Pycord-Development/pycord/pull/2606))
36+
- Added missing `with_counts` parameter to `fetch_guilds` method.
37+
([#2615](https://github.com/Pycord-Development/pycord/pull/2615))
38+
- Added the following missing permissions: `Permissions.use_soundboard`,
39+
`Permissions.use_external_sounds`, and
40+
`Permissions.view_creator_monetization_analytics`.
41+
([#2620](https://github.com/Pycord-Development/pycord/pull/2620))
42+
- Added `MediaChannel` channel type.
43+
([#2641](https://github.com/Pycord-Development/pycord/pull/2641))
44+
- Added `Message._raw_data` attribute.
45+
([#2670](https://github.com/Pycord-Development/pycord/pull/2670))
46+
- Added helper methods to determine the authorizing party of an `Interaction`.
47+
([#2659](https://github.com/Pycord-Development/pycord/pull/2659))
48+
- Added `VoiceMessage` subclass of `File` to allow voice messages to be sent.
49+
([#2579](https://github.com/Pycord-Development/pycord/pull/2579))
3350
- Added new `Subscription` object and related methods/events.
3451
([#2564](https://github.com/Pycord-Development/pycord/pull/2564))
3552

@@ -50,6 +67,30 @@ These changes are available on the `master` branch, but have not yet been releas
5067
([#2595](https://github.com/Pycord-Development/pycord/pull/2595))
5168
- Fixed `BucketType.category` cooldown commands not functioning correctly in private
5269
channels. ([#2603](https://github.com/Pycord-Development/pycord/pull/2603))
70+
- Fixed `ctx` parameter of a `SlashCommand` not being `Union` type.
71+
([#2611](https://github.com/Pycord-Development/pycord/pull/2611))
72+
- Fixed `TypeError` when passing `skus` parameter in `Client.entitlements()`.
73+
([#2627](https://github.com/Pycord-Development/pycord/issues/2627))
74+
- Fixed `AttributeError` when sending polls with `PartialWebook`.
75+
([#2624](https://github.com/Pycord-Development/pycord/pull/2624))
76+
- Fixed editing `ForumChannel` flags not working.
77+
([#2641](https://github.com/Pycord-Development/pycord/pull/2641))
78+
- Fixed `AttributeError` when accessing `Member.guild_permissions` for user installed
79+
apps. ([#2650](https://github.com/Pycord-Development/pycord/pull/2650))
80+
- Fixed type annotations of cached properties.
81+
([#2635](https://github.com/Pycord-Development/pycord/issues/2635))
82+
- Fixed malformed properties in `Interaction.channel`.
83+
([#2658](https://github.com/Pycord-Development/pycord/pull/2658))
84+
- Fixed an error when responding non-ephemerally with a `Paginator` to an ephemerally
85+
deferred interaction.
86+
([#2661](https://github.com/Pycord-Development/pycord/pull/2661))
87+
- Fixed attachment metadata being set incorrectly in interaction responses causing the
88+
metadata to be ignored by Discord.
89+
([#2679](https://github.com/Pycord-Development/pycord/pull/2679))
90+
- Fixed unexpected backoff behavior in the handling of task failures
91+
([#2700](https://github.com/Pycord-Development/pycord/pull/2700)).
92+
- Fixed `BridgeCommand` duplicate in default help command.
93+
([#2656](https://github.com/Pycord-Development/pycord/pull/2656))
5394

5495
### Changed
5596

@@ -63,6 +104,8 @@ These changes are available on the `master` branch, but have not yet been releas
63104
- Replaced audioop (deprecated module) implementation of `PCMVolumeTransformer.read`
64105
method with a pure Python equivalent.
65106
([#2176](https://github.com/Pycord-Development/pycord/pull/2176))
107+
- Updated `Guild.filesize_limit` to 10 MB instead of 25 MB following Discord's API
108+
changes. ([#2671](https://github.com/Pycord-Development/pycord/pull/2671))
66109
- `Entitlement.ends_at` can now be `None`.
67110
([#2564](https://github.com/Pycord-Development/pycord/pull/2564))
68111

@@ -383,7 +426,7 @@ These changes are available on the `master` branch, but have not yet been releas
383426
([#2075](https://github.com/Pycord-Development/pycord/pull/2075))
384427
- Fixed `before_invoke` not being run for `SlashCommandGroup`.
385428
([#2091](https://github.com/Pycord-Development/pycord/pull/2091))
386-
- Fixed `AttributeError` when accessing a `Select` object's values when it hasn't been
429+
- Fixed `AttributeError` when accessing a `Select` object's values when it has not been
387430
interacted with. ([#2104](https://github.com/Pycord-Development/pycord/pull/2104))
388431
- Fixed `before_invoke` being run twice for slash subcommands.
389432
([#2139](https://github.com/Pycord-Development/pycord/pull/2139))
@@ -414,7 +457,7 @@ These changes are available on the `master` branch, but have not yet been releas
414457
([#2196](https://github.com/Pycord-Development/pycord/pull/2196))
415458
- Fixed `AttributeError` when running permission checks without the `bot` scope.
416459
([#2113](https://github.com/Pycord-Development/pycord/issues/2113))
417-
- Fixed `Option` not working on bridge commands because `ext.commands.Command` doesn't
460+
- Fixed `Option` not working on bridge commands because `ext.commands.Command` does not
418461
recognize them. ([#2256](https://github.com/Pycord-Development/pycord/pull/2256))
419462
- Fixed offset-aware tasks causing `TypeError` when being prepared.
420463
([#2271](https://github.com/Pycord-Development/pycord/pull/2271))
@@ -514,7 +557,7 @@ These changes are available on the `master` branch, but have not yet been releas
514557
### Fixed
515558

516559
- Fixed bugs in `Page.update_files` where file objects stored in memory were causing an
517-
`AttributeError`, and `io.BytesIO` files didn't send properly more than once.
560+
`AttributeError`, and `io.BytesIO` files did not send properly more than once.
518561
([#1869](https://github.com/Pycord-Development/pycord/pull/1869) &
519562
[#1881](https://github.com/Pycord-Development/pycord/pull/1881))
520563
- Fixed bridge groups missing the `parent` attribute.
@@ -869,9 +912,9 @@ These changes are available on the `master` branch, but have not yet been releas
869912
([#1453](https://github.com/Pycord-Development/pycord/pull/1453))
870913
- Update `thread.members` on `thread.fetch_members`.
871914
([#1464](https://github.com/Pycord-Development/pycord/pull/1464))
872-
- Fix the error when Discord doesn't send the `app_permissions` data in `Interaction`.
915+
- Fix the error when Discord does not send the `app_permissions` data in `Interaction`.
873916
([#1467](https://github.com/Pycord-Development/pycord/pull/1467))
874-
- Fix AttributeError when voice client `play()` function isn't completed yet.
917+
- Fix AttributeError when voice client `play()` function is not completed yet.
875918
([#1360](https://github.com/Pycord-Development/pycord/pull/1360))
876919

877920
## [2.0.0-rc.1] - 2022-05-17

README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ Pycord is a modern, easy to use, feature-rich, and async ready API wrapper for D
2828

2929
======
3030

31+
Note
32+
----
33+
34+
Pycord supports Python ``3.9`` - ``3.12``
35+
3136
Key Features
3237
------------
3338

discord/_typed_dict.py

Lines changed: 0 additions & 38 deletions
This file was deleted.

discord/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import warnings
3131
from importlib.metadata import PackageNotFoundError, version
3232

33-
from ._typed_dict import TypedDict
33+
from typing_extensions import TypedDict
3434

3535
__all__ = ("__version__", "VersionInfo", "version_info")
3636

discord/abc.py

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
from .context_managers import Typing
4646
from .enums import ChannelType
4747
from .errors import ClientException, InvalidArgument
48-
from .file import File
49-
from .flags import MessageFlags
48+
from .file import File, VoiceMessage
49+
from .flags import ChannelFlags, MessageFlags
5050
from .invite import Invite
5151
from .iterators import HistoryIterator
5252
from .mentions import AllowedMentions
@@ -85,7 +85,6 @@
8585
from .client import Client
8686
from .embeds import Embed
8787
from .enums import InviteTarget
88-
from .flags import ChannelFlags
8988
from .guild import Guild
9089
from .member import Member
9190
from .message import Message, MessageReference, PartialMessage
@@ -419,8 +418,7 @@ async def _edit(
419418
pass
420419

421420
try:
422-
if options.pop("require_tag"):
423-
options["flags"] = ChannelFlags.require_tag.flag
421+
options["flags"] = options.pop("flags").value
424422
except KeyError:
425423
pass
426424

@@ -1569,7 +1567,7 @@ async def send(
15691567
flags = MessageFlags(
15701568
suppress_embeds=bool(suppress),
15711569
suppress_notifications=bool(silent),
1572-
).value
1570+
)
15731571

15741572
if stickers is not None:
15751573
stickers = [sticker.id for sticker in stickers]
@@ -1615,27 +1613,7 @@ async def send(
16151613
if file is not None:
16161614
if not isinstance(file, File):
16171615
raise InvalidArgument("file parameter must be File")
1618-
1619-
try:
1620-
data = await state.http.send_files(
1621-
channel.id,
1622-
files=[file],
1623-
allowed_mentions=allowed_mentions,
1624-
content=content,
1625-
tts=tts,
1626-
embed=embed,
1627-
embeds=embeds,
1628-
nonce=nonce,
1629-
enforce_nonce=enforce_nonce,
1630-
message_reference=reference,
1631-
stickers=stickers,
1632-
components=components,
1633-
flags=flags,
1634-
poll=poll,
1635-
)
1636-
finally:
1637-
file.close()
1638-
1616+
files = [file]
16391617
elif files is not None:
16401618
if len(files) > 10:
16411619
raise InvalidArgument(
@@ -1644,6 +1622,10 @@ async def send(
16441622
elif not all(isinstance(file, File) for file in files):
16451623
raise InvalidArgument("files parameter must be a list of File")
16461624

1625+
if files is not None:
1626+
flags = flags + MessageFlags(
1627+
is_voice_message=any(isinstance(f, VoiceMessage) for f in files)
1628+
)
16471629
try:
16481630
data = await state.http.send_files(
16491631
channel.id,
@@ -1658,7 +1640,7 @@ async def send(
16581640
message_reference=reference,
16591641
stickers=stickers,
16601642
components=components,
1661-
flags=flags,
1643+
flags=flags.value,
16621644
poll=poll,
16631645
)
16641646
finally:
@@ -1677,7 +1659,7 @@ async def send(
16771659
message_reference=reference,
16781660
stickers=stickers,
16791661
components=components,
1680-
flags=flags,
1662+
flags=flags.value,
16811663
poll=poll,
16821664
)
16831665

0 commit comments

Comments
 (0)