Skip to content

Commit d443d7d

Browse files
authored
chore: pre-release 4.1.1-beta.1 (#603)
chore: pre-release 4.1.1-beta.1
2 parents 6cc6333 + fd5eea4 commit d443d7d

File tree

17 files changed

+346
-105
lines changed

17 files changed

+346
-105
lines changed

.github/ISSUE_TEMPLATE/custom---miscellaneous.md

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

.github/ISSUE_TEMPLATE/report-bug.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ body:
7171
- unstable
7272
validations:
7373
required: true
74+
- type: input
75+
id: version-specific
76+
attributes:
77+
label: Version specification
78+
description: "If you're using a pre-release or release candidate, please specify which one."
79+
validations:
80+
required: false
7481
- type: checkboxes
7582
id: accept
7683
attributes:

.github/ISSUE_TEMPLATE/request-feature.md

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Request a new feature
2+
description: Create an Issue to suggest or propose implementing something(s).
3+
title: "[REQUEST] "
4+
labels: ["documentation", "enhancement"]
5+
assignees:
6+
- goverfl0w
7+
- DeltaXWizard
8+
- EdVraz
9+
body:
10+
- type: markdown
11+
id: thanks
12+
attributes:
13+
value: |
14+
Thank you for taking the time to fill out this feature request!
15+
We rely on users to tell us things that we might not find on our own,
16+
and your help is greatly valued by the team and others contributing.
17+
- type: textarea
18+
id: process
19+
attributes:
20+
label: Describe the feature.
21+
description: Please give us an in-depth description of the feature you wish to see.
22+
placeholder: I am not a fan of doing X for Y, so I would like...
23+
validations:
24+
required: true
25+
- type: checkboxes
26+
id: accept
27+
attributes:
28+
label: Code of Conduct
29+
description: By submitting this Issue, you agree to follow our [contribution requirements.](https://github.com/interactions-py/library/blob/unstable/CONTRIBUTING.rst)
30+
options:
31+
- label: I agree to follow the contribution requirements.
32+
required: true

.pre-commit-config.yaml

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,59 @@
1-
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.1.0
4-
hooks:
5-
- id: requirements-txt-fixer
6-
name: Requirements
7-
types: [file]
8-
exclude_types: ['image']
9-
- id: debug-statements
10-
name: Debugging
11-
language: python
12-
types: [file, python]
13-
exclude_types: ['image']
14-
- id: trailing-whitespace
15-
name: Trailing Whitespace
16-
language: python
17-
types: [file]
18-
exclude_types: ['image']
19-
- id: end-of-file-fixer
20-
name: EOF Newlines
21-
language: python
22-
types: [file]
23-
exclude_types: ['image']
24-
- id: check-yaml
25-
name: YAML Structure
26-
language: python
27-
- id: check-toml
28-
name: TOML Structure
29-
- id: check-merge-conflict
30-
name: Merge Conflicts
31-
- repo: https://github.com/psf/black
32-
rev: 22.1.0
33-
hooks:
34-
- id: black
35-
name: Black Formatting
36-
language: python
37-
types: [file, python]
38-
args: [--line-length=100]
39-
- repo: https://github.com/PyCQA/flake8
40-
rev: 4.0.1
41-
hooks:
42-
- id: flake8
43-
name: flake8 Formatting
44-
language: python
45-
types: [file, python]
46-
args: [--max-line-length=100, --ignore=E203 E301 E302 E501 E402 E704 W503 W504]
47-
- repo: https://github.com/pycqa/isort
48-
rev: 5.10.1
49-
hooks:
50-
- id: isort
51-
name: isort Formatting
52-
language: python
53-
types: [file, python]
54-
ci:
55-
autoupdate_branch: "unstable"
56-
autofix_prs: true
57-
autoupdate_commit_msg: "ci: weekly check."
58-
autoupdate_schedule: weekly
59-
autofix_commit_msg: "ci: correct from checks."
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.1.0
4+
hooks:
5+
- id: requirements-txt-fixer
6+
name: Requirements
7+
types: [file]
8+
exclude_types: ['image']
9+
- id: debug-statements
10+
name: Debugging
11+
language: python
12+
types: [file, python]
13+
exclude_types: ['image']
14+
- id: trailing-whitespace
15+
name: Trailing Whitespace
16+
language: python
17+
types: [file]
18+
exclude_types: ['image']
19+
- id: end-of-file-fixer
20+
name: EOF Newlines
21+
language: python
22+
types: [file]
23+
exclude_types: ['image']
24+
- id: check-yaml
25+
name: YAML Structure
26+
language: python
27+
- id: check-toml
28+
name: TOML Structure
29+
- id: check-merge-conflict
30+
name: Merge Conflicts
31+
- repo: https://github.com/psf/black
32+
rev: 22.1.0
33+
hooks:
34+
- id: black
35+
name: Black Formatting
36+
language: python
37+
types: [file, python]
38+
args: [--line-length=100]
39+
- repo: https://github.com/PyCQA/flake8
40+
rev: 4.0.1
41+
hooks:
42+
- id: flake8
43+
name: flake8 Formatting
44+
language: python
45+
types: [file, python]
46+
args: [--max-line-length=100, --ignore=E203 E301 E302 E501 E402 E704 W503 W504]
47+
- repo: https://github.com/pycqa/isort
48+
rev: 5.10.1
49+
hooks:
50+
- id: isort
51+
name: isort Formatting
52+
language: python
53+
types: [file, python]
54+
ci:
55+
autoupdate_branch: "unstable"
56+
autofix_prs: true
57+
autoupdate_commit_msg: "ci: weekly check."
58+
autoupdate_schedule: weekly
59+
autofix_commit_msg: "ci: correct from checks."

interactions/api/gateway.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,11 @@ def _check_auto(option: dict) -> Optional[Tuple[str]]:
489489
return _check
490490

491491
__kwargs[sub_option["name"]] = sub_option["value"]
492+
493+
elif _data.get("type") and _data["type"] == OptionType.SUB_COMMAND:
494+
# sub_command_groups must have options so there is no extra check needed for those
495+
__kwargs["sub_command"] = _data["name"]
496+
492497
elif _data.get("value") and _data.get("name"):
493498
__kwargs[_data["name"]] = _data["value"]
494499

@@ -551,7 +556,8 @@ async def _send_packet(self, data: Dict[str, Any]) -> None:
551556
:type data: Dict[str, Any]
552557
"""
553558
self._last_send = perf_counter()
554-
packet: str = dumps(data).decode("utf-8") if isinstance(data, dict) else data
559+
_data = dumps(data) if isinstance(data, dict) else data
560+
packet: str = _data.decode("utf-8") if isinstance(_data, bytes) else _data
555561
await self._client.send_str(packet)
556562
log.debug(packet)
557563

interactions/api/http.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ async def leave_guild(self, guild_id: int) -> None:
683683
:return: None
684684
"""
685685
return await self._req.request(
686-
Route("DELETE", "/users/@me/guilds/{guild_id}", guild_id=guild_id)
686+
Route("DELETE", f"/users/@me/guilds/{guild_id}", guild_id=guild_id)
687687
)
688688

689689
async def delete_guild(self, guild_id: int) -> None:
@@ -2301,7 +2301,7 @@ async def delete_interaction_response(
23012301
webhook_id=int(application_id), webhook_token=token, message_id=message_id
23022302
)
23032303

2304-
async def _post_followup(self, data: dict, token: str, application_id: str) -> None:
2304+
async def _post_followup(self, data: dict, token: str, application_id: str) -> dict:
23052305
"""
23062306
Send a followup to an interaction.
23072307

interactions/api/models/member.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@ def __init__(self, **kwargs):
7272
else None
7373
)
7474

75-
self.roles = [
76-
role_id if isinstance(role_id, int) else int(role_id) for role_id in self.roles
77-
]
75+
self.roles = (
76+
[role_id if isinstance(role_id, int) else int(role_id) for role_id in self.roles]
77+
if self._json.get("roles")
78+
else None
79+
)
7880

7981
if not self.avatar and self.user:
8082
self.avatar = self.user.avatar

interactions/api/models/member.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Member(DictSerializerMixin):
1616
user: Optional[User]
1717
nick: Optional[str]
1818
avatar: Optional[str]
19-
roles: List[Role]
19+
roles: List[int]
2020
joined_at: datetime
2121
premium_since: datetime
2222
deaf: bool

0 commit comments

Comments
 (0)