Compare commits

...

21 Commits

Author SHA1 Message Date
Shadow15510 22e81f9101 Reviewing documentation 2023-07-22 13:42:02 +02:00
Shadow15510 8be96abc44 Review doc 2023-07-22 13:38:36 +02:00
Shadow15510 b8deded736 Test on sphinx syntax 17 2023-07-22 13:24:34 +02:00
Shadow15510 cc7af23461 Test on sphinx syntax 16 2023-07-22 12:07:58 +02:00
Shadow15510 b89d7fc86d Test on sphinx syntax 15 2023-07-22 12:05:54 +02:00
Shadow15510 557d6b09ac Test on sphinx syntax 14 2023-07-22 12:03:57 +02:00
Shadow15510 efc29350f1 Test on sphinx syntax 13 2023-07-22 11:58:31 +02:00
Shadow15510 d6940b85d8 Test on sphinx syntax 12 2023-07-22 11:51:00 +02:00
Shadow15510 d1c54d5a81 Test on sphinx syntax 11 2023-07-22 11:49:16 +02:00
Shadow15510 92c6c27f72 Test on sphinx syntax 10 2023-07-22 11:46:46 +02:00
Shadow15510 884fa50ab2 Test on sphinx syntax 9 2023-07-22 11:42:36 +02:00
Shadow15510 994a2fef1f Test on sphinx syntax 8 2023-07-22 11:39:10 +02:00
Shadow15510 e5525b4ab8 Test on sphinx syntax 7 2023-07-22 11:35:58 +02:00
Shadow15510 785b6de7f7 Test on sphinx syntax 7 2023-07-22 11:34:15 +02:00
Shadow15510 9924c7a7f6 Test on sphinx syntax 6 2023-07-22 11:30:48 +02:00
Shadow15510 4157fbcf63 Test on sphinx syntax 5 2023-07-22 11:26:00 +02:00
Shadow15510 4453cedf96 Test on sphinx syntax 4 2023-07-22 11:22:59 +02:00
Shadow15510 da7d6960fe Test on sphinx syntax 4 2023-07-22 11:19:24 +02:00
Shadow15510 6c74b5c95a Test on sphinx syntax 3 2023-07-22 11:16:40 +02:00
Shadow15510 1ed3c073af Test on sphinx syntax 2 2023-07-22 11:09:34 +02:00
Shadow15510 48cc55091d Test on sphinx syntax 2023-07-22 11:07:22 +02:00
10 changed files with 62 additions and 72 deletions

View File

@ -4,6 +4,11 @@
Bot
---
.. automodule:: irc_api.bot
:members:
:undoc-members:
:show-inheritance:
: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,6 +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

@ -1,4 +1,3 @@
sphinx
sphinx-autodocgen
sphinx-rtd-theme

View File

@ -1 +1 @@
__version__ = "1.0.6"
__version__ = "1.0.7"

View File

@ -34,18 +34,25 @@ class Bot:
Methods
-------
start : NoneType, public
Runs the bot and connects it to IRC server.
send : NoneType, public
Send a message on the IRC server.
add_command : NoneType, public
Add a single command to the bot.
add_commands : NoneType, public
Allow to add a list of command to the bot.
add_commands_module : NoneType, public
Allow to add a module of command to the bot.
remove_command : NoneType, public
Remove a command.
.. automethod:: __init__
.. automethod:: add_command
.. automethod:: add_commands
.. automethod:: add_commands_module
.. automethod:: remove_commands
.. automethod:: send
.. automethod:: start
Examples
--------
Assuming the module was imported as follow: ``from irc_api import api``
You can create a bot::
my_bot = api.Bot(
irc_params=(irc.exemple.com, 6697),
channels=["#general", "#bot-test"],
prefix="!",
cmnd_pack1, cmnd_pack2
)
"""
def __init__(
self,
@ -72,18 +79,6 @@ class Bot:
The message history of the bot. By default, the bot will remind 100 messages.
*commands_module : optionnal
Modules of commands that you can give to the bot at it's creation.
Examples
--------
Assuming the module was imported as follow: ``from irc_api import api``
You can create a bot::
my_bot = api.Bot(
irc_params=(irc.exemple.com, 6697),
channels=["#general", "#bot-test"],
prefix="!",
cmnd_pack1, cmnd_pack2
)
"""
self.prefix = prefix
@ -240,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.
"""
@ -261,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

@ -12,19 +12,11 @@ class History:
Methods
-------
add : NoneType, public
Add an element to the History. If the History is full, the oldest message is deleted.
get : list, public
Returns the content of the History.
.. automethod:: add
.. automethod:: get
"""
def __init__(self, limit: int):
"""Initialize the History.
Parameters
----------
limit : int
The maximum number of messages the History's instance can handle.
"""
"""Constructor method."""
self.__content = []
if limit:
self.__limit = limit
@ -32,7 +24,7 @@ class History:
self.__limit = 100
def __len__(self):
"""Returns the lenght of the History's instance."""
"""Returns the length of the History's instance."""
return len(self.__content)
def add(self, elmnt):

View File

@ -25,20 +25,13 @@ class IRC:
Methods
-------
connection : NoneType, public
Starts the IRC layer and manage authentication.
send : NoneType, public
Sends a message to a given channel.
receive : Message, public
Receive a new raw message and return the processed message.
join : NoneType, public
Allows to join a given channel.
waitfor : str, public
Wait for a raw message that matches the given condition.
.. automethod:: __init__
.. automethod:: connection
.. automethod:: join
.. automethod:: receive
.. automethod:: send
.. automethod:: waitfor
handle : NoneType, private
Handles the ping and store incoming messages into the inbox attribute.
"""
def __init__(self, host: str, port: int):
"""Initialize an IRC wrapper.