Review doc

This commit is contained in:
Shadow15510 2023-07-22 13:38:36 +02:00
parent b8deded736
commit 8be96abc44
8 changed files with 49 additions and 22 deletions

View File

@ -7,4 +7,8 @@ Bot
:ignore-module-all:
.. autoclass:: Bot
.. autoclass:: BotCommand
.. autoexception:: WrongArg
.. autofunction:: check_args
.. autofunction:: convert
.. autofunction:: parse

View File

@ -4,7 +4,12 @@
Commands
--------
.. automodule:: irc_api.commands
:members:
:undoc-members:
:show-inheritance:
:ignore-module-all:
.. autodecorator:: command
.. autodecorator:: channel
.. autodecorator:: every
.. autodecorator:: on
.. autodecorator:: user
.. autofunction:: auto_help

View File

@ -4,6 +4,6 @@
History
-------
.. automodule:: irc_api.history
:members:
:undoc-members:
:show-inheritance:
:ignore-module-all:
.. autoclass:: History

View File

@ -4,7 +4,7 @@
IRC
---
.. automodule:: irc_api.irc
:members:
:undoc-members:
:show-inheritance:
:ignore-module-all:
.. autoclass:: IRC

View File

@ -4,6 +4,6 @@
Message
-------
.. automodule:: irc_api.message
:members:
:undoc-members:
:show-inheritance:
:ignore-module-all:
.. autoclass:: Message

View File

@ -35,9 +35,12 @@ class Bot:
Methods
-------
.. automethod:: __init__
.. automethod:: start
.. automethod:: send
.. automethod:: add_command
.. automethod:: add_commands
.. automethod:: add_commands_module
.. automethod:: remove_commands
.. automethod:: send
.. automethod:: start
Examples
--------
@ -232,9 +235,9 @@ class BotCommand:
The description of the BotCommand. By default, the function's docstring is used.
cmnd_type : int, public
The type of the command.
- if ``cmnd_type = 0``, the command is triggered on an event.
- if ``cmnd_type = 1``, the command is a named command.
- if ``cmnd_type = 2``, the command is a routine automatically triggered.
* if ``cmnd_type = 0``, the command is triggered on an event.
* if ``cmnd_type = 1``, the command is a named command.
* if ``cmnd_type = 2``, the command is a routine automatically triggered.
bot : irc_api.bot.Bot, public
The bot the command belongs to.
"""
@ -253,9 +256,9 @@ class BotCommand:
The description of the BotCommand. By default, the function's docstring is used.
cmnd_type : int
The type of the command.
- if ``cmnd_type = 0``, the command is triggered on an event.
- if ``cmnd_type = 1``, the command is a named command.
- if ``cmnd_type = 2``, the command is a routine automatically triggered.
* if ``cmnd_type = 0``, the command is triggered on an event.
* if ``cmnd_type = 1``, the command is a named command.
* if ``cmnd_type = 2``, the command is a routine automatically triggered.
"""
self.name = name
self.func = func

View File

@ -9,6 +9,11 @@ class History:
The content of the History.
limit : int, private
The maximum number of messages that the History stored.
Methods
-------
.. automethod:: add
.. automethod:: get
"""
def __init__(self, limit: int):
"""Constructor method."""

View File

@ -21,7 +21,17 @@ class IRC:
The IRC's socket.
inbox : Queue, private
Queue of the incomming messages.
handler : Thread, private
handler : Thread, private
Methods
-------
.. automethod:: __init__
.. automethod:: connection
.. automethod:: join
.. automethod:: receive
.. automethod:: send
.. automethod:: waitfor
"""
def __init__(self, host: str, port: int):
"""Initialize an IRC wrapper.