Skip to content

Commit

Permalink
Merge branch 'master' into v2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
BobDotCom committed Jul 8, 2022
2 parents f00bf5f + 95fd465 commit 37be456
Show file tree
Hide file tree
Showing 99 changed files with 2,815 additions and 953 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ body:
- discord.ext.commands
- discord.ext.tasks
- discord.ext.pages
- discord.ext.bridge
- The documentation
validations:
required: true
Expand Down
18 changes: 12 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@

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

## Checklist
## Information

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

- [ ] If code changes were made then they have been tested.
- [ ] I have updated the documentation to reflect the changes.
- [ ] If `type: ignore` comments were used, a comment is also left explaining why
- [ ] This PR fixes an issue.
- [ ] This PR adds something new (e.g. new method or parameters).
- [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed)
- [ ] This PR is **not** a code change (e.g. documentation, README, typehinting, examples, ...)
- [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed).
- [ ] This PR is **not** a code change (e.g. documentation, README, typehinting, examples, ...).

## Checklist

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

- [ ] I have searched the open pull requests for duplicates.
- [ ] If code changes were made then they have been tested.
- [ ] I have updated the documentation to reflect the changes.
- [ ] If `type: ignore` comments were used, a comment is also left explaining why.
4 changes: 2 additions & 2 deletions discord/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
__author__ = "Pycord Development"
__license__ = "MIT"
__copyright__ = "Copyright 2015-2021 Rapptz & Copyright 2021-present Pycord Development"
__version__ = "2.0.0rc1"
__version__ = "2.0.0"

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

Expand Down Expand Up @@ -75,6 +75,6 @@ class VersionInfo(NamedTuple):
serial: int


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

logging.getLogger(__name__).addHandler(logging.NullHandler())
1 change: 1 addition & 0 deletions discord/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1534,6 +1534,7 @@ async def send(
ret = state.create_message(channel=channel, data=data)
if view:
state.store_view(view, ret.id)
view.message = ret

if delete_after is not None:
await ret.delete(delay=delete_after)
Expand Down
13 changes: 10 additions & 3 deletions discord/activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
buttons: list[dict]
label: str (max: 32)
url: str (max: 512)
NOTE: Bots cannot access a user's activity button URLs. When received through the
gateway, the type of the buttons field will be list[str].
There are also activity flags which are mostly uninteresting for the library atm.
Expand Down Expand Up @@ -186,13 +188,18 @@ class Activity(BaseActivity):
- ``id``: A string representing the party ID.
- ``size``: A list of up to two integer elements denoting (current_size, maximum_size).
buttons: List[:class:`dict`]
An list of dictionaries representing custom buttons shown in a rich presence.
buttons: Union[List[:class:`dict`], List[:class:`str`]]
A list of dictionaries representing custom buttons shown in a rich presence.
Each dictionary contains the following keys:
- ``label``: A string representing the text shown on the button.
- ``url``: A string representing the URL opened upon clicking the button.
.. note::
Bots cannot access a user's activity button URLs. Therefore the type of this attribute
will be List[:class:`str`] when received through the gateway.
.. versionadded:: 2.0
emoji: Optional[:class:`PartialEmoji`]
Expand Down Expand Up @@ -230,7 +237,7 @@ def __init__(self, **kwargs):
self.flags: int = kwargs.pop("flags", 0)
self.sync_id: Optional[str] = kwargs.pop("sync_id", None)
self.session_id: Optional[str] = kwargs.pop("session_id", None)
self.buttons: List[ActivityButton] = kwargs.pop("buttons", [])
self.buttons: List[str] = kwargs.pop("buttons", [])

activity_type = kwargs.pop("type", -1)
self.type: ActivityType = (
Expand Down
3 changes: 1 addition & 2 deletions discord/audit_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ class AuditLogChanges:
"default_notifications",
_enum_transformer(enums.NotificationLevel),
),
"region": (None, _enum_transformer(enums.VoiceRegion)),
"rtc_region": (None, _enum_transformer(enums.VoiceRegion)),
"video_quality_mode": (None, _enum_transformer(enums.VideoQualityMode)),
"privacy_level": (None, _enum_transformer(enums.StagePrivacyLevel)),
Expand Down Expand Up @@ -602,5 +601,5 @@ def _convert_target_sticker(self, target_id: int) -> Union[GuildSticker, Object]
def _convert_target_thread(self, target_id: int) -> Union[Thread, Object]:
return self.guild.get_thread(target_id) or Object(id=target_id)

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

0 comments on commit 37be456

Please sign in to comment.