<dd><p>A bot that connects to <aclass="reference external"href="https://telegram.org/">Telegram</a>.</p>
<dlclass="method">
<dtid="royalnet.bots.TelegramBot._call_factory">
<codeclass="descname">_call_factory</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ Type[royalnet.utils.call.Call]<aclass="headerlink"href="#royalnet.bots.TelegramBot._call_factory"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">_handle_update</code><spanclass="sig-paren">(</span><em>update: telegram.update.Update</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.bots.TelegramBot._handle_update"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="royalnet.bots.TelegramBot._init_client">
<codeclass="descname">_init_client</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.bots.TelegramBot._init_client"title="Permalink to this definition">¶</a></dt>
<dd><p>Create the <aclass="reference external"href="https://python-telegram-bot.readthedocs.io/en/stable/telegram.bot.html#telegram.Bot"title="(in Python Telegram Bot v11.1)"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">telegram.Bot</span></code></a>, and set the starting offset.</p>
<codeclass="descname">botfather_command_string</code><aclass="headerlink"href="#royalnet.bots.TelegramBot.botfather_command_string"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="attribute">
<dtid="royalnet.bots.TelegramBot.interface_name">
<codeclass="descname">interface_name</code><emclass="property"> = 'telegram'</em><aclass="headerlink"href="#royalnet.bots.TelegramBot.interface_name"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="royalnet.bots.TelegramBot.run">
<codeclass="descname">run</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.bots.TelegramBot.run"title="Permalink to this definition">¶</a></dt>
<dd><p>A blocking coroutine that should make the bot start listening to commands and requests.</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="royalnet.bots.TelegramConfig">
<emclass="property">class </em><codeclass="descclassname">royalnet.bots.</code><codeclass="descname">TelegramConfig</code><spanclass="sig-paren">(</span><em>token: str</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.bots.TelegramConfig"title="Permalink to this definition">¶</a></dt>
<dd><p>The specific configuration to be used for <codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">royalnet.database.TelegramBot</span></code>.</p>
<dd><p>A bot that connects to <aclass="reference external"href="https://discordapp.com/">Discord</a>.</p>
<dlclass="method">
<dtid="royalnet.bots.DiscordBot._bot_factory">
<codeclass="descname">_bot_factory</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ Type[discord.client.Client]<aclass="headerlink"href="#royalnet.bots.DiscordBot._bot_factory"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">_call_factory</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ Type[royalnet.utils.call.Call]<aclass="headerlink"href="#royalnet.bots.DiscordBot._call_factory"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">_init_client</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.bots.DiscordBot._init_client"title="Permalink to this definition">¶</a></dt>
<dd><p>Create an instance of the DiscordClient class created in <codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">royalnet.bots.discord._bot_factory()</span></code>.</p>
<codeclass="descname">_init_voice</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.bots.DiscordBot._init_voice"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">add_to_music_data</code><spanclass="sig-paren">(</span><em>audio_sources: List[royalnet.audio.royalpcmaudio.RoyalPCMAudio], guild: discord.guild.Guild</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.bots.DiscordBot.add_to_music_data"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">advance_music_data</code><spanclass="sig-paren">(</span><em>guild: discord.guild.Guild</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.bots.DiscordBot.advance_music_data"title="Permalink to this definition">¶</a></dt>
<dd><p>Try to play the next song, while it exists. Otherwise, just return.</p>
</dd></dl>
<dlclass="attribute">
<dtid="royalnet.bots.DiscordBot.interface_name">
<codeclass="descname">interface_name</code><emclass="property"> = 'discord'</em><aclass="headerlink"href="#royalnet.bots.DiscordBot.interface_name"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="royalnet.bots.DiscordBot.run">
<codeclass="descname">run</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.bots.DiscordBot.run"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">update_activity_with_source_title</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.bots.DiscordBot.update_activity_with_source_title"title="Permalink to this definition">¶</a></dt>
<dd><p>Change the bot’s presence (using <codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">discord.Client.change_presence()</span></code>) to match the current listening status.</p>
<p>If multiple guilds are using the bot, the bot will always have an empty presence.</p>
<emclass="property">class </em><codeclass="descclassname">royalnet.bots.</code><codeclass="descname">DiscordConfig</code><spanclass="sig-paren">(</span><em>token: str</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.bots.DiscordConfig"title="Permalink to this definition">¶</a></dt>
<dd><p>The specific configuration to be used for <codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">royalnet.database.DiscordBot</span></code>.</p>
<dd><p>A generic bot class, to be used as base for the other more specific classes, such as <spanclass="xref std std-ref">royalnet.bots.TelegramBot</span> and <spanclass="xref std std-ref">royalnet.bots.DiscordBot</span>.</p>
<dlclass="method">
<dtid="royalnet.bots.GenericBot._call_factory">
<codeclass="descname">_call_factory</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ Type[royalnet.utils.call.Call]<aclass="headerlink"href="#royalnet.bots.GenericBot._call_factory"title="Permalink to this definition">¶</a></dt>
<dd><p>Generate the <codeclass="docutils literal notranslate"><spanclass="pre">commands</span></code> dictionary required to handle incoming messages, and the <codeclass="docutils literal notranslate"><spanclass="pre">network_handlers</span></code> dictionary required to handle incoming requests.</p>
<codeclass="descname">_init_database</code><spanclass="sig-paren">(</span><em>commands: List[Type[royalnet.utils.command.Command]], database_config: royalnet.database.databaseconfig.DatabaseConfig</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.bots.GenericBot._init_database"title="Permalink to this definition">¶</a></dt>
<dd><p>Create an <codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">royalnet.network.Alchemy</span></code> with the tables required by the commands. Then, find the chain that links the <codeclass="docutils literal notranslate"><spanclass="pre">master_table</span></code> to the <codeclass="docutils literal notranslate"><spanclass="pre">identity_table</span></code>.</p>
<codeclass="descname">_init_royalnet</code><spanclass="sig-paren">(</span><em>royalnet_config: royalnet.network.royalnetconfig.RoyalnetConfig</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.bots.GenericBot._init_royalnet"title="Permalink to this definition">¶</a></dt>
<dd><p>Create a <aclass="reference internal"href="network.html#royalnet.network.RoyalnetLink"title="royalnet.network.RoyalnetLink"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">royalnet.network.RoyalnetLink</span></code></a>, and run it as a <aclass="reference external"href="https://docs.python.org/3.7/library/asyncio-task.html#asyncio.Task"title="(in Python v3.7)"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">asyncio.Task</span></code></a>.</p>
<codeclass="descname">_network_handler</code><spanclass="sig-paren">(</span><em>message: royalnet.network.messages.Message</em><spanclass="sig-paren">)</span>→ royalnet.network.messages.Message<aclass="headerlink"href="#royalnet.bots.GenericBot._network_handler"title="Permalink to this definition">¶</a></dt>
<dd><p>Handle a single <aclass="reference internal"href="network.html#royalnet.network.Message"title="royalnet.network.Message"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">royalnet.network.Message</span></code></a> received from the <aclass="reference internal"href="network.html#royalnet.network.RoyalnetLink"title="royalnet.network.RoyalnetLink"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">royalnet.network.RoyalnetLink</span></code></a></p>
<dd><p>Call the command with the specified name.</p>
<p>If it doesn’t exist, call <codeclass="docutils literal notranslate"><spanclass="pre">self.missing_command</span></code>.</p>
<p>If an exception is raised during the execution of the command, call <codeclass="docutils literal notranslate"><spanclass="pre">self.error_command</span></code>.</p>
<codeclass="descname">interface_name</code><emclass="property"> = NotImplemented</em><aclass="headerlink"href="#royalnet.bots.GenericBot.interface_name"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="royalnet.bots.GenericBot.run">
<codeclass="descname">run</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.bots.GenericBot.run"title="Permalink to this definition">¶</a></dt>
<dd><p>A blocking coroutine that should make the bot start listening to commands and requests.</p>
Built with <ahref="http://sphinx-doc.org/">Sphinx</a> using a <ahref="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <ahref="https://readthedocs.org">Read the Docs</a>.