Skip to content

Commit 5973a76

Browse files
authored
docs: Suppress Mkdocs warnings (#1386)
* docs: Suppress Mkdocs warnings * fix: change kwargs typehint
1 parent 024d897 commit 5973a76

File tree

6 files changed

+40
-34
lines changed

6 files changed

+40
-34
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ In addition to core functionality, `interactions.py` provides a range of optiona
3737

3838
So the base library doesn't do what you want? No problem! With builtin extensions, you are able to extend the functionality of the library. And if none of those pique your interest, there are a myriad of other extension libraries available.
3939

40-
Just type `bot.load("extension")`
40+
Just type `bot.load_extension("extension")`
4141

4242
<details>
4343
<summary>Extensions</summary>

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ In addition to core functionality, interactions.py provides a range of optional
3434

3535
So the base library doesn't do what you want? No problem! With builtin extensions, you are able to extend the functionality of the library. And if none of those pique your interest, there are a myriad of other extension libraries available.
3636

37-
Just type `bot.load("extension")`
37+
Just type `bot.load_extension("extension")`
3838

3939
---
4040

interactions/api/http/http_requests/guild.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
from typing import TYPE_CHECKING, List, cast, Mapping, Any
1+
from typing import TYPE_CHECKING, Any, List, Mapping, cast
22

33
import discord_typings
44

55
from interactions.client.utils.serializer import dict_filter_none
66
from interactions.models.internal.protocols import CanRequest
7-
from ..route import Route, PAYLOAD_TYPE
7+
8+
from ..route import PAYLOAD_TYPE, Route
89

910
__all__ = ("GuildRequests",)
1011

1112

1213
if TYPE_CHECKING:
13-
from interactions.models.discord.snowflake import Snowflake_Type
1414
from interactions.models.discord.enums import AuditLogEventType
15+
from interactions.models.discord.snowflake import Snowflake_Type
1516

1617

1718
class GuildRequests(CanRequest):
@@ -404,9 +405,6 @@ async def modify_guild_role_positions(
404405
Args:
405406
guild_id: The ID of the guild
406407
position_changes: A list of dicts representing the roles to move and their new positions
407-
408-
``{"id": role_id, "position": new_position}``
409-
410408
reason: The reason for this action
411409
412410
Returns:

interactions/client/utils/attr_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@ def docs(doc_string: str) -> Dict[str, str]:
3636
return {"docs": doc_string}
3737

3838

39-
def str_validator(self: Any, attribute: attrs.Attribute, value: Any) -> None:
39+
def str_validator(cls: Any, attribute: attrs.Attribute, value: Any) -> None:
4040
"""
4141
Validates that the value is a string. Helps convert and ives a warning if it isn't.
4242
4343
Args:
44-
self: The instance of the class.
44+
cls: The instance of the class.
4545
attribute: The attr attribute being validated.
4646
value: The value being validated.
4747
4848
"""
4949
if not isinstance(value, str):
5050
if value is MISSING:
5151
return
52-
setattr(self, attribute.name, str(value))
52+
setattr(cls, attribute.name, str(value))
5353
get_logger().warning(
5454
f"Value of {attribute.name} has been automatically converted to a string. Please use strings in future.\n"
5555
"Note: Discord will always return value as a string"

interactions/ext/prefixed_commands/context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Optional, Union, Iterable, TYPE_CHECKING
1+
from typing import TYPE_CHECKING, Any, Iterable, Optional, Union
22

33
from typing_extensions import Self
44

@@ -80,7 +80,7 @@ async def reply(
8080
content: Optional[str] = None,
8181
embeds: Optional[Union[Iterable[Union[Embed, dict]], Union[Embed, dict]]] = None,
8282
embed: Optional[Union[Embed, dict]] = None,
83-
**kwargs,
83+
**kwargs: Any,
8484
) -> Message:
8585
"""
8686
Reply to the context's message. Takes all the same attributes as `send`.

interactions/models/discord/guild.py

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,55 @@
33
from asyncio import QueueEmpty
44
from collections import namedtuple
55
from functools import cmp_to_key
6-
from typing import List, Optional, Union, Set, Dict, Any, TYPE_CHECKING
6+
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set, Union
77
from warnings import warn
88

99
import attrs
1010

1111
import interactions.models as models
12-
from interactions.client.const import Absent, MISSING, PREMIUM_GUILD_LIMITS
12+
from interactions.client.const import MISSING, PREMIUM_GUILD_LIMITS, Absent
1313
from interactions.client.errors import EventLocationNotProvided, NotFound
1414
from interactions.client.mixins.serialization import DictSerializationMixin
15-
from interactions.client.utils.attr_converters import optional, list_converter
16-
from interactions.client.utils.attr_converters import timestamp_converter
15+
from interactions.client.utils.attr_converters import optional, list_converter, timestamp_converter
1716
from interactions.client.utils.attr_utils import docs
1817
from interactions.client.utils.deserialise_app_cmds import deserialize_app_cmds
19-
from interactions.client.utils.serializer import to_image_data, no_export_meta
20-
from interactions.models.discord.app_perms import CommandPermissions, ApplicationCommandPermission
18+
from interactions.client.utils.serializer import no_export_meta, to_image_data
19+
from interactions.models.discord.app_perms import (
20+
ApplicationCommandPermission,
21+
CommandPermissions,
22+
)
2123
from interactions.models.discord.auto_mod import AutoModRule, BaseAction, BaseTrigger
2224
from interactions.models.discord.file import UPLOADABLE_TYPE
2325
from interactions.models.misc.iterator import AsyncIterator
24-
from .base import DiscordObject, ClientObject
26+
27+
from .base import ClientObject, DiscordObject
2528
from .enums import (
26-
NSFWLevel,
27-
Permissions,
28-
SystemChannelFlags,
29-
VerificationLevel,
29+
AuditLogEventType,
30+
AutoModEvent,
31+
AutoModTriggerType,
32+
ChannelType,
3033
DefaultNotificationLevel,
3134
ExplicitContentFilterLevel,
32-
MFALevel,
33-
ChannelType,
35+
ForumLayoutType,
3436
IntegrationExpireBehaviour,
37+
MFALevel,
38+
NSFWLevel,
39+
Permissions,
3540
ScheduledEventPrivacyLevel,
3641
ScheduledEventType,
37-
AuditLogEventType,
38-
AutoModEvent,
39-
AutoModTriggerType,
40-
ForumLayoutType,
42+
SystemChannelFlags,
43+
VerificationLevel,
44+
)
45+
from .snowflake import (
46+
Snowflake_Type,
47+
to_optional_snowflake,
48+
to_snowflake,
49+
to_snowflake_list,
4150
)
42-
from .snowflake import to_snowflake, Snowflake_Type, to_optional_snowflake, to_snowflake_list
4351

4452
if TYPE_CHECKING:
45-
from interactions.client.client import Client
4653
from interactions import InteractionCommand
54+
from interactions.client.client import Client
4755

4856
__all__ = (
4957
"GuildBan",
@@ -581,7 +589,7 @@ async def http_chunk(self) -> None:
581589
f"Cached {iterator.total_retrieved} members for {self.id} in {time.perf_counter() - start_time:.2f} seconds"
582590
)
583591

584-
async def gateway_chunk(self, wait=True, presences=True) -> None:
592+
async def gateway_chunk(self, wait: bool = True, presences: bool = True) -> None:
585593
"""
586594
Trigger a gateway `get_members` event, populating this object with members.
587595
@@ -598,7 +606,7 @@ async def chunk(self) -> None:
598606
"""Populates all members of this guild using the REST API."""
599607
await self.http_chunk()
600608

601-
async def chunk_guild(self, wait=True, presences=True) -> None:
609+
async def chunk_guild(self, wait: bool = True, presences: bool = True) -> None:
602610
"""
603611
Trigger a gateway `get_members` event, populating this object with members.
604612

0 commit comments

Comments
 (0)