Skip to content

Commit 37be456

Browse files
committed
Merge branch 'master' into v2.x
2 parents f00bf5f + 95fd465 commit 37be456

Some content is hidden

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

99 files changed

+2815
-953
lines changed

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ body:
1818
- discord.ext.commands
1919
- discord.ext.tasks
2020
- discord.ext.pages
21+
- discord.ext.bridge
2122
- The documentation
2223
validations:
2324
required: true

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@
22

33
<!-- What is this pull request for? Does it fix any issues? -->
44

5-
## Checklist
5+
## Information
66

77
<!-- Put an x inside [ ] to check it, like so: [x] -->
88

9-
- [ ] If code changes were made then they have been tested.
10-
- [ ] I have updated the documentation to reflect the changes.
11-
- [ ] If `type: ignore` comments were used, a comment is also left explaining why
129
- [ ] This PR fixes an issue.
1310
- [ ] This PR adds something new (e.g. new method or parameters).
14-
- [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed)
15-
- [ ] This PR is **not** a code change (e.g. documentation, README, typehinting, examples, ...)
11+
- [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed).
12+
- [ ] This PR is **not** a code change (e.g. documentation, README, typehinting, examples, ...).
13+
14+
## Checklist
15+
16+
<!-- Put an x inside [ ] to check it, like so: [x] -->
17+
18+
- [ ] I have searched the open pull requests for duplicates.
19+
- [ ] If code changes were made then they have been tested.
20+
- [ ] I have updated the documentation to reflect the changes.
21+
- [ ] If `type: ignore` comments were used, a comment is also left explaining why.

discord/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
__author__ = "Pycord Development"
1414
__license__ = "MIT"
1515
__copyright__ = "Copyright 2015-2021 Rapptz & Copyright 2021-present Pycord Development"
16-
__version__ = "2.0.0rc1"
16+
__version__ = "2.0.0"
1717

1818
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1919

@@ -75,6 +75,6 @@ class VersionInfo(NamedTuple):
7575
serial: int
7676

7777

78-
version_info: VersionInfo = VersionInfo(major=2, minor=0, micro=0, releaselevel="candidate", serial=1)
78+
version_info: VersionInfo = VersionInfo(major=2, minor=0, micro=0, releaselevel="final", serial=0)
7979

8080
logging.getLogger(__name__).addHandler(logging.NullHandler())

discord/abc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,6 +1534,7 @@ async def send(
15341534
ret = state.create_message(channel=channel, data=data)
15351535
if view:
15361536
state.store_view(view, ret.id)
1537+
view.message = ret
15371538

15381539
if delete_after is not None:
15391540
await ret.delete(delay=delete_after)

discord/activity.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@
7878
buttons: list[dict]
7979
label: str (max: 32)
8080
url: str (max: 512)
81+
NOTE: Bots cannot access a user's activity button URLs. When received through the
82+
gateway, the type of the buttons field will be list[str].
8183
8284
There are also activity flags which are mostly uninteresting for the library atm.
8385
@@ -186,13 +188,18 @@ class Activity(BaseActivity):
186188
187189
- ``id``: A string representing the party ID.
188190
- ``size``: A list of up to two integer elements denoting (current_size, maximum_size).
189-
buttons: List[:class:`dict`]
190-
An list of dictionaries representing custom buttons shown in a rich presence.
191+
buttons: Union[List[:class:`dict`], List[:class:`str`]]
192+
A list of dictionaries representing custom buttons shown in a rich presence.
191193
Each dictionary contains the following keys:
192194
193195
- ``label``: A string representing the text shown on the button.
194196
- ``url``: A string representing the URL opened upon clicking the button.
195197
198+
.. note::
199+
200+
Bots cannot access a user's activity button URLs. Therefore the type of this attribute
201+
will be List[:class:`str`] when received through the gateway.
202+
196203
.. versionadded:: 2.0
197204
198205
emoji: Optional[:class:`PartialEmoji`]
@@ -230,7 +237,7 @@ def __init__(self, **kwargs):
230237
self.flags: int = kwargs.pop("flags", 0)
231238
self.sync_id: Optional[str] = kwargs.pop("sync_id", None)
232239
self.session_id: Optional[str] = kwargs.pop("session_id", None)
233-
self.buttons: List[ActivityButton] = kwargs.pop("buttons", [])
240+
self.buttons: List[str] = kwargs.pop("buttons", [])
234241

235242
activity_type = kwargs.pop("type", -1)
236243
self.type: ActivityType = (

discord/audit_logs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ class AuditLogChanges:
233233
"default_notifications",
234234
_enum_transformer(enums.NotificationLevel),
235235
),
236-
"region": (None, _enum_transformer(enums.VoiceRegion)),
237236
"rtc_region": (None, _enum_transformer(enums.VoiceRegion)),
238237
"video_quality_mode": (None, _enum_transformer(enums.VideoQualityMode)),
239238
"privacy_level": (None, _enum_transformer(enums.StagePrivacyLevel)),
@@ -602,5 +601,5 @@ def _convert_target_sticker(self, target_id: int) -> Union[GuildSticker, Object]
602601
def _convert_target_thread(self, target_id: int) -> Union[Thread, Object]:
603602
return self.guild.get_thread(target_id) or Object(id=target_id)
604603

605-
def _convert_target_scheduled_event(self, target_id: int) -> Union[ScheduledEvent, None]:
604+
def _convert_target_scheduled_event(self, target_id: int) -> Union[ScheduledEvent, Object]:
606605
return self.guild.get_scheduled_event(target_id) or Object(id=target_id)

0 commit comments

Comments
 (0)