diff --git a/docs/doctrees/apireference.doctree b/docs/doctrees/apireference.doctree
new file mode 100644
index 00000000..add902de
Binary files /dev/null and b/docs/doctrees/apireference.doctree differ
diff --git a/docs/doctrees/audio.doctree b/docs/doctrees/audio.doctree
deleted file mode 100644
index 94fa5b28..00000000
Binary files a/docs/doctrees/audio.doctree and /dev/null differ
diff --git a/docs/doctrees/bots.doctree b/docs/doctrees/bots.doctree
deleted file mode 100644
index e38b078e..00000000
Binary files a/docs/doctrees/bots.doctree and /dev/null differ
diff --git a/docs/doctrees/commands.doctree b/docs/doctrees/commands.doctree
deleted file mode 100644
index 2d86f9b6..00000000
Binary files a/docs/doctrees/commands.doctree and /dev/null differ
diff --git a/docs/doctrees/creatingacommand.doctree b/docs/doctrees/creatingacommand.doctree
new file mode 100644
index 00000000..bdc5f93c
Binary files /dev/null and b/docs/doctrees/creatingacommand.doctree differ
diff --git a/docs/doctrees/database.doctree b/docs/doctrees/database.doctree
deleted file mode 100644
index 02f9c1e9..00000000
Binary files a/docs/doctrees/database.doctree and /dev/null differ
diff --git a/docs/doctrees/environment.pickle b/docs/doctrees/environment.pickle
index 0ab02885..f695f38c 100644
Binary files a/docs/doctrees/environment.pickle and b/docs/doctrees/environment.pickle differ
diff --git a/docs/doctrees/error.doctree b/docs/doctrees/error.doctree
deleted file mode 100644
index c0e1c833..00000000
Binary files a/docs/doctrees/error.doctree and /dev/null differ
diff --git a/docs/doctrees/index.doctree b/docs/doctrees/index.doctree
index d7ff3768..537d5ccb 100644
Binary files a/docs/doctrees/index.doctree and b/docs/doctrees/index.doctree differ
diff --git a/docs/doctrees/network.doctree b/docs/doctrees/network.doctree
deleted file mode 100644
index d544ba0b..00000000
Binary files a/docs/doctrees/network.doctree and /dev/null differ
diff --git a/docs/doctrees/utils.doctree b/docs/doctrees/utils.doctree
deleted file mode 100644
index ac7d0719..00000000
Binary files a/docs/doctrees/utils.doctree and /dev/null differ
diff --git a/docs/doctrees/web.doctree b/docs/doctrees/web.doctree
deleted file mode 100644
index 504b7ce8..00000000
Binary files a/docs/doctrees/web.doctree and /dev/null differ
diff --git a/docs/html/_sources/apireference.rst.txt b/docs/html/_sources/apireference.rst.txt
new file mode 100644
index 00000000..78f973f2
--- /dev/null
+++ b/docs/html/_sources/apireference.rst.txt
@@ -0,0 +1,70 @@
+API Reference
+====================================
+
+These pages were automatically generated from docstrings in code.
+
+They might be outdated, or incomplete.
+
+Audio
+------------------------------------
+
+.. automodule:: royalnet.audio
+ :members:
+ :undoc-members:
+ :private-members:
+
+Bots
+------------------------------------
+
+.. automodule:: royalnet.bots
+ :members:
+ :undoc-members:
+ :private-members:
+
+Commands
+------------------------------------
+
+.. automodule:: royalnet.commands
+ :members:
+ :undoc-members:
+ :private-members:
+
+Database
+------------------------------------
+
+.. automodule:: royalnet.database
+ :members:
+ :undoc-members:
+ :private-members:
+
+Network
+------------------------------------
+
+.. automodule:: royalnet.network
+ :members:
+ :undoc-members:
+ :private-members:
+
+Utils
+------------------------------------
+
+.. automodule:: royalnet.utils
+ :members:
+ :undoc-members:
+ :private-members:
+
+Web
+------------------------------------
+
+.. automodule:: royalnet.web
+ :members:
+ :undoc-members:
+ :private-members:
+
+Error
+------------------------------------
+
+.. automodule:: royalnet.error
+ :members:
+ :undoc-members:
+ :private-members:
diff --git a/docs/html/_sources/audio.rst.txt b/docs/html/_sources/audio.rst.txt
deleted file mode 100644
index 1b163fe9..00000000
--- a/docs/html/_sources/audio.rst.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-royalnet.audio
-====================================
-
-.. toctree::
- :maxdepth: 2
-
-
-.. automodule:: royalnet.audio
- :members:
- :private-members:
- :undoc-members:
-
diff --git a/docs/html/_sources/bots.rst.txt b/docs/html/_sources/bots.rst.txt
deleted file mode 100644
index 42f1173b..00000000
--- a/docs/html/_sources/bots.rst.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-royalnet.bots
-====================================
-
-.. toctree::
- :maxdepth: 2
-
-
-.. automodule:: royalnet.bots
- :members:
- :private-members:
- :undoc-members:
diff --git a/docs/html/_sources/commands.rst.txt b/docs/html/_sources/commands.rst.txt
deleted file mode 100644
index 9f8befe2..00000000
--- a/docs/html/_sources/commands.rst.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-royalnet.commands
-====================================
-
-.. toctree::
- :maxdepth: 2
-
-
-.. automodule:: royalnet.commands
- :members:
- :private-members:
- :special-members:
diff --git a/docs/html/_sources/creatingacommand.rst.txt b/docs/html/_sources/creatingacommand.rst.txt
new file mode 100644
index 00000000..341e2437
--- /dev/null
+++ b/docs/html/_sources/creatingacommand.rst.txt
@@ -0,0 +1,66 @@
+.. currentmodule:: royalnet.commands
+
+Royalnet Commands
+====================================
+
+A Royalnet Command is a small script that is run whenever a specific message is sent to a Royalnet interface.
+
+A Command code looks like this: ::
+
+ from royalnet.commands import Command
+
+ class PingCommand(Command):
+ name = "ping"
+
+ description = "Play ping-pong with the bot."
+
+ def __init__(self, interface):
+ # This code is run just once, while the bot is starting
+ super().__init__()
+
+ async def run(self, args, data):
+ # This code is run every time the command is called
+ await data.reply("Pong!")
+
+
+Creating a new Command
+------------------------------------
+
+First, think of a ``name`` for your command.
+It's the name your command will be called with: for example, the "spaghetti" command will be called by typing **/spaghetti** in chat.
+Try to keep the name as short as possible, while staying specific enough so no other command will have the same name.
+
+Next, create a new Python file with the ``name`` you have thought of.
+The previously mentioned "spaghetti" command should have a file called ``spaghetti.py``.
+
+Then, in the first row of the file, import the :py:class:`Command` class from :py:mod:`royalnet`, and create a new class inheriting from it: ::
+
+ from royalnet.commands import Command
+
+ class SpaghettiCommand(Command):
+ ...
+
+Inside the class, override the attributes ``name`` and ``description`` with respectively the **name of the command** and a **small description of what the command will do**: ::
+
+ from royalnet.commands import Command
+
+ class SpaghettiCommand(Command):
+ name = "spaghetti"
+
+ description = "Send a spaghetti emoji in the chat."
+
+Now override the :py:meth:`Command.run` method, adding the code you want the bot to run when the command is called.
+
+To send a message in the chat the command was called in, you can use the :py:meth:`CommandData.reply` method: ::
+
+ from royalnet.commands import Command
+
+ class SpaghettiCommand(Command):
+ name = "spaghetti"
+
+ description = "Send a spaghetti emoji in the chat."
+
+ async def run(self, args, data):
+ data.reply("π")
+
+And it's done! The command is now ready to be used in a bot!
diff --git a/docs/html/_sources/database.rst.txt b/docs/html/_sources/database.rst.txt
deleted file mode 100644
index 64293c67..00000000
--- a/docs/html/_sources/database.rst.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-royalnet.database
-====================================
-
-.. toctree::
- :maxdepth: 2
-
-
-.. automodule:: royalnet.database
- :members:
- :private-members:
- :undoc-members:
-
-
-Tables
-------------------------------------
-
-.. automodule:: royalnet.database.tables
- :members:
- :private-members:
- :undoc-members:
diff --git a/docs/html/_sources/error.rst.txt b/docs/html/_sources/error.rst.txt
deleted file mode 100644
index 044a1511..00000000
--- a/docs/html/_sources/error.rst.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-royalnet.error
-====================================
-
-.. toctree::
- :maxdepth: 2
-
-
-.. automodule:: royalnet.error
- :members:
- :private-members:
- :undoc-members:
diff --git a/docs/html/_sources/index.rst.txt b/docs/html/_sources/index.rst.txt
index 5e7c7391..38a3a7d3 100644
--- a/docs/html/_sources/index.rst.txt
+++ b/docs/html/_sources/index.rst.txt
@@ -1,17 +1,13 @@
royalnet
====================================
+Welcome to the documentation of Royalnet!
+
.. toctree::
:maxdepth: 2
- audio
- bots
- commands
- database
- network
- utils
- error
- web
+ creatingacommand
+ apireference
Some useful links
diff --git a/docs/html/_sources/network.rst.txt b/docs/html/_sources/network.rst.txt
deleted file mode 100644
index 5c07dbbe..00000000
--- a/docs/html/_sources/network.rst.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-royalnet.network
-====================================
-
-.. toctree::
- :maxdepth: 2
-
-
-.. automodule:: royalnet.network
- :members:
- :private-members:
- :undoc-members:
-
diff --git a/docs/html/_sources/utils.rst.txt b/docs/html/_sources/utils.rst.txt
deleted file mode 100644
index 1deb9cbc..00000000
--- a/docs/html/_sources/utils.rst.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-royalnet.utils
-====================================
-
-.. toctree::
- :maxdepth: 2
-
-
-.. automodule:: royalnet.utils
- :members:
- :private-members:
- :undoc-members:
-
diff --git a/docs/html/_sources/web.rst.txt b/docs/html/_sources/web.rst.txt
deleted file mode 100644
index cabaf108..00000000
--- a/docs/html/_sources/web.rst.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-royalnet.web
-====================================
-
-.. toctree::
- :maxdepth: 2
-
-
-.. automodule:: royalnet.web
- :members:
- :private-members:
- :undoc-members:
-
-
-Royalprints
-------------------------------------
-
-.. automodule:: royalnet.web.royalprints
- :members:
- :private-members:
- :undoc-members:
diff --git a/docs/html/apireference.html b/docs/html/apireference.html
new file mode 100644
index 00000000..5f1d467b
--- /dev/null
+++ b/docs/html/apireference.html
@@ -0,0 +1,1389 @@
+
+
+
+
+
+
+
+
+
+
+ API Reference — Royalnet documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Royalnet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
API Reference
+
These pages were automatically generated from docstrings in code.
+
They might be outdated, or incomplete.
+
+
Audio
+
Video and audio downloading related classes, mainly used for Discord voice bots.
+
+
+class royalnet.audio.
YtdlInfo
( info: Dict[str, Any] )
+A wrapper around youtube_dl extracted info.
+
+
+__init__
( info: Dict[str, Any] )
+Create a YtdlInfo from the dict returned by the youtube_dl.YoutubeDL.extract_info()
function.
+
+
+
+
+
+_default_ytdl_args
= {'ignoreerrors': True, 'no_warnings': True, 'noplaylist': True, 'outtmpl': '%(title)s-%(id)s.%(ext)s', 'quiet': True}
+
+
+
+
+classmethod retrieve_for_url
( url , **ytdl_args ) → List[royalnet.audio.ytdlinfo.YtdlInfo]
+Fetch the info for an url through YoutubeDL.
+
+Returns
+A list
containing the infos for the requested videos.
+
+
+
+
+
+
+to_discord_embed
( ) → discord.embeds.Embed
+Return this info as a discord.Embed
.
+
+
+
+
+
+
+class royalnet.audio.
YtdlFile
( url: str , info: Optional[royalnet.audio.ytdlinfo.YtdlInfo] = None , filename: Optional[str] = None )
+Information about a youtube-dl downloaded file.
+
+
+_default_ytdl_args
= {'ignoreerrors': True, 'no_warnings': True, 'noplaylist': True, 'outtmpl': '%(epoch)s-%(title)s-%(id)s.%(ext)s', 'quiet': True}
+
+
+
+
+delete
( )
+
+
+
+
+download_file
( **ytdl_args ) → None
+
+
+
+
+classmethod download_from_url
( url: str , **ytdl_args ) → List[royalnet.audio.ytdlfile.YtdlFile]
+
+
+
+
+has_info
( ) → bool
+
+
+
+
+is_downloaded
( ) → bool
+
+
+
+
+open
( )
+
+
+
+
+update_info
( **ytdl_args ) → None
+
+
+
+
+
+
+class royalnet.audio.
FileAudioSource
( file )
+A discord.AudioSource
that uses a io.BufferedIOBase
as an input instead of memory.
+The stream should be in the usual PCM encoding.
+
+
Warning
+
This AudioSource will consume (and close) the passed stream.
+
+
+
+is_opus
( )
+This audio file isnβt Opus-encoded, but PCM-encoded.
+
+Returns
+False
.
+
+
+
+
+
+
+read
( )
+Reads 20ms worth of audio.
+If the audio is complete, then returning an empty bytes
-like object to signal this is the way to do so.
+
+
+
+
+
+
+class royalnet.audio.
YtdlDiscord
( ytdl_file: royalnet.audio.ytdlfile.YtdlFile )
+
+
+convert_to_pcm
( ) → None
+
+
+
+
+classmethod create_and_ready_from_url
( url , **ytdl_args ) → List[royalnet.audio.ytdldiscord.YtdlDiscord]
+
+
+
+
+classmethod create_from_url
( url , **ytdl_args ) → List[royalnet.audio.ytdldiscord.YtdlDiscord]
+
+
+
+
+delete
( ) → None
+
+
+
+
+property info
+
+
+
+
+pcm_available
( )
+
+
+
+
+ready_up
( )
+
+
+
+
+spawn_audiosource
( ) → royalnet.audio.fileaudiosource.FileAudioSource
+
+
+
+
+
+
+class royalnet.audio.
YtdlMp3
( ytdl_file: royalnet.audio.ytdlfile.YtdlFile )
+
+
+convert_to_mp3
( ) → None
+
+
+
+
+classmethod create_and_ready_from_url
( url , **ytdl_args ) → List[royalnet.audio.ytdlmp3.YtdlMp3]
+
+
+
+
+classmethod create_from_url
( url , **ytdl_args ) → List[royalnet.audio.ytdlmp3.YtdlMp3]
+
+
+
+
+delete
( ) → None
+
+
+
+
+property info
+
+
+
+
+pcm_available
( )
+
+
+
+
+ready_up
( )
+
+
+
+
+
+
+
Bots
+
Various bot interfaces, and a generic class to create new ones.
+
+
+class royalnet.bots.
TelegramBot
( * , telegram_config: royalnet.bots.telegram.TelegramConfig , royalnet_config: Optional[royalnet.network.royalnetconfig.RoyalnetConfig] = None , database_config: Optional[royalnet.database.databaseconfig.DatabaseConfig] = None , sentry_dsn: Optional[str] = None , commands: List[Type[royalnet.commands.command.Command]] = None )
+A bot that connects to Telegram .
+
+
+_data_factory
( ) → Type[royalnet.commands.commanddata.CommandData]
+
+
+
+
+async _handle_update
( update: telegram.update.Update )
+
+
+
+
+_init_client
( )
+Create the telegram.Bot
, and set the starting offset.
+
+
+
+
+_interface_factory
( ) → Type[royalnet.commands.commandinterface.CommandInterface]
+
+
+
+
+interface_name
= 'telegram'
+
+
+
+
+async run
( )
+A blocking coroutine that should make the bot start listening to commands and requests.
+
+
+
+
+
+
+class royalnet.bots.
TelegramConfig
( token: str )
+The specific configuration to be used for royalnet.database.TelegramBot
.
+
+
+
+
+class royalnet.bots.
DiscordBot
( * , discord_config: royalnet.bots.discord.DiscordConfig , royalnet_config: Optional[royalnet.network.royalnetconfig.RoyalnetConfig] = None , database_config: Optional[royalnet.database.databaseconfig.DatabaseConfig] = None , sentry_dsn: Optional[str] = None , commands: List[Type[royalnet.commands.command.Command]] = None )
+A bot that connects to Discord .
+
+
+_bot_factory
( ) → Type[discord.client.Client]
+Create a custom DiscordClient class inheriting from discord.Client
.
+
+
+
+
+_data_factory
( ) → Type[royalnet.commands.commanddata.CommandData]
+
+
+
+
+_init_client
( )
+Create an instance of the DiscordClient class created in royalnet.bots.DiscordBot._bot_factory()
.
+
+
+
+
+_init_voice
( )
+Initialize the variables needed for the connection to voice chat.
+
+
+
+
+_interface_factory
( ) → Type[royalnet.commands.commandinterface.CommandInterface]
+
+
+
+
+async add_to_music_data
( dfiles: List[royalnet.audio.ytdldiscord.YtdlDiscord], guild: discord.guild.Guild )
+Add a list of royalnet.audio.YtdlDiscord
to the corresponding music_data object.
+
+
+
+
+async advance_music_data
( guild: discord.guild.Guild )
+Try to play the next song, while it exists. Otherwise, just return.
+
+
+
+
+interface_name
= 'discord'
+
+
+
+
+async run
( )
+Login to Discord, then run the bot.
+
+
+
+
+async update_activity_with_source_title
( )
+Change the botβs presence (using discord.Client.change_presence()
) to match the current listening status.
+If multiple guilds are using the bot, the bot will always have an empty presence.
+
+
+
+
+
+
+class royalnet.bots.
DiscordConfig
( token: str )
+The specific configuration to be used for royalnet.bots.DiscordBot
.
+
+
+
+
+class royalnet.bots.
GenericBot
( * , royalnet_config: Optional[royalnet.network.royalnetconfig.RoyalnetConfig] = None , database_config: Optional[royalnet.database.databaseconfig.DatabaseConfig] = None , commands: List[Type[royalnet.commands.command.Command]] = None , sentry_dsn: Optional[str] = None , loop: asyncio.events.AbstractEventLoop = None )
+A generic bot class, to be used as base for the other more specific classes, such as
+royalnet.bots.TelegramBot and royalnet.bots.DiscordBot .
+
+
+_data_factory
( ) → Type[royalnet.commands.commanddata.CommandData]
+
+
+
+
+_init_commands
( commands: List[Type[royalnet.commands.command.Command]] ) → None
+Generate the commands
dictionary required to handle incoming messages, and the network_handlers
+dictionary required to handle incoming requests.
+
+
+
+
+_init_database
( commands: List[Type[royalnet.commands.command.Command]], database_config: royalnet.database.databaseconfig.DatabaseConfig )
+Create an royalnet.database.Alchemy
with the tables required by the commands. Then,
+find the chain that links the master_table
to the identity_table
.
+
+
+
+
+_init_royalnet
( royalnet_config: royalnet.network.royalnetconfig.RoyalnetConfig )
+Create a royalnet.network.RoyalnetLink
, and run it as a asyncio.Task
.
+
+
+
+
+_interface_factory
( ) → Type[royalnet.commands.commandinterface.CommandInterface]
+
+
+
+
+async _network_handler
( request_dict: dict ) → dict
+Handle a single dict
received from the royalnet.network.RoyalnetLink
.
+
+Returns
+Another dict
, formatted as a royalnet.network.Response
.
+
+
+
+
+
+
+interface_name
= NotImplemented
+
+
+
+
+async run
( )
+A blocking coroutine that should make the bot start listening to commands and requests.
+
+
+
+
+
+
+
Commands
+
+
+class royalnet.commands.
CommandInterface
+
+
+alchemy
= NotImplemented
+
+
+
+
+bot
= NotImplemented
+
+
+
+
+loop
= NotImplemented
+
+
+
+
+name
= NotImplemented
+
+
+
+
+async net_request
( message , destination: str ) → dict
+Send data through a royalnet.network.RoyalnetLink
and wait for a
+royalnet.network.Reply
.
+
+Parameters
+
+message β The data to be sent. Must be pickle
-able.
+destination β The destination of the request, either in UUID format or node name.
+
+
+
+
+
+
+
+prefix
= NotImplemented
+
+
+
+
+register_net_handler
( message_type: str , network_handler: Callable )
+Register a new handler for messages received through Royalnet.
+
+
+
+
+unregister_net_handler
( message_type: str )
+Remove a Royalnet handler.
+
+
+
+
+
+
+class royalnet.commands.
Command
( interface: royalnet.commands.commandinterface.CommandInterface )
+
+
+description
= NotImplemented
+A small description of the command, to be displayed when the command is being autocompleted.
+
+
+
+
+name
= NotImplemented
+The main name of the command.
+To have /example
on Telegram, the name should be example
.
+
+
+
+
+require_alchemy_tables
= {}
+A set of royalnet.database
tables that must exist for this command to work.
+
+
+
+
+async run
( args: royalnet.commands.commandargs.CommandArgs , data: royalnet.commands.commanddata.CommandData ) → None
+
+
+
+
+syntax
= ''
+The syntax of the command, to be displayed when a royalnet.error.InvalidInputError
is raised,
+in the format (required_arg) [optional_arg]
.
+
+
+
+
+
+
+class royalnet.commands.
CommandData
+
+
+async get_author
( error_if_none: bool = False )
+Try to find the identifier of the user that sent the message.
+That probably means, the database row identifying the user.
+
+Parameters
+error_if_none β Raise a royalnet.error.UnregisteredError
if this is True and the call has no author.
+
+Raises
+royalnet.error.UnregisteredError β
+
+
+
+
+
+
+async reply
( text: str ) → None
+Send a text message to the channel where the call was made.
+
+Parameters
+text β The text to be sent, possibly formatted in the weird undescribed markup that Iβm using.
+
+
+
+
+
+
+
+
+class royalnet.commands.
CommandArgs
+An interface to access the arguments of a command with ease.
+
+
+__getitem__
( item )
+Arguments can be accessed with an array notation, such as args[0]
.
+
+Raises
+royalnet.error.InvalidInputError β if the requested argument does not exist.
+
+
+
+
+
+
+joined
( * , require_at_least=0 ) → str
+Get the arguments as a space-joined string.
+
+Parameters
+require_at_least β the minimum amount of arguments required, will raise royalnet.error.InvalidInputError
if the requirement is not fullfilled.
+
+Raises
+royalnet.error.InvalidInputError β if there are less than require_at_least
arguments.
+
+Returns
+The space-joined string.
+
+
+
+
+
+
+match
( pattern: Union[str, Pattern] ) → Sequence[AnyStr]
+Match the royalnet.utils.commandargs.joined()
to a regex pattern.
+
+Parameters
+pattern β The regex pattern to be passed to re.match()
.
+
+Raises
+royalnet.error.InvalidInputError β if the pattern doesnβt match.
+
+Returns
+The matched groups, as returned by re.Match.groups()
.
+
+
+
+
+
+
+optional
( index: int , default=None )
+Get the argument at a specific index, but donβt raise an error if nothing is found, instead returning the default
value.
+
+Parameters
+
+
+Returns
+Either the argument or the default
value, defaulting to None
.
+
+
+
+
+
+
+
+
+
Database
+
Relational database classes and methods.
+
+
+class royalnet.database.
Alchemy
( database_uri: str , tables: Set )
+A wrapper around SQLAlchemy declarative that allows to use multiple databases at once while maintaining a single table-class for both of them.
+
+
+__init__
( database_uri: str , tables: Set )
+Create a new Alchemy object.
+
+Parameters
+
+
+
+
+
+
+
+_create_tables
( tables: Set )
+
+
+
+
+session_acm
( )
+Use Alchemy as a asyncronous context manager (to be used in async with statements).
+
+
+
+
+session_cm
( )
+Use Alchemy as a context manager (to be used in with statements).
+
+
+
+
+
+
+royalnet.database.
relationshiplinkchain
( starting_class , ending_class ) → Optional[tuple]
+Find the path to follow to get from the starting table to the ending table.
+
+
+
+
+class royalnet.database.
DatabaseConfig
( database_uri: str , master_table: Type , identity_table: Type , identity_column_name: str )
+The configuration to be used for the royalnet.database.Alchemy component of royalnet.bots.GenericBot .
+
+
+
+
+
Network
+
Royalnet (websocket) related classes.
+
+
+class royalnet.network.
RoyalnetLink
( master_uri: str , secret: str , link_type: str , request_handler , * , loop: asyncio.events.AbstractEventLoop = None )
+
+
+async connect
( )
+Connect to the royalnet.network.RoyalnetServer
at self.master_uri
.
+
+
+
+
+async identify
( ) → None
+
+
+
+
+async receive
( ) → royalnet.network.package.Package
+Recieve a Package
from the royalnet.network.RoyalnetServer
.
+
+Raises
+royalnet.network.royalnetlink.ConnectionClosedError β
+
+
+
+
+
+
+async request
( message , destination )
+
+
+
+
+async run
( loops: numbers.Real = inf )
+Blockingly run the Link.
+
+
+
+
+async send
( package: royalnet.network.package.Package )
+
+
+
+
+
+
+exception royalnet.network.
NetworkError
( error_data: dict , *args )
+
+
+
+
+exception royalnet.network.
NotConnectedError
+The royalnet.network.RoyalnetLink
is not connected to a royalnet.network.RoyalnetServer
.
+
+
+
+
+exception royalnet.network.
NotIdentifiedError
+The royalnet.network.RoyalnetLink
has not identified yet to a royalnet.network.RoyalnetServer
.
+
+
+
+
+class royalnet.network.
Package
( data: dict , * , source: str , destination: str , source_conv_id: Optional[str] = None , destination_conv_id: Optional[str] = None )
+A Royalnet package, the data type with which a royalnet.network.RoyalnetLink
communicates with a royalnet.network.RoyalnetServer
or another link.
+Contains info about the source and the destination.
+
+
+__init__
( data: dict , * , source: str , destination: str , source_conv_id: Optional[str] = None , destination_conv_id: Optional[str] = None )
+Create a Package.
+
+Parameters
+
+data β The data that should be sent. Usually a royalnet.network.Message
.
+source β The nid
of the node that created this Package.
+destination β The link_type
of the destination node, or alternatively, the nid
of the node. Can also be the NULL
value to send the message to nobody.
+source_conv_id β The conversation id of the node that created this package. Akin to the sequence number on IP packets.
+destination_conv_id β The conversation id of the node that this Package is a reply to.
+
+
+
+
+
+
+
+static from_dict
( d ) → royalnet.network.package.Package
+Create a Package from a dictionary.
+
+
+
+
+static from_json_bytes
( b: bytes ) → royalnet.network.package.Package
+Create a Package from UTF8-encoded JSON bytes.
+
+
+
+
+static from_json_string
( string: str ) → royalnet.network.package.Package
+Create a Package from a JSON string.
+
+
+
+
+reply
( data ) → royalnet.network.package.Package
+Reply to this Package with another Package.
+
+Parameters
+data β The data that should be sent. Usually a royalnet.network.Message
.
+
+Returns
+The reply Package.
+
+
+
+
+
+
+to_dict
( ) → dict
+Convert the Package into a dictionary.
+
+
+
+
+to_json_bytes
( ) → bytes
+Convert the Package into UTF8-encoded JSON bytes.
+
+
+
+
+to_json_string
( ) → str
+Convert the Package into a JSON string.
+
+
+
+
+
+
+class royalnet.network.
RoyalnetServer
( address: str , port: int , required_secret: str , * , loop: asyncio.events.AbstractEventLoop = None )
+
+
+find_client
( * , nid: str = None , link_type: str = None ) → List[royalnet.network.royalnetserver.ConnectedClient]
+
+
+
+
+find_destination
( package: royalnet.network.package.Package ) → List[royalnet.network.royalnetserver.ConnectedClient]
+Find a list of destinations for the package.
+
+Parameters
+package β The package to find the destination of.
+
+Returns
+A list
of ConnectedClients
to send the package to.
+
+
+
+
+
+
+async listener
( websocket: websockets.server.WebSocketServerProtocol , path )
+
+
+
+
+async route_package
( package: royalnet.network.package.Package ) → None
+Executed every time a package is received and must be routed somewhere.
+
+
+
+
+async serve
( )
+
+
+
+
+async start
( )
+
+
+
+
+
+
+class royalnet.network.
RoyalnetConfig
( master_uri: str , master_secret: str )
+
+
+
+
+exception royalnet.network.
ConnectionClosedError
+The royalnet.network.RoyalnetLink
βs connection was closed unexpectedly. The link canβt be used anymore.
+
+
+
+
+class royalnet.network.
Request
( handler: str , data: dict )
+A request sent from a royalnet.network.RoyalnetLink
to another.
+It contains the name of the requested handler, in addition to the data.
+
+
+static from_dict
( d: dict )
+
+
+
+
+to_dict
( )
+
+
+
+
+
+
+class royalnet.network.
Response
+A base class to be inherited by all other response types.
+
+
+classmethod from_dict
( d: dict ) → royalnet.network.response.Response
+Recreate the response from a received dict
.
+
+
+
+
+raise_on_error
( )
+Raise an Exception
if the Response is an error, do nothing otherwise.
+
+
+
+
+to_dict
( ) → dict
+Prepare the Response to be sent by converting it to a JSONable dict
.
+
+
+
+
+
+
+class royalnet.network.
ResponseSuccess
( data: Optional[dict] = None )
+A response to a successful royalnet.network.Request
.
+
+
+raise_on_error
( )
+Raise an Exception
if the Response is an error, do nothing otherwise.
+
+
+
+
+
+
+class royalnet.network.
ResponseError
( name: str , description: str , extra_info: Optional[dict] = None )
+A response to a invalid royalnet.network.Request
.
+
+
+raise_on_error
( )
+Raise an Exception
if the Response is an error, do nothing otherwise.
+
+
+
+
+
+
+
Utils
+
Miscellaneous useful functions and classes.
+
+
+async royalnet.utils.
asyncify
( function: Callable , *args , **kwargs )
+Convert a function into a coroutine.
+
+
Warning
+
The coroutine cannot be cancelled, and any attempts to do so will result in unexpected outputs.
+
+
+
+
+
+royalnet.utils.
safeformat
( string: str , **words: str ) → str
+str.format()
something, but ignore missing keys instead of raising an error.
+
+Parameters
+
+
+Returns
+The formatted string.
+
+
+
+
+
+
+royalnet.utils.
cdj
( class_: Any ) → dict
+Return a dict of the class attributes without the __module__
, __dict__
, __weakref__
and __doc__
keys, to be used while generating dynamically SQLAlchemy declarative table classes.
+
+Parameters
+class_ β The object that you want to dict-ify.
+
+Returns
+The class dict.
+
+
+
+
Warning
+
You canβt dict-ify classes with __slots__
!
+
+
+
+
+
+async royalnet.utils.
sleep_until
( dt: datetime.datetime ) → None
+Block the call until the specified datetime.
+
+
Warning
+
Accurate only to seconds.
+
+
+
+
+
+royalnet.utils.
plusformat
( i: int ) → str
+Convert an int
to a str
, prepending a +
if itβs greater than 0.
+
+Parameters
+i β the int
to convert.
+
+Returns
+The resulting str
.
+
+
+
+
+
+
+class royalnet.utils.
NetworkHandler
+The NetworkHandler functions are called when a specific Message type is received.
+
+
+message_type
= NotImplemented
+
+
+
+
+
+
+royalnet.utils.
andformat
( l: List[str], middle=', ', final=' and ' ) → str
+Convert a list
to a str
by adding final
between the last two elements and middle
between the others.
+
+Parameters
+
+
+Returns
+The resulting str
.
+
+
+
+
+
+
+royalnet.utils.
plusformat
( i: int ) → str
+Convert an int
to a str
, prepending a +
if itβs greater than 0.
+
+Parameters
+i β the int
to convert.
+
+Returns
+The resulting str
.
+
+
+
+
+
+
+royalnet.utils.
fileformat
( string: str ) → str
+Ensure a string can be used as a filename by replacing all non-word characters with underscores.
+
+Parameters
+string β the input string.
+
+Returns
+A valid filename string.
+
+
+
+
+
+
+royalnet.utils.
ytdldateformat
( string: Optional[str], separator: str = '-' ) → str
+Convert the weird date string returned by youtube-dl
into the YYYY-MM-DD
format.
+
+Parameters
+
+string β the input string, in the YYYYMMDD
format.
+separator β the string to add between the years, the months and the days. Defaults to -
.
+
+
+Returns
+The resulting string, in the format YYYY-MM-DD
format.
+
+
+
+
+
+
+royalnet.utils.
numberemojiformat
( l: List[str] ) → str
+
+
+
+
+royalnet.utils.
telegram_escape
( string: str ) → str
+Escape a string to be sent through Telegram, and format it using RoyalCode.
+
+
Warning
+
Currently escapes everything, even items in code blocks.
+
+
+
+
+
+royalnet.utils.
discord_escape
( string: str ) → str
+Escape a string to be sent through Discord, and format it using RoyalCode.
+
+
Warning
+
Currently escapes everything, even items in code blocks.
+
+
+
+
+
+royalnet.utils.
splitstring
( s: str , max: int ) → List[str]
+
+
+
+
+royalnet.utils.
parse_5etools_entry
( entry ) → str
+
+
+
+
+royalnet.utils.
ordinalformat
( number: int )
+
+
+
+
+
Web
+
+
+royalnet.web.
create_app
( config_obj: Type, blueprints: List[royalnet.web.royalprint.Royalprint] )
+Create a flask.Flask
application object.
+Gets the app.secret_key
from the SECRET_KEY
envvar.
+Also requires a DB_PATH
key in config_obj
to initialize the database connection.
+
+
Warning
+
The code for this class was written at 1 AM, and I have no clue of how and why it works or even if it really does work.
+Use with caution?
+
+
+Parameters
+
+
+Returns
+The created flask.Flask
.
+
+
+
+
+
+
+class royalnet.web.
Royalprint
( name , import_name , static_folder=None , static_url_path=None , template_folder=None , url_prefix=None , subdomain=None , url_defaults=None , root_path=None , required_tables: Optional[set] = None )
+An edited flask.Blueprint
containing an additional required_tables
parameter.
+
+
+
+
+
Error
+
+
+exception royalnet.error.
CurrentlyDisabledError
+This feature is temporarely disabled and is not available right now.
+
+
+
+
+exception royalnet.error.
ExternalError
+Something went wrong in a non-Royalnet component and the command execution cannot be completed.
+
+
+
+
+exception royalnet.error.
FileTooBigError
+The file to be downloaded would be too big to store; therefore, it has been skipped.
+
+
+
+
+exception royalnet.error.
InvalidConfigError
+The bot has not been configured correctly, therefore the command can not function.
+
+
+
+
+exception royalnet.error.
InvalidInputError
+The command has received invalid input and cannot complete.
+
+
+
+
+exception royalnet.error.
NoneFoundError
+The element that was being looked for was not found.
+
+
+
+
+exception royalnet.error.
RoyalnetRequestError
( error: ResponseError )
+An error was raised while handling the Royalnet request.
+This exception contains the royalnet.network.ResponseError
that was returned by the other Link.
+
+
+
+
+exception royalnet.error.
RoyalnetResponseError
+The royalnet.network.Response
that was received is invalid.
+
+
+
+
+exception royalnet.error.
TooManyFoundError
+Multiple elements matching the request were found, and only one was expected.
+
+
+
+
+exception royalnet.error.
UnregisteredError
+The command required a registered user, and the user was not registered.
+
+
+
+
+exception royalnet.error.
UnsupportedError
+The command is not supported for the specified interface.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/html/audio.html b/docs/html/audio.html
deleted file mode 100644
index 5daf13b8..00000000
--- a/docs/html/audio.html
+++ /dev/null
@@ -1,413 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- royalnet.audio — Royalnet documentation
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Royalnet
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
royalnet.audio
-
-
-
Video and audio downloading related classes, mainly used for Discord voice bots.
-
-
-class royalnet.audio.
YtdlInfo
( info: Dict[str, Any] )
-A wrapper around youtube_dl extracted info.
-
-
-__init__
( info: Dict[str, Any] )
-Create a YtdlInfo from the dict returned by the youtube_dl.YoutubeDL.extract_info()
function.
-
-
-
-
-
-_default_ytdl_args
= {'ignoreerrors': True, 'no_warnings': True, 'noplaylist': True, 'outtmpl': '%(title)s-%(id)s.%(ext)s', 'quiet': True}
-
-
-
-
-classmethod retrieve_for_url
( url , **ytdl_args ) → List[royalnet.audio.ytdlinfo.YtdlInfo]
-Fetch the info for an url through YoutubeDL.
-
-Returns
-A list
containing the infos for the requested videos.
-
-
-
-
-
-
-to_discord_embed
( ) → discord.embeds.Embed
-Return this info as a discord.Embed
.
-
-
-
-
-
-
-class royalnet.audio.
YtdlFile
( url: str , info: Optional[royalnet.audio.ytdlinfo.YtdlInfo] = None , filename: Optional[str] = None )
-Information about a youtube-dl downloaded file.
-
-
-_default_ytdl_args
= {'ignoreerrors': True, 'no_warnings': True, 'noplaylist': True, 'outtmpl': '%(epoch)s-%(title)s-%(id)s.%(ext)s', 'quiet': True}
-
-
-
-
-delete
( )
-
-
-
-
-download_file
( **ytdl_args ) → None
-
-
-
-
-classmethod download_from_url
( url: str , **ytdl_args ) → List[royalnet.audio.ytdlfile.YtdlFile]
-
-
-
-
-has_info
( ) → bool
-
-
-
-
-is_downloaded
( ) → bool
-
-
-
-
-open
( )
-
-
-
-
-update_info
( **ytdl_args ) → None
-
-
-
-
-
-
-class royalnet.audio.
FileAudioSource
( file )
-A discord.AudioSource
that uses a io.BufferedIOBase
as an input instead of memory.
-The stream should be in the usual PCM encoding.
-
-
Warning
-
This AudioSource will consume (and close) the passed stream.
-
-
-
-is_opus
( )
-This audio file isnβt Opus-encoded, but PCM-encoded.
-
-Returns
-False
.
-
-
-
-
-
-
-read
( )
-Reads 20ms worth of audio.
-If the audio is complete, then returning an empty bytes
-like object to signal this is the way to do so.
-
-
-
-
-
-
-class royalnet.audio.
YtdlDiscord
( ytdl_file: royalnet.audio.ytdlfile.YtdlFile )
-
-
-convert_to_pcm
( ) → None
-
-
-
-
-classmethod create_and_ready_from_url
( url , **ytdl_args ) → List[royalnet.audio.ytdldiscord.YtdlDiscord]
-
-
-
-
-classmethod create_from_url
( url , **ytdl_args ) → List[royalnet.audio.ytdldiscord.YtdlDiscord]
-
-
-
-
-delete
( ) → None
-
-
-
-
-property info
-
-
-
-
-pcm_available
( )
-
-
-
-
-ready_up
( )
-
-
-
-
-spawn_audiosource
( ) → royalnet.audio.fileaudiosource.FileAudioSource
-
-
-
-
-
-
-class royalnet.audio.
YtdlMp3
( ytdl_file: royalnet.audio.ytdlfile.YtdlFile )
-
-
-convert_to_mp3
( ) → None
-
-
-
-
-classmethod create_and_ready_from_url
( url , **ytdl_args ) → List[royalnet.audio.ytdlmp3.YtdlMp3]
-
-
-
-
-classmethod create_from_url
( url , **ytdl_args ) → List[royalnet.audio.ytdlmp3.YtdlMp3]
-
-
-
-
-delete
( ) → None
-
-
-
-
-property info
-
-
-
-
-pcm_available
( )
-
-
-
-
-ready_up
( )
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docs/html/bots.html b/docs/html/bots.html
deleted file mode 100644
index a17fc225..00000000
--- a/docs/html/bots.html
+++ /dev/null
@@ -1,388 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- royalnet.bots — Royalnet documentation
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Royalnet
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
royalnet.bots
-
-
-
Various bot interfaces, and a generic class to create new ones.
-
-
-class royalnet.bots.
TelegramBot
( * , telegram_config: royalnet.bots.telegram.TelegramConfig , royalnet_config: Optional[royalnet.network.royalnetconfig.RoyalnetConfig] = None , database_config: Optional[royalnet.database.databaseconfig.DatabaseConfig] = None , commands: List[Type[royalnet.commands.command.Command]] = None )
-A bot that connects to Telegram .
-
-
-_data_factory
( ) → Type[royalnet.commands.commanddata.CommandData]
-
-
-
-
-async _handle_update
( update: telegram.update.Update )
-
-
-
-
-_init_client
( )
-Create the telegram.Bot
, and set the starting offset.
-
-
-
-
-_interface_factory
( ) → Type[royalnet.commands.commandinterface.CommandInterface]
-
-
-
-
-interface_name
= 'telegram'
-
-
-
-
-async run
( )
-A blocking coroutine that should make the bot start listening to commands and requests.
-
-
-
-
-
-
-class royalnet.bots.
TelegramConfig
( token: str )
-The specific configuration to be used for royalnet.database.TelegramBot
.
-
-
-
-
-class royalnet.bots.
DiscordBot
( * , discord_config: royalnet.bots.discord.DiscordConfig , royalnet_config: Optional[royalnet.network.royalnetconfig.RoyalnetConfig] = None , database_config: Optional[royalnet.database.databaseconfig.DatabaseConfig] = None , commands: List[Type[royalnet.commands.command.Command]] = None )
-A bot that connects to Discord .
-
-
-_bot_factory
( ) → Type[discord.client.Client]
-Create a custom DiscordClient class inheriting from discord.Client
.
-
-
-
-
-_data_factory
( ) → Type[royalnet.commands.commanddata.CommandData]
-
-
-
-
-_init_client
( )
-Create an instance of the DiscordClient class created in royalnet.bots.DiscordBot._bot_factory()
.
-
-
-
-
-_init_voice
( )
-Initialize the variables needed for the connection to voice chat.
-
-
-
-
-_interface_factory
( ) → Type[royalnet.commands.commandinterface.CommandInterface]
-
-
-
-
-async add_to_music_data
( dfiles: List[royalnet.audio.ytdldiscord.YtdlDiscord], guild: discord.guild.Guild )
-Add a list of royalnet.audio.YtdlDiscord
to the corresponding music_data object.
-
-
-
-
-async advance_music_data
( guild: discord.guild.Guild )
-Try to play the next song, while it exists. Otherwise, just return.
-
-
-
-
-interface_name
= 'discord'
-
-
-
-
-async run
( )
-Login to Discord, then run the bot.
-
-
-
-
-async update_activity_with_source_title
( )
-Change the botβs presence (using discord.Client.change_presence()
) to match the current listening status.
-If multiple guilds are using the bot, the bot will always have an empty presence.
-
-
-
-
-
-
-class royalnet.bots.
DiscordConfig
( token: str )
-The specific configuration to be used for royalnet.bots.DiscordBot
.
-
-
-
-
-class royalnet.bots.
GenericBot
( * , royalnet_config: Optional[royalnet.network.royalnetconfig.RoyalnetConfig] = None , database_config: Optional[royalnet.database.databaseconfig.DatabaseConfig] = None , commands: List[Type[royalnet.commands.command.Command]] = None , loop: asyncio.events.AbstractEventLoop = None )
-A generic bot class, to be used as base for the other more specific classes, such as
-royalnet.bots.TelegramBot and royalnet.bots.DiscordBot .
-
-
-_data_factory
( ) → Type[royalnet.commands.commanddata.CommandData]
-
-
-
-
-_init_commands
( commands: List[Type[royalnet.commands.command.Command]] ) → None
-Generate the commands
dictionary required to handle incoming messages, and the network_handlers
-dictionary required to handle incoming requests.
-
-
-
-
-_init_database
( commands: List[Type[royalnet.commands.command.Command]], database_config: royalnet.database.databaseconfig.DatabaseConfig )
-Create an royalnet.database.Alchemy
with the tables required by the commands. Then,
-find the chain that links the master_table
to the identity_table
.
-
-
-
-
-_init_royalnet
( royalnet_config: royalnet.network.royalnetconfig.RoyalnetConfig )
-Create a royalnet.network.RoyalnetLink
, and run it as a asyncio.Task
.
-
-
-
-
-_interface_factory
( ) → Type[royalnet.commands.commandinterface.CommandInterface]
-
-
-
-
-async _network_handler
( request_dict: dict ) → dict
-Handle a single dict
received from the royalnet.network.RoyalnetLink
.
-
-Returns
-Another dict
, formatted as a royalnet.network.Response
.
-
-
-
-
-
-
-interface_name
= NotImplemented
-
-
-
-
-async run
( )
-A blocking coroutine that should make the bot start listening to commands and requests.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docs/html/commands.html b/docs/html/commands.html
deleted file mode 100644
index ec17e7a9..00000000
--- a/docs/html/commands.html
+++ /dev/null
@@ -1,288 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- royalnet.commands — Royalnet documentation
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Royalnet
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
royalnet.commands
-
-
-
-
-class royalnet.commands.
CommandArgs
-An interface to access the arguments of a command with ease.
-
-
-__getitem__
( item )
-Arguments can be accessed with an array notation, such as args[0]
.
-
-Raises
-royalnet.error.InvalidInputError β if the requested argument does not exist.
-
-
-
-
-
-
-__weakref__
-list of weak references to the object (if defined)
-
-
-
-
-joined
( * , require_at_least=0 ) → str
-Get the arguments as a space-joined string.
-
-Parameters
-require_at_least β the minimum amount of arguments required, will raise royalnet.error.InvalidInputError
if the requirement is not fullfilled.
-
-Raises
-royalnet.error.InvalidInputError β if there are less than require_at_least
arguments.
-
-Returns
-The space-joined string.
-
-
-
-
-
-
-match
( pattern: Union[str, Pattern] ) → Sequence[AnyStr]
-Match the royalnet.utils.commandargs.joined()
to a regex pattern.
-
-Parameters
-pattern β The regex pattern to be passed to re.match()
.
-
-Raises
-royalnet.error.InvalidInputError β if the pattern doesnβt match.
-
-Returns
-The matched groups, as returned by re.Match.groups()
.
-
-
-
-
-
-
-optional
( index: int , default=None )
-Get the argument at a specific index, but donβt raise an error if nothing is found, instead returning the default
value.
-
-Parameters
-
-
-Returns
-Either the argument or the default
value, defaulting to None
.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docs/html/creatingacommand.html b/docs/html/creatingacommand.html
new file mode 100644
index 00000000..e8fbdd6c
--- /dev/null
+++ b/docs/html/creatingacommand.html
@@ -0,0 +1,263 @@
+
+
+
+
+
+
+
+
+
+
+ Royalnet Commands — Royalnet documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Royalnet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Royalnet Commands
+
A Royalnet Command is a small script that is run whenever a specific message is sent to a Royalnet interface.
+
A Command code looks like this:
+
from royalnet.commands import Command
+
+class PingCommand ( Command ):
+ name = "ping"
+
+ description = "Play ping-pong with the bot."
+
+ def __init__ ( self , interface ):
+ # This code is run just once, while the bot is starting
+ super () . __init__ ()
+
+ async def run ( self , args , data ):
+ # This code is run every time the command is called
+ await data . reply ( "Pong!" )
+
+
+
+
Creating a new Command
+
First, think of a name
for your command.
+Itβs the name your command will be called with: for example, the βspaghettiβ command will be called by typing /spaghetti in chat.
+Try to keep the name as short as possible, while staying specific enough so no other command will have the same name.
+
Next, create a new Python file with the name
you have thought of.
+The previously mentioned βspaghettiβ command should have a file called spaghetti.py
.
+
Then, in the first row of the file, import the Command
class from royalnet
, and create a new class inheriting from it:
+
from royalnet.commands import Command
+
+class SpaghettiCommand ( Command ):
+ ...
+
+
+
Inside the class, override the attributes name
and description
with respectively the name of the command and a small description of what the command will do :
+
from royalnet.commands import Command
+
+class SpaghettiCommand ( Command ):
+ name = "spaghetti"
+
+ description = "Send a spaghetti emoji in the chat."
+
+
+
Now override the Command.run()
method, adding the code you want the bot to run when the command is called.
+
To send a message in the chat the command was called in, you can use the CommandData.reply()
method:
+
from royalnet.commands import Command
+
+class SpaghettiCommand ( Command ):
+ name = "spaghetti"
+
+ description = "Send a spaghetti emoji in the chat."
+
+ async def run ( self , args , data ):
+ data . reply ( "π" )
+
+
+
And itβs done! The command is now ready to be used in a bot!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/html/database.html b/docs/html/database.html
deleted file mode 100644
index 301eef29..00000000
--- a/docs/html/database.html
+++ /dev/null
@@ -1,738 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- royalnet.database — Royalnet documentation
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Royalnet
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
royalnet.database
-
-
-
Relational database classes and methods.
-
-
-class royalnet.database.
Alchemy
( database_uri: str , tables: Set )
-A wrapper around SQLAlchemy declarative that allows to use multiple databases at once while maintaining a single table-class for both of them.
-
-
-__init__
( database_uri: str , tables: Set )
-Create a new Alchemy object.
-
-Parameters
-
-
-
-
-
-
-
-_create_tables
( tables: Set )
-
-
-
-
-session_acm
( )
-Use Alchemy as a asyncronous context manager (to be used in async with statements).
-
-
-
-
-session_cm
( )
-Use Alchemy as a context manager (to be used in with statements).
-
-
-
-
-
-
-royalnet.database.
relationshiplinkchain
( starting_class , ending_class ) → Optional[tuple]
-Find the path to follow to get from the starting table to the ending table.
-
-
-
-
-class royalnet.database.
DatabaseConfig
( database_uri: str , master_table: Type , identity_table: Type , identity_column_name: str )
-The configuration to be used for the royalnet.database.Alchemy component of royalnet.bots.GenericBot .
-
-
-
-
Tables
-
-
-class royalnet.database.tables.
Royal
-
-
-avatar
= Column(None, LargeBinary(), table=None)
-
-
-
-
-password
= Column(None, LargeBinary(), table=None)
-
-
-
-
-role
= Column(None, String(), table=None, nullable=False)
-
-
-
-
-uid
= Column(None, Integer(), table=None, primary_key=True, nullable=False)
-
-
-
-
-username
= Column(None, String(), table=None, nullable=False)
-
-
-
-
-
-
-class royalnet.database.tables.
Telegram
-
-
-first_name
= Column(None, String(), table=None)
-
-
-
-
-last_name
= Column(None, String(), table=None)
-
-
-
-
-mention
( ) → str
-
-
-
-
-royal
= <RelationshipProperty at 0x77b4108; no key>
-
-
-
-
-royal_id
= Column(None, Integer(), ForeignKey('royals.uid'), table=None)
-
-
-
-
-tg_id
= Column(None, BigInteger(), table=None, primary_key=True, nullable=False)
-
-
-
-
-username
= Column(None, String(), table=None)
-
-
-
-
-
-
-class royalnet.database.tables.
Diario
-
-
-context
= Column(None, Text(), table=None)
-
-
-
-
-creator
= <RelationshipProperty at 0x77b4348; no key>
-
-
-
-
-creator_id
= Column(None, Integer(), ForeignKey('royals.uid'), table=None)
-
-
-
-
-diario_id
= Column(None, Integer(), table=None, primary_key=True, nullable=False)
-
-
-
-
-media_url
= Column(None, String(), table=None)
-
-
-
-
-quoted
= Column(None, String(), table=None)
-
-
-
-
-quoted_account
= <RelationshipProperty at 0x77b45d0; no key>
-
-
-
-
-quoted_account_id
= Column(None, Integer(), ForeignKey('royals.uid'), table=None)
-
-
-
-
-spoiler
= Column(None, Boolean(), table=None, default=ColumnDefault(False))
-
-
-
-
-text
= Column(None, Text(), table=None)
-
-
-
-
-timestamp
= Column(None, DateTime(), table=None, nullable=False)
-
-
-
-
-
-
-class royalnet.database.tables.
Alias
-
-
-alias
= Column(None, String(), table=None, primary_key=True, nullable=False)
-
-
-
-
-royal
= <RelationshipProperty at 0x77b4300; no key>
-
-
-
-
-royal_id
= Column(None, Integer(), ForeignKey('royals.uid'), table=None)
-
-
-
-
-
-
-class royalnet.database.tables.
ActiveKvGroup
-
-
-group
= <RelationshipProperty at 0x7733f18; no key>
-
-
-
-
-group_name
= Column(None, String(), ForeignKey('keygroups.group_name'), table=None, nullable=False)
-
-
-
-
-royal
= <RelationshipProperty at 0x77b4300; no key>
-
-
-
-
-royal_id
= Column(None, Integer(), ForeignKey('royals.uid'), table=None, primary_key=True, nullable=False)
-
-
-
-
-
-
-class royalnet.database.tables.
Keyvalue
-
-
-group
= <RelationshipProperty at 0x77b4660; no key>
-
-
-
-
-group_name
= Column(None, String(), ForeignKey('keygroups.group_name'), table=None, primary_key=True, nullable=False)
-
-
-
-
-key
= Column(None, String(), table=None, primary_key=True, nullable=False)
-
-
-
-
-value
= Column(None, String(), table=None, nullable=False)
-
-
-
-
-
-
-class royalnet.database.tables.
Keygroup
-
-
-group_name
= Column(None, String(), ForeignKey('keygroups.group_name'), table=None, primary_key=True, nullable=False)
-
-
-
-
-
-
-class royalnet.database.tables.
Discord
-
-
-avatar_hash
= Column(None, String(), table=None)
-
-
-
-
-discord_id
= Column(None, BigInteger(), table=None, primary_key=True, nullable=False)
-
-
-
-
-discriminator
= Column(None, String(), table=None)
-
-
-
-
-full_username
( )
-
-
-
-
-royal
= <RelationshipProperty at 0x77b45d0; no key>
-
-
-
-
-royal_id
= Column(None, Integer(), ForeignKey('royals.uid'), table=None)
-
-
-
-
-username
= Column(None, String(), table=None)
-
-
-
-
-
-
-class royalnet.database.tables.
WikiPage
-Wiki page properties.
-
-
Warning
-
Requires PostgreSQL!
-
-
-
-contents
= Column(None, Text(), table=None)
-
-
-
-
-css
= Column(None, String(), table=None)
-
-
-
-
-format
= Column(None, String(), table=None, nullable=False, default=ColumnDefault('markdown'))
-
-
-
-
-page_id
= Column(None, UUID(as_uuid=True), table=None, primary_key=True, nullable=False)
-
-
-
-
-property page_short_id
-
-
-
-
-title
= Column(None, String(), table=None, nullable=False)
-
-
-
-
-
-
-class royalnet.database.tables.
WikiRevision
-A wiki page revision.
-
-
Warning
-
Requires PostgreSQL!
-
-
-
-author
= <RelationshipProperty at 0x77b4738; no key>
-
-
-
-
-author_id
= Column(None, Integer(), ForeignKey('royals.uid'), table=None, nullable=False)
-
-
-
-
-diff
= Column(None, Text(), table=None)
-
-
-
-
-page
= <RelationshipProperty at 0x77b4150; no key>
-
-
-
-
-page_id
= Column(None, UUID(as_uuid=True), ForeignKey('wikipages.page_id'), table=None, nullable=False)
-
-
-
-
-reason
= Column(None, Text(), table=None)
-
-
-
-
-revision_id
= Column(None, UUID(as_uuid=True), table=None, primary_key=True, nullable=False)
-
-
-
-
-timestamp
= Column(None, DateTime(), table=None, nullable=False)
-
-
-
-
-
-
-class royalnet.database.tables.
Medal
-
-
-classes
= Column(None, String(), table=None, nullable=False, default=ColumnDefault(''))
-
-
-
-
-description
= Column(None, String(), table=None)
-
-
-
-
-icon
= Column(None, String(), table=None)
-
-
-
-
-mid
= Column(None, Integer(), table=None, primary_key=True, nullable=False)
-
-
-
-
-name
= Column(None, String(), table=None, nullable=False)
-
-
-
-
-score
= Column(None, Integer(), table=None, nullable=False)
-
-
-
-
-
-
-class royalnet.database.tables.
MedalAward
-
-
-award_id
= Column(None, Integer(), table=None, primary_key=True, nullable=False)
-
-
-
-
-date
= Column(None, DateTime(), table=None)
-
-
-
-
-medal
= <RelationshipProperty at 0x77b4858; no key>
-
-
-
-
-medal_id
= Column(None, Integer(), ForeignKey('medals.mid'), table=None, nullable=False)
-
-
-
-
-royal
= <RelationshipProperty at 0x77b43d8; no key>
-
-
-
-
-royal_id
= Column(None, Integer(), ForeignKey('royal.uid'), table=None, nullable=False)
-
-
-
-
-
-
-class royalnet.database.tables.
Bio
-
-
-contents
= Column(None, Text(), table=None, nullable=False, default=ColumnDefault(''))
-
-
-
-
-royal
= <RelationshipProperty at 0x77b4300; no key>
-
-
-
-
-royal_id
= Column(None, Integer(), ForeignKey('royals.uid'), table=None, primary_key=True, nullable=False)
-
-
-
-
-
-
-class royalnet.database.tables.
Reminder
-
-
-creator
= <RelationshipProperty at 0x77b4c00; no key>
-
-
-
-
-creator_id
= Column(None, Integer(), ForeignKey('royals.uid'), table=None)
-
-
-
-
-datetime
= Column(None, DateTime(), table=None)
-
-
-
-
-interface_data
= Column(None, LargeBinary(), table=None)
-
-
-
-
-interface_name
= Column(None, String(), table=None)
-
-
-
-
-message
= Column(None, String(), table=None)
-
-
-
-
-reminder_id
= Column(None, Integer(), table=None, primary_key=True, nullable=False)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docs/html/error.html b/docs/html/error.html
deleted file mode 100644
index 3ba76e5d..00000000
--- a/docs/html/error.html
+++ /dev/null
@@ -1,281 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- royalnet.error — Royalnet documentation
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Royalnet
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
royalnet.error
-
-
-
-
-exception royalnet.error.
CurrentlyDisabledError
-This feature is temporarely disabled and is not available right now.
-
-
-
-
-exception royalnet.error.
ExternalError
-Something went wrong in a non-Royalnet component and the command execution cannot be completed.
-
-
-
-
-exception royalnet.error.
FileTooBigError
-The file to be downloaded would be too big to store; therefore, it has been skipped.
-
-
-
-
-exception royalnet.error.
InvalidConfigError
-The bot has not been configured correctly, therefore the command can not function.
-
-
-
-
-exception royalnet.error.
InvalidInputError
-The command has received invalid input and cannot complete.
-
-
-
-
-exception royalnet.error.
NoneFoundError
-The element that was being looked for was not found.
-
-
-
-
-exception royalnet.error.
RoyalnetRequestError
( error: ResponseError )
-An error was raised while handling the Royalnet request.
-This exception contains the royalnet.network.ResponseError
that was returned by the other Link.
-
-
-
-
-exception royalnet.error.
RoyalnetResponseError
-The royalnet.network.Response
that was received is invalid.
-
-
-
-
-exception royalnet.error.
TooManyFoundError
-Multiple elements matching the request were found, and only one was expected.
-
-
-
-
-exception royalnet.error.
UnregisteredError
-The command required a registered user, and the user was not registered.
-
-
-
-
-exception royalnet.error.
UnsupportedError
-The command is not supported for the specified interface.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docs/html/genindex.html b/docs/html/genindex.html
index 3c095068..c5514b0c 100644
--- a/docs/html/genindex.html
+++ b/docs/html/genindex.html
@@ -81,14 +81,8 @@
@@ -166,82 +160,76 @@
| H
| I
| J
- | K
| L
| M
| N
| O
| P
- | Q
| R
| S
| T
| U
- | V
- | W
| Y
_
@@ -249,33 +237,19 @@
A
@@ -283,7 +257,7 @@
B
@@ -291,59 +265,41 @@
C
@@ -351,45 +307,29 @@
D
@@ -397,7 +337,7 @@
E
@@ -405,35 +345,29 @@
F
@@ -441,31 +375,19 @@
G
H
@@ -473,37 +395,31 @@
I
@@ -511,21 +427,7 @@
J
-
-K
-
@@ -533,11 +435,11 @@
L
@@ -545,27 +447,11 @@
M
@@ -573,21 +459,27 @@
N
@@ -595,11 +487,13 @@
O
@@ -607,43 +501,21 @@
P
-
-Q
-
@@ -651,124 +523,90 @@
R
@@ -777,27 +615,27 @@
S
@@ -805,43 +643,29 @@
T
@@ -849,45 +673,17 @@
U
-
-V
-
-
-W
-
@@ -895,17 +691,17 @@
Y
diff --git a/docs/html/index.html b/docs/html/index.html
index 6628248e..d829177a 100644
--- a/docs/html/index.html
+++ b/docs/html/index.html
@@ -36,7 +36,7 @@
-
+
@@ -81,14 +81,8 @@
@@ -155,32 +149,22 @@
royalnet
+
Welcome to the documentation of Royalnet!
-royalnet.audio
+Royalnet Commands
-royalnet.bots
-
-royalnet.commands
-
-royalnet.database
-
-royalnet.network
-
-royalnet.utils
-
-royalnet.error
-
-royalnet.web
@@ -202,7 +186,7 @@
diff --git a/docs/html/network.html b/docs/html/network.html
deleted file mode 100644
index b0dfa2de..00000000
--- a/docs/html/network.html
+++ /dev/null
@@ -1,470 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- royalnet.network — Royalnet documentation
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Royalnet
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
royalnet.network
-
-
-
Royalnet (websocket) related classes.
-
-
-class royalnet.network.
RoyalnetLink
( master_uri: str , secret: str , link_type: str , request_handler , * , loop: asyncio.events.AbstractEventLoop = None )
-
-
-async connect
( )
-Connect to the royalnet.network.RoyalnetServer
at self.master_uri
.
-
-
-
-
-async identify
( ) → None
-
-
-
-
-async receive
( ) → royalnet.network.package.Package
-Recieve a Package
from the royalnet.network.RoyalnetServer
.
-
-Raises
-royalnet.network.royalnetlink.ConnectionClosedError β
-
-
-
-
-
-
-async request
( message , destination )
-
-
-
-
-async run
( loops: numbers.Real = inf )
-Blockingly run the Link.
-
-
-
-
-async send
( package: royalnet.network.package.Package )
-
-
-
-
-
-
-exception royalnet.network.
NetworkError
( error_data: dict , *args )
-
-
-
-
-exception royalnet.network.
NotConnectedError
-The royalnet.network.RoyalnetLink
is not connected to a royalnet.network.RoyalnetServer
.
-
-
-
-
-exception royalnet.network.
NotIdentifiedError
-The royalnet.network.RoyalnetLink
has not identified yet to a royalnet.network.RoyalnetServer
.
-
-
-
-
-class royalnet.network.
Package
( data: dict , * , source: str , destination: str , source_conv_id: Optional[str] = None , destination_conv_id: Optional[str] = None )
-A Royalnet package, the data type with which a royalnet.network.RoyalnetLink
communicates with a royalnet.network.RoyalnetServer
or another link.
-Contains info about the source and the destination.
-
-
-__init__
( data: dict , * , source: str , destination: str , source_conv_id: Optional[str] = None , destination_conv_id: Optional[str] = None )
-Create a Package.
-
-Parameters
-
-data β The data that should be sent. Usually a royalnet.network.Message
.
-source β The nid
of the node that created this Package.
-destination β The link_type
of the destination node, or alternatively, the nid
of the node. Can also be the NULL
value to send the message to nobody.
-source_conv_id β The conversation id of the node that created this package. Akin to the sequence number on IP packets.
-destination_conv_id β The conversation id of the node that this Package is a reply to.
-
-
-
-
-
-
-
-static from_dict
( d ) → royalnet.network.package.Package
-Create a Package from a dictionary.
-
-
-
-
-static from_json_bytes
( b: bytes ) → royalnet.network.package.Package
-Create a Package from UTF8-encoded JSON bytes.
-
-
-
-
-static from_json_string
( string: str ) → royalnet.network.package.Package
-Create a Package from a JSON string.
-
-
-
-
-reply
( data ) → royalnet.network.package.Package
-Reply to this Package with another Package.
-
-Parameters
-data β The data that should be sent. Usually a royalnet.network.Message
.
-
-Returns
-The reply Package.
-
-
-
-
-
-
-to_dict
( ) → dict
-Convert the Package into a dictionary.
-
-
-
-
-to_json_bytes
( ) → bytes
-Convert the Package into UTF8-encoded JSON bytes.
-
-
-
-
-to_json_string
( ) → str
-Convert the Package into a JSON string.
-
-
-
-
-
-
-class royalnet.network.
RoyalnetServer
( address: str , port: int , required_secret: str , * , loop: asyncio.events.AbstractEventLoop = None )
-
-
-find_client
( * , nid: str = None , link_type: str = None ) → List[royalnet.network.royalnetserver.ConnectedClient]
-
-
-
-
-find_destination
( package: royalnet.network.package.Package ) → List[royalnet.network.royalnetserver.ConnectedClient]
-Find a list of destinations for the package.
-
-Parameters
-package β The package to find the destination of.
-
-Returns
-A list
of ConnectedClients
to send the package to.
-
-
-
-
-
-
-async listener
( websocket: websockets.server.WebSocketServerProtocol , path )
-
-
-
-
-async route_package
( package: royalnet.network.package.Package ) → None
-Executed every time a package is received and must be routed somewhere.
-
-
-
-
-async serve
( )
-
-
-
-
-async start
( )
-
-
-
-
-
-
-class royalnet.network.
RoyalnetConfig
( master_uri: str , master_secret: str )
-
-
-
-
-exception royalnet.network.
ConnectionClosedError
-The royalnet.network.RoyalnetLink
βs connection was closed unexpectedly. The link canβt be used anymore.
-
-
-
-
-class royalnet.network.
Request
( handler: str , data: dict )
-A request sent from a royalnet.network.RoyalnetLink
to another.
-It contains the name of the requested handler, in addition to the data.
-
-
-static from_dict
( d: dict )
-
-
-
-
-to_dict
( )
-
-
-
-
-
-
-class royalnet.network.
Response
-A base class to be inherited by all other response types.
-
-
-classmethod from_dict
( d: dict ) → royalnet.network.response.Response
-Recreate the response from a received dict
.
-
-
-
-
-raise_on_error
( )
-Raise an Exception
if the Response is an error, do nothing otherwise.
-
-
-
-
-to_dict
( ) → dict
-Prepare the Response to be sent by converting it to a JSONable dict
.
-
-
-
-
-
-
-class royalnet.network.
ResponseSuccess
( data: Optional[dict] = None )
-A response to a successful royalnet.network.Request
.
-
-
-raise_on_error
( )
-Raise an Exception
if the Response is an error, do nothing otherwise.
-
-
-
-
-
-
-class royalnet.network.
ResponseError
( name: str , description: str , extra_info: Optional[dict] = None )
-A response to a invalid royalnet.network.Request
.
-
-
-raise_on_error
( )
-Raise an Exception
if the Response is an error, do nothing otherwise.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docs/html/objects.inv b/docs/html/objects.inv
index 64d1bbf9..2f26b5be 100644
Binary files a/docs/html/objects.inv and b/docs/html/objects.inv differ
diff --git a/docs/html/py-modindex.html b/docs/html/py-modindex.html
index 2371ece6..cd0154a6 100644
--- a/docs/html/py-modindex.html
+++ b/docs/html/py-modindex.html
@@ -83,14 +83,8 @@
@@ -171,52 +165,42 @@
- royalnet.audio
+ royalnet.audio
- royalnet.bots
+ royalnet.bots
- royalnet.commands
+ royalnet.commands
- royalnet.database
+ royalnet.database
- royalnet.database.tables
+ royalnet.error
- royalnet.error
+ royalnet.network
- royalnet.network
+ royalnet.utils
- royalnet.utils
-
-
-
-
- royalnet.web
-
-
-
-
- royalnet.web.royalprints
+ royalnet.web
diff --git a/docs/html/search.html b/docs/html/search.html
index dafeafb1..1ebf0a1d 100644
--- a/docs/html/search.html
+++ b/docs/html/search.html
@@ -81,14 +81,8 @@
diff --git a/docs/html/searchindex.js b/docs/html/searchindex.js
index 192f2217..1c10fd38 100644
--- a/docs/html/searchindex.js
+++ b/docs/html/searchindex.js
@@ -1 +1 @@
-Search.setIndex({docnames:["audio","bots","commands","database","error","index","network","utils","web"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,"sphinx.ext.intersphinx":1,sphinx:56},filenames:["audio.rst","bots.rst","commands.rst","database.rst","error.rst","index.rst","network.rst","utils.rst","web.rst"],objects:{"royalnet.audio":{FileAudioSource:[0,1,1,""],YtdlDiscord:[0,1,1,""],YtdlFile:[0,1,1,""],YtdlInfo:[0,1,1,""],YtdlMp3:[0,1,1,""]},"royalnet.audio.FileAudioSource":{is_opus:[0,2,1,""],read:[0,2,1,""]},"royalnet.audio.YtdlDiscord":{"delete":[0,2,1,""],convert_to_pcm:[0,2,1,""],create_and_ready_from_url:[0,2,1,""],create_from_url:[0,2,1,""],info:[0,2,1,""],pcm_available:[0,2,1,""],ready_up:[0,2,1,""],spawn_audiosource:[0,2,1,""]},"royalnet.audio.YtdlFile":{"delete":[0,2,1,""],_default_ytdl_args:[0,3,1,""],download_file:[0,2,1,""],download_from_url:[0,2,1,""],has_info:[0,2,1,""],is_downloaded:[0,2,1,""],open:[0,2,1,""],update_info:[0,2,1,""]},"royalnet.audio.YtdlInfo":{__init__:[0,2,1,""],_default_ytdl_args:[0,3,1,""],retrieve_for_url:[0,2,1,""],to_discord_embed:[0,2,1,""]},"royalnet.audio.YtdlMp3":{"delete":[0,2,1,""],convert_to_mp3:[0,2,1,""],create_and_ready_from_url:[0,2,1,""],create_from_url:[0,2,1,""],info:[0,2,1,""],pcm_available:[0,2,1,""],ready_up:[0,2,1,""]},"royalnet.bots":{DiscordBot:[1,1,1,""],DiscordConfig:[1,1,1,""],GenericBot:[1,1,1,""],TelegramBot:[1,1,1,""],TelegramConfig:[1,1,1,""]},"royalnet.bots.DiscordBot":{_bot_factory:[1,2,1,""],_data_factory:[1,2,1,""],_init_client:[1,2,1,""],_init_voice:[1,2,1,""],_interface_factory:[1,2,1,""],add_to_music_data:[1,2,1,""],advance_music_data:[1,2,1,""],interface_name:[1,3,1,""],run:[1,2,1,""],update_activity_with_source_title:[1,2,1,""]},"royalnet.bots.GenericBot":{_data_factory:[1,2,1,""],_init_commands:[1,2,1,""],_init_database:[1,2,1,""],_init_royalnet:[1,2,1,""],_interface_factory:[1,2,1,""],_network_handler:[1,2,1,""],interface_name:[1,3,1,""],run:[1,2,1,""]},"royalnet.bots.TelegramBot":{_data_factory:[1,2,1,""],_handle_update:[1,2,1,""],_init_client:[1,2,1,""],_interface_factory:[1,2,1,""],interface_name:[1,3,1,""],run:[1,2,1,""]},"royalnet.commands":{CommandArgs:[2,1,1,""]},"royalnet.commands.CommandArgs":{__getitem__:[2,2,1,""],__weakref__:[2,3,1,""],joined:[2,2,1,""],match:[2,2,1,""],optional:[2,2,1,""]},"royalnet.database":{Alchemy:[3,1,1,""],DatabaseConfig:[3,1,1,""],relationshiplinkchain:[3,4,1,""],tables:[3,0,0,"-"]},"royalnet.database.Alchemy":{__init__:[3,2,1,""],_create_tables:[3,2,1,""],session_acm:[3,2,1,""],session_cm:[3,2,1,""]},"royalnet.database.tables":{ActiveKvGroup:[3,1,1,""],Alias:[3,1,1,""],Bio:[3,1,1,""],Diario:[3,1,1,""],Discord:[3,1,1,""],Keygroup:[3,1,1,""],Keyvalue:[3,1,1,""],Medal:[3,1,1,""],MedalAward:[3,1,1,""],Reminder:[3,1,1,""],Royal:[3,1,1,""],Telegram:[3,1,1,""],WikiPage:[3,1,1,""],WikiRevision:[3,1,1,""]},"royalnet.database.tables.ActiveKvGroup":{group:[3,3,1,""],group_name:[3,3,1,""],royal:[3,3,1,""],royal_id:[3,3,1,""]},"royalnet.database.tables.Alias":{alias:[3,3,1,""],royal:[3,3,1,""],royal_id:[3,3,1,""]},"royalnet.database.tables.Bio":{contents:[3,3,1,""],royal:[3,3,1,""],royal_id:[3,3,1,""]},"royalnet.database.tables.Diario":{context:[3,3,1,""],creator:[3,3,1,""],creator_id:[3,3,1,""],diario_id:[3,3,1,""],media_url:[3,3,1,""],quoted:[3,3,1,""],quoted_account:[3,3,1,""],quoted_account_id:[3,3,1,""],spoiler:[3,3,1,""],text:[3,3,1,""],timestamp:[3,3,1,""]},"royalnet.database.tables.Discord":{avatar_hash:[3,3,1,""],discord_id:[3,3,1,""],discriminator:[3,3,1,""],full_username:[3,2,1,""],royal:[3,3,1,""],royal_id:[3,3,1,""],username:[3,3,1,""]},"royalnet.database.tables.Keygroup":{group_name:[3,3,1,""]},"royalnet.database.tables.Keyvalue":{group:[3,3,1,""],group_name:[3,3,1,""],key:[3,3,1,""],value:[3,3,1,""]},"royalnet.database.tables.Medal":{classes:[3,3,1,""],description:[3,3,1,""],icon:[3,3,1,""],mid:[3,3,1,""],name:[3,3,1,""],score:[3,3,1,""]},"royalnet.database.tables.MedalAward":{award_id:[3,3,1,""],date:[3,3,1,""],medal:[3,3,1,""],medal_id:[3,3,1,""],royal:[3,3,1,""],royal_id:[3,3,1,""]},"royalnet.database.tables.Reminder":{creator:[3,3,1,""],creator_id:[3,3,1,""],datetime:[3,3,1,""],interface_data:[3,3,1,""],interface_name:[3,3,1,""],message:[3,3,1,""],reminder_id:[3,3,1,""]},"royalnet.database.tables.Royal":{avatar:[3,3,1,""],password:[3,3,1,""],role:[3,3,1,""],uid:[3,3,1,""],username:[3,3,1,""]},"royalnet.database.tables.Telegram":{first_name:[3,3,1,""],last_name:[3,3,1,""],mention:[3,2,1,""],royal:[3,3,1,""],royal_id:[3,3,1,""],tg_id:[3,3,1,""],username:[3,3,1,""]},"royalnet.database.tables.WikiPage":{contents:[3,3,1,""],css:[3,3,1,""],format:[3,3,1,""],page_id:[3,3,1,""],page_short_id:[3,2,1,""],title:[3,3,1,""]},"royalnet.database.tables.WikiRevision":{author:[3,3,1,""],author_id:[3,3,1,""],diff:[3,3,1,""],page:[3,3,1,""],page_id:[3,3,1,""],reason:[3,3,1,""],revision_id:[3,3,1,""],timestamp:[3,3,1,""]},"royalnet.error":{CurrentlyDisabledError:[4,5,1,""],ExternalError:[4,5,1,""],FileTooBigError:[4,5,1,""],InvalidConfigError:[4,5,1,""],InvalidInputError:[4,5,1,""],NoneFoundError:[4,5,1,""],RoyalnetRequestError:[4,5,1,""],RoyalnetResponseError:[4,5,1,""],TooManyFoundError:[4,5,1,""],UnregisteredError:[4,5,1,""],UnsupportedError:[4,5,1,""]},"royalnet.network":{ConnectionClosedError:[6,5,1,""],NetworkError:[6,5,1,""],NotConnectedError:[6,5,1,""],NotIdentifiedError:[6,5,1,""],Package:[6,1,1,""],Request:[6,1,1,""],Response:[6,1,1,""],ResponseError:[6,1,1,""],ResponseSuccess:[6,1,1,""],RoyalnetConfig:[6,1,1,""],RoyalnetLink:[6,1,1,""],RoyalnetServer:[6,1,1,""]},"royalnet.network.Package":{__init__:[6,2,1,""],from_dict:[6,2,1,""],from_json_bytes:[6,2,1,""],from_json_string:[6,2,1,""],reply:[6,2,1,""],to_dict:[6,2,1,""],to_json_bytes:[6,2,1,""],to_json_string:[6,2,1,""]},"royalnet.network.Request":{from_dict:[6,2,1,""],to_dict:[6,2,1,""]},"royalnet.network.Response":{from_dict:[6,2,1,""],raise_on_error:[6,2,1,""],to_dict:[6,2,1,""]},"royalnet.network.ResponseError":{raise_on_error:[6,2,1,""]},"royalnet.network.ResponseSuccess":{raise_on_error:[6,2,1,""]},"royalnet.network.RoyalnetLink":{connect:[6,2,1,""],identify:[6,2,1,""],receive:[6,2,1,""],request:[6,2,1,""],run:[6,2,1,""],send:[6,2,1,""]},"royalnet.network.RoyalnetServer":{find_client:[6,2,1,""],find_destination:[6,2,1,""],listener:[6,2,1,""],route_package:[6,2,1,""],serve:[6,2,1,""],start:[6,2,1,""]},"royalnet.utils":{NetworkHandler:[7,1,1,""],andformat:[7,4,1,""],asyncify:[7,4,1,""],cdj:[7,4,1,""],discord_escape:[7,4,1,""],fileformat:[7,4,1,""],numberemojiformat:[7,4,1,""],plusformat:[7,4,1,""],safeformat:[7,4,1,""],sleep_until:[7,4,1,""],telegram_escape:[7,4,1,""],ytdldateformat:[7,4,1,""]},"royalnet.utils.NetworkHandler":{message_type:[7,3,1,""]},"royalnet.web":{Royalprint:[8,1,1,""],create_app:[8,4,1,""],royalprints:[8,0,0,"-"]},royalnet:{audio:[0,0,0,"-"],bots:[1,0,0,"-"],commands:[2,0,0,"-"],database:[3,0,0,"-"],error:[4,0,0,"-"],network:[6,0,0,"-"],utils:[7,0,0,"-"],web:[8,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","attribute","Python attribute"],"4":["py","function","Python function"],"5":["py","exception","Python exception"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:attribute","4":"py:function","5":"py:exception"},terms:{"0x7733f18":3,"0x77b4108":3,"0x77b4150":3,"0x77b4300":3,"0x77b4348":3,"0x77b43d8":3,"0x77b45d0":3,"0x77b4660":3,"0x77b4738":3,"0x77b4858":3,"0x77b4c00":3,"20m":0,"boolean":3,"byte":[0,6],"class":[0,1,2,3,6,7,8],"default":[2,3,7],"final":7,"function":[0,4,7],"int":[2,6,7],"new":[1,3],"null":6,"return":[0,1,2,4,6,7,8],"static":6,"true":[0,3],"try":1,"while":[1,3,4,7],The:[0,1,2,3,4,6,7,8],Then:1,Use:[3,8],__dict__:7,__doc__:7,__getitem__:2,__init__:[0,3,6],__module__:7,__slots__:7,__weakref__:[2,7],_bot_factori:1,_create_t:3,_data_factori:1,_default_ytdl_arg:0,_handle_upd:1,_init_cli:1,_init_command:1,_init_databas:1,_init_royalnet:1,_init_voic:1,_interface_factori:1,_network_handl:1,about:[0,6],abstracteventloop:[1,6],access:2,accur:7,activekvgroup:3,add:[1,7],add_to_music_data:1,added:7,adding:7,addit:[6,8],address:6,advance_music_data:1,akin:6,alchemi:[1,3],alia:3,all:[6,7],allow:3,also:[6,8],altern:6,alwai:1,amount:2,andformat:7,ani:[0,7],anoth:[1,6],anymor:6,anystr:2,app:8,applic:8,arg:[2,6,7],argument:2,around:[0,3],arrai:2,as_uuid:3,async:[1,3,6,7],asyncifi:7,asyncio:[1,6],asyncron:3,attempt:7,attribut:7,audio:[1,5],audiosourc:0,author:3,author_id:3,avail:4,avatar:3,avatar_hash:3,award_id:3,base:[1,6,7],been:4,being:4,between:7,big:4,biginteg:3,bio:3,block:[1,7],blockingli:6,blueprint:8,bool:0,bot:[0,3,4,5],both:3,bufferediobas:0,call:7,callabl:7,can:[2,4,6,7,8],cancel:7,cannot:[4,7],caution:8,cdj:7,chain:1,chang:1,change_pres:1,charact:7,chat:1,check:3,class_:7,classmethod:[0,6],client:1,close:[0,6],clue:8,code:[7,8],column:3,columndefault:3,command:[1,4,5],commandarg:2,commanddata:1,commandinterfac:1,commun:6,complet:[0,4],compon:[3,4],config:8,config_obj:8,configur:[1,3,4],connect:[1,6,8],connectedcli:6,connectionclosederror:6,consum:0,contain:[0,4,6,8],content:3,context:3,convers:6,convert:[6,7],convert_to_mp3:0,convert_to_pcm:0,core:3,coroutin:[1,7],correctli:4,correspond:1,creat:[0,1,3,6,8],create_and_ready_from_url:0,create_app:8,create_from_url:0,creator:3,creator_id:3,css:3,current:[1,7],currentlydisablederror:4,custom:1,dai:7,data:6,databas:[1,5,8],database_config:1,database_uri:3,databaseconfig:[1,3],date:[3,7],datetim:[3,7],db_path:8,declar:[3,7],defin:2,delet:0,describ:3,descript:[3,6],destin:6,destination_conv_id:6,detail:3,dfile:1,diario:3,diario_id:3,dict:[0,1,6,7],dictionari:[1,6],diff:3,disabl:4,discord:[0,1,3,7],discord_config:1,discord_escap:7,discord_id:3,discordbot:1,discordcli:1,discordconfig:1,discrimin:3,doc:3,doe:[0,2,8],doesn:2,don:2,download:[0,4],download_fil:0,download_from_url:0,dynam:7,eas:2,edit:8,either:2,element:[4,7],emb:0,empti:[0,1],encod:[0,6],end:3,ending_class:3,engin:3,ensur:7,envvar:8,epoch:0,error:[2,5,6,7],error_data:6,escap:7,even:[7,8],event:[1,6],everi:6,everyth:7,except:[4,6],execut:[4,6],exist:[1,2],expect:4,ext:0,externalerror:4,extra_info:6,extract:0,extract_info:0,fals:[0,3],featur:4,fetch:0,file:[0,4],fileaudiosourc:0,fileformat:7,filenam:[0,7],filetoobigerror:4,find:[1,3,6],find_client:6,find_destin:6,first_nam:3,flask:8,follow:3,foreignkei:3,format:[1,3,7],found:[2,4],from:[0,1,3,6,8],from_dict:6,from_json_byt:6,from_json_str:6,from_object:8,full_usernam:3,fullfil:2,gener:[1,7],genericbot:[1,3],get:[2,3,8],github:5,greater:7,group:[2,3],group_nam:3,guild:1,handl:[1,4],handler:6,has:[4,6],has_info:0,have:[1,8],how:8,html:3,http:3,icon:3,identifi:6,identity_column_nam:3,identity_t:[1,3],ifi:7,ignor:7,ignoreerror:0,import_nam:8,incom:1,index:[2,5],inf:6,info:[0,6],inform:0,inherit:[1,6],initi:[1,8],input:[0,4,7],instanc:1,instead:[0,2,7],integ:3,interfac:[1,2,4],interface_data:3,interface_nam:[1,3],invalid:[4,6],invalidconfigerror:4,invalidinputerror:[2,4],is_download:0,is_opu:0,isn:0,item:[2,7],join:2,json:6,jsonabl:6,just:1,kei:[3,7,8],keygroup:3,keyvalu:3,kwarg:7,largebinari:3,last:7,last_nam:3,less:2,like:0,link:[1,4,6],link_typ:6,list:[0,1,2,6,7,8],listen:[1,6],login:1,look:4,loop:[1,6],mainli:0,maintain:3,make:1,manag:3,markdown:3,master_secret:6,master_t:[1,3],master_uri:6,match:[1,2,4],medal:3,medal_id:3,medalaward:3,media_url:3,memori:0,mention:3,messag:[1,3,6,7],message_typ:7,method:3,mid:3,middl:7,minimum:2,miscellan:7,miss:[2,7],month:7,more:[1,3],multipl:[1,3,4],music_data:1,must:6,name:[3,6,8],need:1,network:[1,4,5],network_handl:1,networkerror:6,networkhandl:7,next:1,nid:6,no_warn:0,nobodi:6,node:6,non:[4,7],none:[0,1,2,3,6,7,8],nonefounderror:4,noplaylist:0,notat:2,notconnectederror:6,noth:[2,6],notidentifiederror:6,notimpl:[1,7],now:4,nullabl:3,number:6,numberemojiformat:7,object:[0,1,2,3,7,8],offset:1,onc:3,one:4,ones:1,onli:[4,7],open:0,option:[0,1,2,3,6,7,8],opu:0,org:3,other:[1,4,6,7],otherwis:[1,6],output:7,outtmpl:0,packag:6,packet:6,page:3,page_id:3,page_short_id:3,paramet:[2,3,6,7,8],pass:[0,2,8],password:3,path:[3,6],pattern:2,pcm:0,pcm_avail:0,plai:1,plusformat:7,port:6,postgresql:3,prepar:6,prepend:7,presenc:1,primary_kei:3,properti:[0,3],quiet:0,quot:3,quoted_account:3,quoted_account_id:3,rais:[2,4,6,7],raise_on_error:6,read:0,ready_up:0,real:6,realli:8,reason:3,receiv:[1,4,6,7],reciev:6,recreat:6,refer:2,regex:2,regist:[4,8],relat:[0,3,6],relationshiplinkchain:3,relationshipproperti:3,remind:3,reminder_id:3,replac:7,repli:6,request:[0,1,2,4,6],request_dict:1,request_handl:6,requir:[1,2,3,4,8],require_at_least:2,required_secret:6,required_t:8,respons:[1,4,6],responseerror:[4,6],responsesuccess:6,result:7,retriev:2,retrieve_for_url:0,revis:3,revision_id:3,right:4,role:3,root_path:8,rout:6,route_packag:6,royal:3,royal_id:3,royalcod:7,royalnet_config:1,royalnetconfig:[1,6],royalnetlink:[1,6],royalnetrequesterror:4,royalnetresponseerror:4,royalnetserv:6,royalprint:5,run:[1,6],safeformat:7,score:3,second:7,secret:6,secret_kei:8,select:3,self:6,send:6,sent:[6,7],separ:7,sequenc:[2,6],serv:6,server:[6,8],session_acm:3,session_cm:3,set:[1,3,8],should:[0,1,6],signal:0,singl:[1,3],skip:4,sleep_until:7,some:8,someth:[4,7],somewher:6,song:1,sourc:6,source_conv_id:6,space:2,spawn_audiosourc:0,specif:[1,2,7],specifi:[4,7],spoiler:3,sqlalchemi:[3,7],start:[1,3,6],starting_class:3,statement:3,static_fold:8,static_url_path:8,statu:1,store:4,str:[0,1,2,3,6,7],stream:0,string:[2,3,6,7],subdomain:8,submodul:3,success:6,support:4,tabl:[1,5,7],task:1,telegram:[1,3,7],telegram_config:1,telegram_escap:7,telegrambot:1,telegramconfig:1,template_fold:8,temporar:4,text:3,tg_id:3,than:[2,7],them:3,therefor:4,thi:[0,4,6,8],through:[0,7],time:6,timestamp:3,titl:[0,3],to_dict:6,to_discord_emb:0,to_json_byt:6,to_json_str:6,token:1,too:4,toomanyfounderror:4,tupl:3,two:7,type:[1,3,6,7,8],uid:3,underscor:7,unexpect:7,unexpectedli:6,union:2,unregisterederror:4,unsupportederror:4,until:7,updat:1,update_activity_with_source_titl:1,update_info:0,uri:3,url:0,url_default:8,url_prefix:8,use:[0,3],used:[0,1,3,6,7,8],useful:7,user:4,usernam:3,uses:0,using:[1,7],usual:[0,6],utf8:6,util:[2,5],uuid:3,valid:7,valu:[2,3,6],variabl:1,variou:1,video:0,voic:[0,1],wai:0,want:[2,7],weak:2,web:5,websocket:6,websocketserverprotocol:6,weird:7,went:4,were:4,when:7,which:6,why:8,wiki:3,wikipag:3,wikirevis:3,without:7,word:7,work:8,worth:0,would:4,wrapper:[0,3],written:8,wrong:4,year:7,yet:6,you:[2,7],youtub:[0,7],youtube_dl:0,youtubedl:0,ytdl_arg:0,ytdl_file:0,ytdldateformat:7,ytdldiscord:[0,1],ytdlfile:0,ytdlinfo:0,ytdlmp3:0,yyyi:7,yyyymmdd:7},titles:["royalnet.audio","royalnet.bots","royalnet.commands","royalnet.database","royalnet.error","royalnet","royalnet.network","royalnet.utils","royalnet.web"],titleterms:{audio:0,bot:1,command:2,databas:3,error:4,link:5,network:6,royalnet:[0,1,2,3,4,5,6,7,8],royalprint:8,some:5,tabl:3,useful:5,util:7,web:8}})
\ No newline at end of file
+Search.setIndex({docnames:["apireference","creatingacommand","index"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,"sphinx.ext.intersphinx":1,sphinx:56},filenames:["apireference.rst","creatingacommand.rst","index.rst"],objects:{"royalnet.audio":{FileAudioSource:[0,1,1,""],YtdlDiscord:[0,1,1,""],YtdlFile:[0,1,1,""],YtdlInfo:[0,1,1,""],YtdlMp3:[0,1,1,""]},"royalnet.audio.FileAudioSource":{is_opus:[0,2,1,""],read:[0,2,1,""]},"royalnet.audio.YtdlDiscord":{"delete":[0,2,1,""],convert_to_pcm:[0,2,1,""],create_and_ready_from_url:[0,2,1,""],create_from_url:[0,2,1,""],info:[0,2,1,""],pcm_available:[0,2,1,""],ready_up:[0,2,1,""],spawn_audiosource:[0,2,1,""]},"royalnet.audio.YtdlFile":{"delete":[0,2,1,""],_default_ytdl_args:[0,3,1,""],download_file:[0,2,1,""],download_from_url:[0,2,1,""],has_info:[0,2,1,""],is_downloaded:[0,2,1,""],open:[0,2,1,""],update_info:[0,2,1,""]},"royalnet.audio.YtdlInfo":{__init__:[0,2,1,""],_default_ytdl_args:[0,3,1,""],retrieve_for_url:[0,2,1,""],to_discord_embed:[0,2,1,""]},"royalnet.audio.YtdlMp3":{"delete":[0,2,1,""],convert_to_mp3:[0,2,1,""],create_and_ready_from_url:[0,2,1,""],create_from_url:[0,2,1,""],info:[0,2,1,""],pcm_available:[0,2,1,""],ready_up:[0,2,1,""]},"royalnet.bots":{DiscordBot:[0,1,1,""],DiscordConfig:[0,1,1,""],GenericBot:[0,1,1,""],TelegramBot:[0,1,1,""],TelegramConfig:[0,1,1,""]},"royalnet.bots.DiscordBot":{_bot_factory:[0,2,1,""],_data_factory:[0,2,1,""],_init_client:[0,2,1,""],_init_voice:[0,2,1,""],_interface_factory:[0,2,1,""],add_to_music_data:[0,2,1,""],advance_music_data:[0,2,1,""],interface_name:[0,3,1,""],run:[0,2,1,""],update_activity_with_source_title:[0,2,1,""]},"royalnet.bots.GenericBot":{_data_factory:[0,2,1,""],_init_commands:[0,2,1,""],_init_database:[0,2,1,""],_init_royalnet:[0,2,1,""],_interface_factory:[0,2,1,""],_network_handler:[0,2,1,""],interface_name:[0,3,1,""],run:[0,2,1,""]},"royalnet.bots.TelegramBot":{_data_factory:[0,2,1,""],_handle_update:[0,2,1,""],_init_client:[0,2,1,""],_interface_factory:[0,2,1,""],interface_name:[0,3,1,""],run:[0,2,1,""]},"royalnet.commands":{Command:[0,1,1,""],CommandArgs:[0,1,1,""],CommandData:[0,1,1,""],CommandInterface:[0,1,1,""]},"royalnet.commands.Command":{description:[0,3,1,""],name:[0,3,1,""],require_alchemy_tables:[0,3,1,""],run:[0,2,1,""],syntax:[0,3,1,""]},"royalnet.commands.CommandArgs":{__getitem__:[0,2,1,""],joined:[0,2,1,""],match:[0,2,1,""],optional:[0,2,1,""]},"royalnet.commands.CommandData":{get_author:[0,2,1,""],reply:[0,2,1,""]},"royalnet.commands.CommandInterface":{alchemy:[0,3,1,""],bot:[0,3,1,""],loop:[0,3,1,""],name:[0,3,1,""],net_request:[0,2,1,""],prefix:[0,3,1,""],register_net_handler:[0,2,1,""],unregister_net_handler:[0,2,1,""]},"royalnet.database":{Alchemy:[0,1,1,""],DatabaseConfig:[0,1,1,""],relationshiplinkchain:[0,4,1,""]},"royalnet.database.Alchemy":{__init__:[0,2,1,""],_create_tables:[0,2,1,""],session_acm:[0,2,1,""],session_cm:[0,2,1,""]},"royalnet.error":{CurrentlyDisabledError:[0,5,1,""],ExternalError:[0,5,1,""],FileTooBigError:[0,5,1,""],InvalidConfigError:[0,5,1,""],InvalidInputError:[0,5,1,""],NoneFoundError:[0,5,1,""],RoyalnetRequestError:[0,5,1,""],RoyalnetResponseError:[0,5,1,""],TooManyFoundError:[0,5,1,""],UnregisteredError:[0,5,1,""],UnsupportedError:[0,5,1,""]},"royalnet.network":{ConnectionClosedError:[0,5,1,""],NetworkError:[0,5,1,""],NotConnectedError:[0,5,1,""],NotIdentifiedError:[0,5,1,""],Package:[0,1,1,""],Request:[0,1,1,""],Response:[0,1,1,""],ResponseError:[0,1,1,""],ResponseSuccess:[0,1,1,""],RoyalnetConfig:[0,1,1,""],RoyalnetLink:[0,1,1,""],RoyalnetServer:[0,1,1,""]},"royalnet.network.Package":{__init__:[0,2,1,""],from_dict:[0,2,1,""],from_json_bytes:[0,2,1,""],from_json_string:[0,2,1,""],reply:[0,2,1,""],to_dict:[0,2,1,""],to_json_bytes:[0,2,1,""],to_json_string:[0,2,1,""]},"royalnet.network.Request":{from_dict:[0,2,1,""],to_dict:[0,2,1,""]},"royalnet.network.Response":{from_dict:[0,2,1,""],raise_on_error:[0,2,1,""],to_dict:[0,2,1,""]},"royalnet.network.ResponseError":{raise_on_error:[0,2,1,""]},"royalnet.network.ResponseSuccess":{raise_on_error:[0,2,1,""]},"royalnet.network.RoyalnetLink":{connect:[0,2,1,""],identify:[0,2,1,""],receive:[0,2,1,""],request:[0,2,1,""],run:[0,2,1,""],send:[0,2,1,""]},"royalnet.network.RoyalnetServer":{find_client:[0,2,1,""],find_destination:[0,2,1,""],listener:[0,2,1,""],route_package:[0,2,1,""],serve:[0,2,1,""],start:[0,2,1,""]},"royalnet.utils":{NetworkHandler:[0,1,1,""],andformat:[0,4,1,""],asyncify:[0,4,1,""],cdj:[0,4,1,""],discord_escape:[0,4,1,""],fileformat:[0,4,1,""],numberemojiformat:[0,4,1,""],ordinalformat:[0,4,1,""],parse_5etools_entry:[0,4,1,""],plusformat:[0,4,1,""],safeformat:[0,4,1,""],sleep_until:[0,4,1,""],splitstring:[0,4,1,""],telegram_escape:[0,4,1,""],ytdldateformat:[0,4,1,""]},"royalnet.utils.NetworkHandler":{message_type:[0,3,1,""]},"royalnet.web":{Royalprint:[0,1,1,""],create_app:[0,4,1,""]},royalnet:{audio:[0,0,0,"-"],bots:[0,0,0,"-"],commands:[0,0,0,"-"],database:[0,0,0,"-"],error:[0,0,0,"-"],network:[0,0,0,"-"],utils:[0,0,0,"-"],web:[0,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","attribute","Python attribute"],"4":["py","function","Python function"],"5":["py","exception","Python exception"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:attribute","4":"py:function","5":"py:exception"},terms:{"20m":0,"byte":0,"class":[0,1],"default":0,"final":0,"function":0,"import":1,"int":0,"new":[0,2],"null":0,"return":0,"short":1,"static":0,"super":1,"true":0,"try":[0,1],"while":[0,1],And:1,That:0,The:[0,1],Then:[0,1],These:0,Use:0,__dict__:0,__doc__:0,__getitem__:0,__init__:[0,1],__module__:0,__slots__:0,__weakref__:0,_bot_factori:0,_create_t:0,_data_factori:0,_default_ytdl_arg:0,_handle_upd:0,_init_cli:0,_init_command:0,_init_databas:0,_init_royalnet:0,_init_voic:0,_interface_factori:0,_network_handl:0,abl:0,about:0,abstracteventloop:0,access:0,accur:0,add:0,add_to_music_data:0,added:0,adding:[0,1],addit:0,address:0,advance_music_data:0,akin:0,alchemi:0,all:0,allow:0,also:0,altern:0,alwai:0,amount:0,andformat:0,ani:0,anoth:0,anymor:0,anystr:0,api:2,app:0,applic:0,arg:[0,1],argument:0,around:0,arrai:0,async:[0,1],asyncifi:0,asyncio:0,asyncron:0,attempt:0,attribut:[0,1],audio:2,audiosourc:0,author:0,autocomplet:0,automat:0,avail:0,await:1,base:0,been:0,being:0,between:0,big:0,block:0,blockingli:0,blueprint:0,bool:0,bot:[1,2],both:0,bufferediobas:0,call:[0,1],callabl:0,can:[0,1],cancel:0,cannot:0,caution:0,cdj:0,chain:0,chang:0,change_pres:0,channel:0,charact:0,chat:[0,1],check:0,class_:0,classmethod:0,client:0,close:0,clue:0,code:[0,1],command:2,commandarg:0,commanddata:[0,1],commandinterfac:0,commun:0,complet:0,compon:0,config:0,config_obj:0,configur:0,connect:0,connectedcli:0,connectionclosederror:0,consum:0,contain:0,context:0,convers:0,convert:0,convert_to_mp3:0,convert_to_pcm:0,core:0,coroutin:0,correctli:0,correspond:0,creat:[0,2],create_and_ready_from_url:0,create_app:0,create_from_url:0,current:0,currentlydisablederror:0,custom:0,dai:0,data:[0,1],databas:2,database_config:0,database_uri:0,databaseconfig:0,date:0,datetim:0,db_path:0,declar:0,def:1,delet:0,describ:0,descript:[0,1],destin:0,destination_conv_id:0,detail:0,dfile:0,dict:0,dictionari:0,disabl:0,discord:0,discord_config:0,discord_escap:0,discordbot:0,discordcli:0,discordconfig:0,displai:0,doc:0,docstr:0,document:2,doe:0,doesn:0,don:0,done:1,download:0,download_fil:0,download_from_url:0,dynam:0,eas:0,edit:0,either:0,element:0,emb:0,emoji:1,empti:0,encod:0,end:0,ending_class:0,engin:0,enough:1,ensur:0,entri:0,envvar:0,epoch:0,error:2,error_data:0,error_if_non:0,escap:0,even:0,event:0,everi:[0,1],everyth:0,exampl:[0,1],except:0,execut:0,exist:0,expect:0,ext:0,externalerror:0,extra_info:0,extract:0,extract_info:0,fals:0,featur:0,fetch:0,file:[0,1],fileaudiosourc:0,fileformat:0,filenam:0,filetoobigerror:0,find:0,find_client:0,find_destin:0,first:1,flask:0,follow:0,format:0,found:0,from:[0,1],from_dict:0,from_json_byt:0,from_json_str:0,from_object:0,fullfil:0,gener:0,genericbot:0,get:0,get_author:0,github:2,greater:0,group:0,guild:0,handl:0,handler:0,has:0,has_info:0,have:[0,1],how:0,html:0,http:0,identifi:0,identity_column_nam:0,identity_t:0,ifi:0,ignor:0,ignoreerror:0,import_nam:0,incom:0,incomplet:0,index:[0,2],inf:0,info:0,inform:0,inherit:[0,1],initi:0,input:0,insid:1,instanc:0,instead:0,interfac:[0,1],interface_nam:0,invalid:0,invalidconfigerror:0,invalidinputerror:0,is_download:0,is_opu:0,isn:0,item:0,join:0,json:0,jsonabl:0,just:[0,1],keep:1,kei:0,kwarg:0,last:0,less:0,like:[0,1],link:0,link_typ:0,list:0,listen:0,login:0,look:[0,1],loop:0,made:0,main:0,mainli:0,maintain:0,make:0,manag:0,markup:0,master_secret:0,master_t:0,master_uri:0,match:0,max:0,mean:0,memori:0,mention:1,messag:[0,1],message_typ:0,method:[0,1],middl:0,might:0,minimum:0,miscellan:0,miss:0,month:0,more:0,multipl:0,music_data:0,must:0,name:[0,1],need:0,net_request:0,network:2,network_handl:0,networkerror:0,networkhandl:0,next:[0,1],nid:0,no_warn:0,nobodi:0,node:0,non:0,none:0,nonefounderror:0,noplaylist:0,notat:0,notconnectederror:0,noth:0,notidentifiederror:0,notimpl:0,now:[0,1],number:0,numberemojiformat:0,object:0,offset:0,onc:[0,1],one:0,ones:0,onli:0,open:0,option:0,optional_arg:0,opu:0,ordinalformat:0,org:0,other:[0,1],otherwis:0,outdat:0,output:0,outtmpl:0,overrid:1,packag:0,packet:0,page:0,paramet:0,parse_5etools_entri:0,pass:0,path:0,pattern:0,pcm:0,pcm_avail:0,pickl:0,ping:1,pingcommand:1,plai:[0,1],plusformat:0,pong:1,port:0,possibl:[0,1],prefix:0,prepar:0,prepend:0,presenc:0,previous:1,probabl:0,properti:0,python:1,quiet:0,rais:0,raise_on_error:0,read:0,readi:1,ready_up:0,real:0,realli:0,receiv:0,reciev:0,recreat:0,refer:2,regex:0,regist:0,register_net_handl:0,relat:0,relationshiplinkchain:0,remov:0,replac:0,repli:[0,1],request:0,request_dict:0,request_handl:0,requir:0,require_alchemy_t:0,require_at_least:0,required_arg:0,required_secret:0,required_t:0,respect:1,respons:0,responseerror:0,responsesuccess:0,result:0,retriev:0,retrieve_for_url:0,right:0,root_path:0,rout:0,route_packag:0,row:[0,1],royalcod:0,royalnet:0,royalnet_config:0,royalnetconfig:0,royalnetlink:0,royalnetrequesterror:0,royalnetresponseerror:0,royalnetserv:0,royalprint:0,run:[0,1],safeformat:0,same:1,script:1,second:0,secret:0,secret_kei:0,select:0,self:[0,1],send:[0,1],sent:[0,1],sentry_dsn:0,separ:0,sequenc:0,serv:0,server:0,session_acm:0,session_cm:0,set:0,should:[0,1],signal:0,singl:0,skip:0,sleep_until:0,small:[0,1],someth:0,somewher:0,song:0,sourc:0,source_conv_id:0,space:0,spaghetti:1,spaghetticommand:1,spawn_audiosourc:0,specif:[0,1],specifi:0,splitstr:0,sqlalchemi:0,stai:1,start:[0,1],starting_class:0,statement:0,static_fold:0,static_url_path:0,statu:0,store:0,str:0,stream:0,string:0,subdomain:0,submodul:0,success:0,support:0,syntax:0,tabl:0,task:0,telegram:0,telegram_config:0,telegram_escap:0,telegrambot:0,telegramconfig:0,template_fold:0,temporar:0,text:0,than:0,thei:0,them:0,therefor:0,thi:[0,1],think:1,thought:1,through:0,time:[0,1],titl:0,to_dict:0,to_discord_emb:0,to_json_byt:0,to_json_str:0,token:0,too:0,toomanyfounderror:0,tupl:0,two:0,type:[0,1],underscor:0,undescrib:0,unexpect:0,unexpectedli:0,union:0,unregister_net_handl:0,unregisterederror:0,unsupportederror:0,until:0,updat:0,update_activity_with_source_titl:0,update_info:0,uri:0,url:0,url_default:0,url_prefix:0,use:[0,1],used:[0,1],useful:0,user:0,uses:0,using:0,usual:0,utf8:0,util:2,uuid:0,valid:0,valu:0,variabl:0,variou:0,video:0,voic:0,wai:0,wait:0,want:[0,1],web:2,websocket:0,websocketserverprotocol:0,weird:0,welcom:2,went:0,were:0,what:1,when:[0,1],whenev:1,where:0,which:0,why:0,without:0,word:0,work:0,worth:0,would:0,wrapper:0,written:0,wrong:0,year:0,yet:0,you:[0,1],your:1,youtub:0,youtube_dl:0,youtubedl:0,ytdl_arg:0,ytdl_file:0,ytdldateformat:0,ytdldiscord:0,ytdlfile:0,ytdlinfo:0,ytdlmp3:0,yyyi:0,yyyymmdd:0},titles:["API Reference","Royalnet Commands","royalnet"],titleterms:{"new":1,api:0,audio:0,bot:0,command:[0,1],creat:1,databas:0,error:0,link:2,network:0,refer:0,royalnet:[1,2],some:2,useful:2,util:0,web:0}})
\ No newline at end of file
diff --git a/docs/html/utils.html b/docs/html/utils.html
deleted file mode 100644
index 4cd9f92b..00000000
--- a/docs/html/utils.html
+++ /dev/null
@@ -1,383 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- royalnet.utils — Royalnet documentation
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Royalnet
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
royalnet.utils
-
-
-
Miscellaneous useful functions and classes.
-
-
-async royalnet.utils.
asyncify
( function: Callable , *args , **kwargs )
-Convert a function into a coroutine.
-
-
Warning
-
The coroutine cannot be cancelled, and any attempts to do so will result in unexpected outputs.
-
-
-
-
-
-royalnet.utils.
safeformat
( string: str , **words: str ) → str
-str.format()
something, but ignore missing keys instead of raising an error.
-
-Parameters
-
-
-Returns
-The formatted string.
-
-
-
-
-
-
-royalnet.utils.
cdj
( class_: Any ) → dict
-Return a dict of the class attributes without the __module__
, __dict__
, __weakref__
and __doc__
keys, to be used while generating dynamically SQLAlchemy declarative table classes.
-
-Parameters
-class_ β The object that you want to dict-ify.
-
-Returns
-The class dict.
-
-
-
-
Warning
-
You canβt dict-ify classes with __slots__
!
-
-
-
-
-
-async royalnet.utils.
sleep_until
( dt: datetime.datetime ) → None
-Block the call until the specified datetime.
-
-
Warning
-
Accurate only to seconds.
-
-
-
-
-
-royalnet.utils.
plusformat
( i: int ) → str
-Convert an int
to a str
, prepending a +
if itβs greater than 0.
-
-Parameters
-i β the int
to convert.
-
-Returns
-The resulting str
.
-
-
-
-
-
-
-class royalnet.utils.
NetworkHandler
-The NetworkHandler functions are called when a specific Message type is received.
-
-
-message_type
= NotImplemented
-
-
-
-
-
-
-royalnet.utils.
andformat
( l: List[str], middle=', ', final=' and ' ) → str
-Convert a list
to a str
by adding final
between the last two elements and middle
between the others.
-
-Parameters
-
-
-Returns
-The resulting str
.
-
-
-
-
-
-
-royalnet.utils.
plusformat
( i: int ) → str
-Convert an int
to a str
, prepending a +
if itβs greater than 0.
-
-Parameters
-i β the int
to convert.
-
-Returns
-The resulting str
.
-
-
-
-
-
-
-royalnet.utils.
fileformat
( string: str ) → str
-Ensure a string can be used as a filename by replacing all non-word characters with underscores.
-
-Parameters
-string β the input string.
-
-Returns
-A valid filename string.
-
-
-
-
-
-
-royalnet.utils.
ytdldateformat
( string: Optional[str], separator: str = '-' ) → str
-Convert the weird date string returned by youtube-dl
into the YYYY-MM-DD
format.
-
-Parameters
-
-string β the input string, in the YYYYMMDD
format.
-separator β the string to add between the years, the months and the days. Defaults to -
.
-
-
-Returns
-The resulting string, in the format YYYY-MM-DD
format.
-
-
-
-
-
-
-royalnet.utils.
numberemojiformat
( l: List[str] ) → str
-
-
-
-
-royalnet.utils.
telegram_escape
( string: str ) → str
-Escape a string to be sent through Telegram, and format it using RoyalCode.
-
-
Warning
-
Currently escapes everything, even items in code blocks.
-
-
-
-
-
-royalnet.utils.
discord_escape
( string: str ) → str
-Escape a string to be sent through Discord, and format it using RoyalCode.
-
-
Warning
-
Currently escapes everything, even items in code blocks.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docs/html/web.html b/docs/html/web.html
deleted file mode 100644
index 6c5183ae..00000000
--- a/docs/html/web.html
+++ /dev/null
@@ -1,246 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- royalnet.web — Royalnet documentation
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Royalnet
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
royalnet.web
-
-
-
-
-royalnet.web.
create_app
( config_obj: Type, blueprints: List[royalnet.web.royalprint.Royalprint] )
-Create a flask.Flask
application object.
-Gets the app.secret_key
from the SECRET_KEY
envvar.
-Also requires a DB_PATH
key in config_obj
to initialize the database connection.
-
-
Warning
-
The code for this class was written at 1 AM, and I have no clue of how and why it works or even if it really does work.
-Use with caution?
-
-
-Parameters
-
-
-Returns
-The created flask.Flask
.
-
-
-
-
-
-
-class royalnet.web.
Royalprint
( name , import_name , static_folder=None , static_url_path=None , template_folder=None , url_prefix=None , subdomain=None , url_defaults=None , root_path=None , required_tables: Optional[set] = None )
-An edited flask.Blueprint
containing an additional required_tables
parameter.
-
-
-
-
Royalprints
-
Some Royalprints that can be used with the Royalnet Flask server.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docs_source/apireference.rst b/docs_source/apireference.rst
new file mode 100644
index 00000000..78f973f2
--- /dev/null
+++ b/docs_source/apireference.rst
@@ -0,0 +1,70 @@
+API Reference
+====================================
+
+These pages were automatically generated from docstrings in code.
+
+They might be outdated, or incomplete.
+
+Audio
+------------------------------------
+
+.. automodule:: royalnet.audio
+ :members:
+ :undoc-members:
+ :private-members:
+
+Bots
+------------------------------------
+
+.. automodule:: royalnet.bots
+ :members:
+ :undoc-members:
+ :private-members:
+
+Commands
+------------------------------------
+
+.. automodule:: royalnet.commands
+ :members:
+ :undoc-members:
+ :private-members:
+
+Database
+------------------------------------
+
+.. automodule:: royalnet.database
+ :members:
+ :undoc-members:
+ :private-members:
+
+Network
+------------------------------------
+
+.. automodule:: royalnet.network
+ :members:
+ :undoc-members:
+ :private-members:
+
+Utils
+------------------------------------
+
+.. automodule:: royalnet.utils
+ :members:
+ :undoc-members:
+ :private-members:
+
+Web
+------------------------------------
+
+.. automodule:: royalnet.web
+ :members:
+ :undoc-members:
+ :private-members:
+
+Error
+------------------------------------
+
+.. automodule:: royalnet.error
+ :members:
+ :undoc-members:
+ :private-members:
diff --git a/docs_source/audio.rst b/docs_source/audio.rst
deleted file mode 100644
index 1b163fe9..00000000
--- a/docs_source/audio.rst
+++ /dev/null
@@ -1,12 +0,0 @@
-royalnet.audio
-====================================
-
-.. toctree::
- :maxdepth: 2
-
-
-.. automodule:: royalnet.audio
- :members:
- :private-members:
- :undoc-members:
-
diff --git a/docs_source/bots.rst b/docs_source/bots.rst
deleted file mode 100644
index 42f1173b..00000000
--- a/docs_source/bots.rst
+++ /dev/null
@@ -1,11 +0,0 @@
-royalnet.bots
-====================================
-
-.. toctree::
- :maxdepth: 2
-
-
-.. automodule:: royalnet.bots
- :members:
- :private-members:
- :undoc-members:
diff --git a/docs_source/commands.rst b/docs_source/commands.rst
deleted file mode 100644
index 9f8befe2..00000000
--- a/docs_source/commands.rst
+++ /dev/null
@@ -1,11 +0,0 @@
-royalnet.commands
-====================================
-
-.. toctree::
- :maxdepth: 2
-
-
-.. automodule:: royalnet.commands
- :members:
- :private-members:
- :special-members:
diff --git a/docs_source/creatingacommand.rst b/docs_source/creatingacommand.rst
new file mode 100644
index 00000000..341e2437
--- /dev/null
+++ b/docs_source/creatingacommand.rst
@@ -0,0 +1,66 @@
+.. currentmodule:: royalnet.commands
+
+Royalnet Commands
+====================================
+
+A Royalnet Command is a small script that is run whenever a specific message is sent to a Royalnet interface.
+
+A Command code looks like this: ::
+
+ from royalnet.commands import Command
+
+ class PingCommand(Command):
+ name = "ping"
+
+ description = "Play ping-pong with the bot."
+
+ def __init__(self, interface):
+ # This code is run just once, while the bot is starting
+ super().__init__()
+
+ async def run(self, args, data):
+ # This code is run every time the command is called
+ await data.reply("Pong!")
+
+
+Creating a new Command
+------------------------------------
+
+First, think of a ``name`` for your command.
+It's the name your command will be called with: for example, the "spaghetti" command will be called by typing **/spaghetti** in chat.
+Try to keep the name as short as possible, while staying specific enough so no other command will have the same name.
+
+Next, create a new Python file with the ``name`` you have thought of.
+The previously mentioned "spaghetti" command should have a file called ``spaghetti.py``.
+
+Then, in the first row of the file, import the :py:class:`Command` class from :py:mod:`royalnet`, and create a new class inheriting from it: ::
+
+ from royalnet.commands import Command
+
+ class SpaghettiCommand(Command):
+ ...
+
+Inside the class, override the attributes ``name`` and ``description`` with respectively the **name of the command** and a **small description of what the command will do**: ::
+
+ from royalnet.commands import Command
+
+ class SpaghettiCommand(Command):
+ name = "spaghetti"
+
+ description = "Send a spaghetti emoji in the chat."
+
+Now override the :py:meth:`Command.run` method, adding the code you want the bot to run when the command is called.
+
+To send a message in the chat the command was called in, you can use the :py:meth:`CommandData.reply` method: ::
+
+ from royalnet.commands import Command
+
+ class SpaghettiCommand(Command):
+ name = "spaghetti"
+
+ description = "Send a spaghetti emoji in the chat."
+
+ async def run(self, args, data):
+ data.reply("π")
+
+And it's done! The command is now ready to be used in a bot!
diff --git a/docs_source/database.rst b/docs_source/database.rst
deleted file mode 100644
index 64293c67..00000000
--- a/docs_source/database.rst
+++ /dev/null
@@ -1,20 +0,0 @@
-royalnet.database
-====================================
-
-.. toctree::
- :maxdepth: 2
-
-
-.. automodule:: royalnet.database
- :members:
- :private-members:
- :undoc-members:
-
-
-Tables
-------------------------------------
-
-.. automodule:: royalnet.database.tables
- :members:
- :private-members:
- :undoc-members:
diff --git a/docs_source/error.rst b/docs_source/error.rst
deleted file mode 100644
index 044a1511..00000000
--- a/docs_source/error.rst
+++ /dev/null
@@ -1,11 +0,0 @@
-royalnet.error
-====================================
-
-.. toctree::
- :maxdepth: 2
-
-
-.. automodule:: royalnet.error
- :members:
- :private-members:
- :undoc-members:
diff --git a/docs_source/index.rst b/docs_source/index.rst
index 5e7c7391..38a3a7d3 100644
--- a/docs_source/index.rst
+++ b/docs_source/index.rst
@@ -1,17 +1,13 @@
royalnet
====================================
+Welcome to the documentation of Royalnet!
+
.. toctree::
:maxdepth: 2
- audio
- bots
- commands
- database
- network
- utils
- error
- web
+ creatingacommand
+ apireference
Some useful links
diff --git a/docs_source/network.rst b/docs_source/network.rst
deleted file mode 100644
index 5c07dbbe..00000000
--- a/docs_source/network.rst
+++ /dev/null
@@ -1,12 +0,0 @@
-royalnet.network
-====================================
-
-.. toctree::
- :maxdepth: 2
-
-
-.. automodule:: royalnet.network
- :members:
- :private-members:
- :undoc-members:
-
diff --git a/docs_source/utils.rst b/docs_source/utils.rst
deleted file mode 100644
index 1deb9cbc..00000000
--- a/docs_source/utils.rst
+++ /dev/null
@@ -1,12 +0,0 @@
-royalnet.utils
-====================================
-
-.. toctree::
- :maxdepth: 2
-
-
-.. automodule:: royalnet.utils
- :members:
- :private-members:
- :undoc-members:
-
diff --git a/docs_source/web.rst b/docs_source/web.rst
deleted file mode 100644
index cabaf108..00000000
--- a/docs_source/web.rst
+++ /dev/null
@@ -1,20 +0,0 @@
-royalnet.web
-====================================
-
-.. toctree::
- :maxdepth: 2
-
-
-.. automodule:: royalnet.web
- :members:
- :private-members:
- :undoc-members:
-
-
-Royalprints
-------------------------------------
-
-.. automodule:: royalnet.web.royalprints
- :members:
- :private-members:
- :undoc-members: