Skip to content

Commit 431a2c5

Browse files
committed
fix: revisit current cog extender, (docs): add module doc.
1 parent 3e6b81c commit 431a2c5

File tree

5 files changed

+45
-22
lines changed

5 files changed

+45
-22
lines changed

interactions/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""
2+
(interactions)
23
discord-interactions
34
45
Easy, simple, scalable and modular: a Python API wrapper for interactions.

interactions/api/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
"""
2+
interactions.api
3+
4+
This section of the library maintains and
5+
handles all of the Gateway and HTTP
6+
work.
7+
"""
18
from ..base import * # noqa: F401 F403
29
from .cache import * # noqa: F401 F403
310
from .enums import * # noqa: F401 F403

interactions/api/models/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
"""
2+
interactions.api.models
3+
4+
This section of the library maintains
5+
and stores all of the data defining
6+
models for dispatched Gateway events.
7+
"""
18
from .channel import * # noqa: F401 F403
29
from .guild import * # noqa: F401 F403
310
from .gw import * # noqa: F401 F403

interactions/client.py

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -581,32 +581,33 @@ async def raw_guild_create(self, guild) -> dict:
581581
return guild._json
582582

583583

584-
class Extension:
585-
"""
586-
A class that allows you to represent "extensions" of your code, or
587-
essentially cogs that can be ran independent of the root file in
588-
an object-oriented structure.
584+
# TODO: Implement the rest of cog behaviour when possible.
585+
# class Extension:
586+
# """
587+
# A class that allows you to represent "extensions" of your code, or
588+
# essentially cogs that can be ran independent of the root file in
589+
# an object-oriented structure.
589590

590-
The structure of an extension:
591+
# The structure of an extension:
591592

592-
.. code-block:: python
593+
# .. code-block:: python
593594

594-
class CoolCode(interactions.Extension):
595-
def __init__(self, client):
596-
...
595+
# class CoolCode(interactions.Extension):
596+
# def __init__(self, client):
597+
# ...
597598

598-
@self.client.command(
599-
type=interactions.ApplicationCommandType.USER,
600-
name="User command in cog",
601-
)
602-
async def cog_user_cmd(self, ctx):
603-
...
599+
# @self.client.command(
600+
# type=interactions.ApplicationCommandType.USER,
601+
# name="User command in cog",
602+
# )
603+
# async def cog_user_cmd(self, ctx):
604+
# ...
604605

605-
def setup(bot):
606-
CoolCode(bot)
607-
"""
606+
# def setup(bot):
607+
# CoolCode(bot)
608+
# """
608609

609-
client: Client
610+
# client: Client
610611

611-
def __new__(cls, bot: Client) -> None:
612-
cls.client = bot
612+
# def __new__(cls, bot: Client) -> None:
613+
# cls.client = bot

interactions/models/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
"""
2+
interactions.models
3+
4+
This section of the library maintains
5+
and stores all of the data defining
6+
models for interaction creation events.
7+
"""
18
from .command import * # noqa: F401 F403
29
from .component import * # noqa: F401 F403
310
from .misc import * # noqa: F401 F403

0 commit comments

Comments
 (0)