Test on sphinx syntax 3
This commit is contained in:
parent
1ed3c073af
commit
6c74b5c95a
|
@ -32,20 +32,17 @@ class Bot:
|
|||
threads : list, public
|
||||
A list of threads for the commands with ``@api.every``.
|
||||
|
||||
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.
|
||||
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 +69,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
|
||||
|
||||
|
|
|
@ -11,13 +11,7 @@ class History:
|
|||
The maximum number of messages that the History stored.
|
||||
"""
|
||||
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
|
||||
|
@ -25,7 +19,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):
|
||||
|
@ -34,7 +28,8 @@ class History:
|
|||
|
||||
Parameters
|
||||
----------
|
||||
:elmnt : int: Whatever the type it will work.
|
||||
elmnt
|
||||
The element to add.
|
||||
"""
|
||||
if len(self.__content) == self.__limit:
|
||||
self.__content.pop(0)
|
||||
|
|
|
@ -21,24 +21,7 @@ class IRC:
|
|||
The IRC's socket.
|
||||
inbox : Queue, private
|
||||
Queue of the incomming messages.
|
||||
handler : Thread, private
|
||||
|
||||
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.
|
||||
|
||||
handle : NoneType, private
|
||||
Handles the ping and store incoming messages into the inbox attribute.
|
||||
|
||||
handler : Thread, private
|
||||
"""
|
||||
def __init__(self, host: str, port: int):
|
||||
"""Initialize an IRC wrapper.
|
||||
|
|
Loading…
Reference in New Issue