Skip to content

Commit

Permalink
Merge branch 'master' into refactor-utils-deprecated
Browse files Browse the repository at this point in the history
Signed-off-by: Paillat <[email protected]>
  • Loading branch information
Paillat-dev authored Jan 31, 2025
2 parents 2c0c82c + 19721e2 commit 208639d
Show file tree
Hide file tree
Showing 102 changed files with 4,991 additions and 4,503 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs-localization-download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
working-directory: ./docs
- name: "Crowdin"
id: crowdin
uses: crowdin/github-action@v2
uses: crowdin/github-action@v2.5.2
with:
upload_sources: false
upload_translations: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-localization-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
sphinx-intl update -p ./build/locales ${{ vars.SPHINX_LANGUAGES }}
working-directory: ./docs
- name: "Crowdin"
uses: crowdin/github-action@v2
uses: crowdin/github-action@v2.5.2
with:
upload_sources: true
upload_translations: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/todo-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: "Checkout Repository"
uses: actions/checkout@v4
- name: "Track TODO Action"
uses: ribtoks/[email protected].13-beta
uses: ribtoks/[email protected].14-beta
with:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
# - --remove-duplicate-keys
# - --remove-unused-variables
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
rev: v3.19.1
hooks:
- id: pyupgrade
exclude: \.(po|pot|yml|yaml)$
Expand Down
45 changes: 37 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,23 @@ These changes are available on the `master` branch, but have not yet been releas
([#2587](https://github.com/Pycord-Development/pycord/pull/2587/))
- Added optional `filter` parameter to `utils.basic_autocomplete()`.
([#2590](https://github.com/Pycord-Development/pycord/pull/2590))
- Added role tags: `subscription_listing_id`, `guild_connections`, and
`available_for_purchase`.
([#2606](https://github.com/Pycord-Development/pycord/pull/2606))
- Added missing `with_counts` parameter to `fetch_guilds` method.
([#2615](https://github.com/Pycord-Development/pycord/pull/2615))
- Added missing permissions: `Permissions.use_soundboard`,
`Permissions.use_external_sounds` and
- Added the following missing permissions: `Permissions.use_soundboard`,
`Permissions.use_external_sounds`, and
`Permissions.view_creator_monetization_analytics`.
([#2620](https://github.com/Pycord-Development/pycord/pull/2620))
- Added `MediaChannel` channel type.
([#2641](https://github.com/Pycord-Development/pycord/pull/2641))
- Added `Message._raw_data` attribute.
([#2670](https://github.com/Pycord-Development/pycord/pull/2670))
- Added helper methods to determine the authorizing party of an `Interaction`.
([#2659](https://github.com/Pycord-Development/pycord/pull/2659))
- Added `VoiceMessage` subclass of `File` to allow voice messages to be sent.
([#2579](https://github.com/Pycord-Development/pycord/pull/2579))

### Fixed

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

### Changed

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

### Deprecated

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

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

## [2.0.0-rc.1] - 2022-05-17
Expand Down
38 changes: 0 additions & 38 deletions discord/_typed_dict.py

This file was deleted.

2 changes: 1 addition & 1 deletion discord/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import warnings
from importlib.metadata import PackageNotFoundError, version

from ._typed_dict import TypedDict
from typing_extensions import TypedDict

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

Expand Down
40 changes: 11 additions & 29 deletions discord/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
from .context_managers import Typing
from .enums import ChannelType
from .errors import ClientException, InvalidArgument
from .file import File
from .flags import MessageFlags
from .file import File, VoiceMessage
from .flags import ChannelFlags, MessageFlags
from .invite import Invite
from .iterators import HistoryIterator
from .mentions import AllowedMentions
Expand Down Expand Up @@ -85,7 +85,6 @@
from .client import Client
from .embeds import Embed
from .enums import InviteTarget
from .flags import ChannelFlags
from .guild import Guild
from .member import Member
from .message import Message, MessageReference, PartialMessage
Expand Down Expand Up @@ -419,8 +418,7 @@ async def _edit(
pass

try:
if options.pop("require_tag"):
options["flags"] = ChannelFlags.require_tag.flag
options["flags"] = options.pop("flags").value
except KeyError:
pass

Expand Down Expand Up @@ -1569,7 +1567,7 @@ async def send(
flags = MessageFlags(
suppress_embeds=bool(suppress),
suppress_notifications=bool(silent),
).value
)

if stickers is not None:
stickers = [sticker.id for sticker in stickers]
Expand Down Expand Up @@ -1615,27 +1613,7 @@ async def send(
if file is not None:
if not isinstance(file, File):
raise InvalidArgument("file parameter must be File")

try:
data = await state.http.send_files(
channel.id,
files=[file],
allowed_mentions=allowed_mentions,
content=content,
tts=tts,
embed=embed,
embeds=embeds,
nonce=nonce,
enforce_nonce=enforce_nonce,
message_reference=reference,
stickers=stickers,
components=components,
flags=flags,
poll=poll,
)
finally:
file.close()

files = [file]
elif files is not None:
if len(files) > 10:
raise InvalidArgument(
Expand All @@ -1644,6 +1622,10 @@ async def send(
elif not all(isinstance(file, File) for file in files):
raise InvalidArgument("files parameter must be a list of File")

if files is not None:
flags = flags + MessageFlags(
is_voice_message=any(isinstance(f, VoiceMessage) for f in files)
)
try:
data = await state.http.send_files(
channel.id,
Expand All @@ -1658,7 +1640,7 @@ async def send(
message_reference=reference,
stickers=stickers,
components=components,
flags=flags,
flags=flags.value,
poll=poll,
)
finally:
Expand All @@ -1677,7 +1659,7 @@ async def send(
message_reference=reference,
stickers=stickers,
components=components,
flags=flags,
flags=flags.value,
poll=poll,
)

Expand Down
Loading

0 comments on commit 208639d

Please sign in to comment.