Skip to content

Commit 208639d

Browse files
authored
Merge branch 'master' into refactor-utils-deprecated
Signed-off-by: Paillat <[email protected]>
2 parents 2c0c82c + 19721e2 commit 208639d

File tree

102 files changed

+4991
-4503
lines changed

Some content is hidden

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

102 files changed

+4991
-4503
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.19.0
24+
rev: v3.19.1
2525
hooks:
2626
- id: pyupgrade
2727
exclude: \.(po|pot|yml|yaml)$

CHANGELOG.md

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +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))
3336
- Added missing `with_counts` parameter to `fetch_guilds` method.
3437
([#2615](https://github.com/Pycord-Development/pycord/pull/2615))
35-
- Added missing permissions: `Permissions.use_soundboard`,
36-
`Permissions.use_external_sounds` and
38+
- Added the following missing permissions: `Permissions.use_soundboard`,
39+
`Permissions.use_external_sounds`, and
3740
`Permissions.view_creator_monetization_analytics`.
3841
([#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))
3950

4051
### Fixed
4152

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

6693
### Changed
6794

@@ -75,6 +102,8 @@ These changes are available on the `master` branch, but have not yet been releas
75102
- Replaced audioop (deprecated module) implementation of `PCMVolumeTransformer.read`
76103
method with a pure Python equivalent.
77104
([#2176](https://github.com/Pycord-Development/pycord/pull/2176))
105+
- Updated `Guild.filesize_limit` to 10 MB instead of 25 MB following Discord's API
106+
changes. ([#2671](https://github.com/Pycord-Development/pycord/pull/2671))
78107

79108
### Deprecated
80109

@@ -388,7 +417,7 @@ These changes are available on the `master` branch, but have not yet been releas
388417
([#2075](https://github.com/Pycord-Development/pycord/pull/2075))
389418
- Fixed `before_invoke` not being run for `SlashCommandGroup`.
390419
([#2091](https://github.com/Pycord-Development/pycord/pull/2091))
391-
- Fixed `AttributeError` when accessing a `Select` object's values when it hasn't been
420+
- Fixed `AttributeError` when accessing a `Select` object's values when it has not been
392421
interacted with. ([#2104](https://github.com/Pycord-Development/pycord/pull/2104))
393422
- Fixed `before_invoke` being run twice for slash subcommands.
394423
([#2139](https://github.com/Pycord-Development/pycord/pull/2139))
@@ -419,7 +448,7 @@ These changes are available on the `master` branch, but have not yet been releas
419448
([#2196](https://github.com/Pycord-Development/pycord/pull/2196))
420449
- Fixed `AttributeError` when running permission checks without the `bot` scope.
421450
([#2113](https://github.com/Pycord-Development/pycord/issues/2113))
422-
- Fixed `Option` not working on bridge commands because `ext.commands.Command` doesn't
451+
- Fixed `Option` not working on bridge commands because `ext.commands.Command` does not
423452
recognize them. ([#2256](https://github.com/Pycord-Development/pycord/pull/2256))
424453
- Fixed offset-aware tasks causing `TypeError` when being prepared.
425454
([#2271](https://github.com/Pycord-Development/pycord/pull/2271))
@@ -519,7 +548,7 @@ These changes are available on the `master` branch, but have not yet been releas
519548
### Fixed
520549

521550
- Fixed bugs in `Page.update_files` where file objects stored in memory were causing an
522-
`AttributeError`, and `io.BytesIO` files didn't send properly more than once.
551+
`AttributeError`, and `io.BytesIO` files did not send properly more than once.
523552
([#1869](https://github.com/Pycord-Development/pycord/pull/1869) &
524553
[#1881](https://github.com/Pycord-Development/pycord/pull/1881))
525554
- Fixed bridge groups missing the `parent` attribute.
@@ -874,9 +903,9 @@ These changes are available on the `master` branch, but have not yet been releas
874903
([#1453](https://github.com/Pycord-Development/pycord/pull/1453))
875904
- Update `thread.members` on `thread.fetch_members`.
876905
([#1464](https://github.com/Pycord-Development/pycord/pull/1464))
877-
- Fix the error when Discord doesn't send the `app_permissions` data in `Interaction`.
906+
- Fix the error when Discord does not send the `app_permissions` data in `Interaction`.
878907
([#1467](https://github.com/Pycord-Development/pycord/pull/1467))
879-
- Fix AttributeError when voice client `play()` function isn't completed yet.
908+
- Fix AttributeError when voice client `play()` function is not completed yet.
880909
([#1360](https://github.com/Pycord-Development/pycord/pull/1360))
881910

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

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)