<spanid="evennia-accounts-bots"></span><h1>evennia.accounts.bots<aclass="headerlink"href="#module-evennia.accounts.bots"title="Permalink to this headline">¶</a></h1>
<p>Bots are a special child typeclasses of
Account that are controlled by the server.</p>
<dlclass="py class">
<dtid="evennia.accounts.bots.BotStarter">
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.accounts.bots.</code><codeclass="sig-name descname">BotStarter</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#BotStarter"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.BotStarter"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">at_script_creation</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#BotStarter.at_script_creation"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.BotStarter.at_script_creation"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">at_server_start</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#BotStarter.at_server_start"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.BotStarter.at_server_start"title="Permalink to this definition">¶</a></dt>
<dd><p>This hook is called after the server has started. It can be used to add
post-startup setup for Scripts without a timer component (for which at_start
<codeclass="sig-name descname">at_start</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#BotStarter.at_start"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.BotStarter.at_start"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">at_repeat</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#BotStarter.at_repeat"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.BotStarter.at_repeat"title="Permalink to this definition">¶</a></dt>
<dd><p>Called self.interval seconds to keep connection. We cannot use
the IDLE command from inside the game since the system will
not catch it (commands executed from the server side usually
has no sessions). So we update the idle counter manually here
instead. This keeps the bot getting hit by IDLE_TIMEOUT.</p>
<emclass="property">exception </em><codeclass="sig-name descname">DoesNotExist</code><aclass="headerlink"href="#evennia.accounts.bots.BotStarter.DoesNotExist"title="Permalink to this definition">¶</a></dt>
<emclass="property">exception </em><codeclass="sig-name descname">MultipleObjectsReturned</code><aclass="headerlink"href="#evennia.accounts.bots.BotStarter.MultipleObjectsReturned"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">path</code><emclass="property"> = 'evennia.accounts.bots.BotStarter'</em><aclass="headerlink"href="#evennia.accounts.bots.BotStarter.path"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">typename</code><emclass="property"> = 'BotStarter'</em><aclass="headerlink"href="#evennia.accounts.bots.BotStarter.typename"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="py class">
<dtid="evennia.accounts.bots.Bot">
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.accounts.bots.</code><codeclass="sig-name descname">Bot</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#Bot"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.Bot"title="Permalink to this definition">¶</a></dt>
<p>A Bot will start itself when the server starts (it will generally
not do so on a reload - that will be handled by the normal Portal
session resync)</p>
<dlclass="py method">
<dtid="evennia.accounts.bots.Bot.basetype_setup">
<codeclass="sig-name descname">basetype_setup</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#Bot.basetype_setup"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.Bot.basetype_setup"title="Permalink to this definition">¶</a></dt>
<dd><p>This sets up the basic properties for the bot.</p>
</dd></dl>
<dlclass="py method">
<dtid="evennia.accounts.bots.Bot.start">
<codeclass="sig-name descname">start</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#Bot.start"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.Bot.start"title="Permalink to this definition">¶</a></dt>
<dd><p>This starts the bot, whatever that may mean.</p>
</dd></dl>
<dlclass="py method">
<dtid="evennia.accounts.bots.Bot.msg">
<codeclass="sig-name descname">msg</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">text</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">from_obj</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">session</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">options</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#Bot.msg"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.Bot.msg"title="Permalink to this definition">¶</a></dt>
<dd><p>Evennia -> outgoing protocol</p>
</dd></dl>
<dlclass="py method">
<dtid="evennia.accounts.bots.Bot.execute_cmd">
<codeclass="sig-name descname">execute_cmd</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">raw_string</span></em>, <emclass="sig-param"><spanclass="n">session</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#Bot.execute_cmd"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.Bot.execute_cmd"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">at_server_shutdown</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#Bot.at_server_shutdown"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.Bot.at_server_shutdown"title="Permalink to this definition">¶</a></dt>
<dd><p>We need to handle this case manually since the shutdown may be
a reset.</p>
</dd></dl>
<dlclass="py exception">
<dtid="evennia.accounts.bots.Bot.DoesNotExist">
<emclass="property">exception </em><codeclass="sig-name descname">DoesNotExist</code><aclass="headerlink"href="#evennia.accounts.bots.Bot.DoesNotExist"title="Permalink to this definition">¶</a></dt>
<emclass="property">exception </em><codeclass="sig-name descname">MultipleObjectsReturned</code><aclass="headerlink"href="#evennia.accounts.bots.Bot.MultipleObjectsReturned"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">path</code><emclass="property"> = 'evennia.accounts.bots.Bot'</em><aclass="headerlink"href="#evennia.accounts.bots.Bot.path"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="py attribute">
<dtid="evennia.accounts.bots.Bot.typename">
<codeclass="sig-name descname">typename</code><emclass="property"> = 'Bot'</em><aclass="headerlink"href="#evennia.accounts.bots.Bot.typename"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="py class">
<dtid="evennia.accounts.bots.IRCBot">
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.accounts.bots.</code><codeclass="sig-name descname">IRCBot</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#IRCBot"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.IRCBot"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">factory_path</code><emclass="property"> = 'evennia.server.portal.irc.IRCBotFactory'</em><aclass="headerlink"href="#evennia.accounts.bots.IRCBot.factory_path"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="py method">
<dtid="evennia.accounts.bots.IRCBot.start">
<codeclass="sig-name descname">start</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">ev_channel</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">irc_botname</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">irc_channel</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">irc_network</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">irc_port</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">irc_ssl</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#IRCBot.start"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.IRCBot.start"title="Permalink to this definition">¶</a></dt>
<dd><p>Start by telling the portal to start a new session.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>ev_channel</strong> (<em>str</em>) – Key of the Evennia channel to connect to.</p></li>
<li><p><strong>irc_botname</strong> (<em>str</em>) – Name of bot to connect to irc channel. If
not set, use <strong>self.key</strong>.</p></li>
<li><p><strong>irc_channel</strong> (<em>str</em>) – Name of channel on the form <strong>#channelname</strong>.</p></li>
<li><p><strong>irc_network</strong> (<em>str</em>) – URL of the IRC network, like <strong>irc.freenode.net</strong>.</p></li>
<li><p><strong>irc_port</strong> (<em>str</em>) – Port number of the irc network, like <strong>6667</strong>.</p></li>
<li><p><strong>irc_ssl</strong> (<em>bool</em>) – Indicates whether to use SSL connection.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py method">
<dtid="evennia.accounts.bots.IRCBot.at_msg_send">
<codeclass="sig-name descname">at_msg_send</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#IRCBot.at_msg_send"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.IRCBot.at_msg_send"title="Permalink to this definition">¶</a></dt>
<dd><p>Shortcut here or we can end up in infinite loop</p>
<codeclass="sig-name descname">get_nicklist</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">caller</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#IRCBot.get_nicklist"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.IRCBot.get_nicklist"title="Permalink to this definition">¶</a></dt>
<dd><p>Retrive the nick list from the connected channel.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>caller</strong> (<em>Object</em><em> or </em><em>Account</em>) – The requester of the list. This will
be stored and echoed to when the irc network replies with the
requested info.</p>
</dd>
</dl>
<dlclass="simple">
<dt>Notes: Since the return is asynchronous, the caller is stored internally</dt><dd><p>in a list; all callers in this list will get the nick info once it
returns (it is a custom OOB inputfunc option). The callback will not
survive a reload (which should be fine, it’s very quick).</p>
</dd>
</dl>
</dd></dl>
<dlclass="py method">
<dtid="evennia.accounts.bots.IRCBot.ping">
<codeclass="sig-name descname">ping</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">caller</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#IRCBot.ping"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.IRCBot.ping"title="Permalink to this definition">¶</a></dt>
<dd><p>Fire a ping to the IRC server.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>caller</strong> (<em>Object</em><em> or </em><em>Account</em>) – The requester of the ping.</p>
</dd>
</dl>
</dd></dl>
<dlclass="py method">
<dtid="evennia.accounts.bots.IRCBot.reconnect">
<codeclass="sig-name descname">reconnect</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#IRCBot.reconnect"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.IRCBot.reconnect"title="Permalink to this definition">¶</a></dt>
<dd><p>Force a protocol-side reconnect of the client without
having to destroy/recreate the bot “account”.</p>
</dd></dl>
<dlclass="py method">
<dtid="evennia.accounts.bots.IRCBot.msg">
<codeclass="sig-name descname">msg</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">text</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#IRCBot.msg"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.IRCBot.msg"title="Permalink to this definition">¶</a></dt>
<dd><p>Takes text from connected channel (only).</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>text</strong> (<em>str</em><em>, </em><em>optional</em>) – Incoming text from channel.</p>
</dd>
<dtclass="field-even">Keyword Arguments</dt>
<ddclass="field-even"><p><strong>options</strong> (<em>dict</em>) – Options dict with the following allowed keys:
- from_channel (str): dbid of a channel this text originated from.
- from_obj (list): list of objects sending this text.</p>
</dd>
</dl>
</dd></dl>
<dlclass="py method">
<dtid="evennia.accounts.bots.IRCBot.execute_cmd">
<codeclass="sig-name descname">execute_cmd</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">session</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">txt</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#IRCBot.execute_cmd"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.IRCBot.execute_cmd"title="Permalink to this definition">¶</a></dt>
<dd><p>Take incoming data and send it to connected channel. This is
triggered by the bot_data_in Inputfunc.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>session</strong> (<aclass="reference internal"href="evennia.server.session.html#evennia.server.session.Session"title="evennia.server.session.Session"><em>Session</em></a><em>, </em><em>optional</em>) – Session responsible for this
<li><p><strong>user</strong> (<em>str</em>) – The name of the user who sent the message.</p></li>
<li><p><strong>channel</strong> (<em>str</em>) – The name of channel the message was sent to.</p></li>
<li><p><strong>type</strong> (<em>str</em>) – Nature of message. Either ‘msg’, ‘action’, ‘nicklist’
or ‘ping’.</p></li>
<li><p><strong>nicklist</strong> (<aclass="reference internal"href="evennia.contrib.game_systems.barter.barter.html#evennia.contrib.game_systems.barter.barter.TradeHandler.list"title="evennia.contrib.game_systems.barter.barter.TradeHandler.list"><em>list</em></a><em>, </em><em>optional</em>) – Set if <strong>type=’nicklist’</strong>. This is a list
of nicks returned by calling the <strong>self.get_nicklist</strong>. It must look
for a list <strong>self._nicklist_callers</strong> which will contain all callers
waiting for the nicklist.</p></li>
<li><p><strong>timings</strong> (<em>float</em><em>, </em><em>optional</em>) – Set if <strong>type=’ping’</strong>. This is the return
(in seconds) of a ping request triggered with <strong>self.ping</strong>. The
return must look for a list <strong>self._ping_callers</strong> which will contain
<emclass="property">exception </em><codeclass="sig-name descname">DoesNotExist</code><aclass="headerlink"href="#evennia.accounts.bots.IRCBot.DoesNotExist"title="Permalink to this definition">¶</a></dt>
<emclass="property">exception </em><codeclass="sig-name descname">MultipleObjectsReturned</code><aclass="headerlink"href="#evennia.accounts.bots.IRCBot.MultipleObjectsReturned"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">path</code><emclass="property"> = 'evennia.accounts.bots.IRCBot'</em><aclass="headerlink"href="#evennia.accounts.bots.IRCBot.path"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="py attribute">
<dtid="evennia.accounts.bots.IRCBot.typename">
<codeclass="sig-name descname">typename</code><emclass="property"> = 'IRCBot'</em><aclass="headerlink"href="#evennia.accounts.bots.IRCBot.typename"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="py class">
<dtid="evennia.accounts.bots.RSSBot">
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.accounts.bots.</code><codeclass="sig-name descname">RSSBot</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#RSSBot"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.RSSBot"title="Permalink to this definition">¶</a></dt>
<p>An RSS relayer. The RSS protocol itself runs a ticker to update
its feed at regular intervals.</p>
<dlclass="py method">
<dtid="evennia.accounts.bots.RSSBot.start">
<codeclass="sig-name descname">start</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">ev_channel</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">rss_url</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">rss_rate</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#RSSBot.start"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.RSSBot.start"title="Permalink to this definition">¶</a></dt>
<dd><p>Start by telling the portal to start a new RSS session</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>ev_channel</strong> (<em>str</em>) – Key of the Evennia channel to connect to.</p></li>
<li><p><strong>rss_url</strong> (<em>str</em>) – Full URL to the RSS feed to subscribe to.</p></li>
<li><p><strong>rss_rate</strong> (<em>int</em>) – How often for the feedreader to update.</p></li>
</ul>
</dd>
<dtclass="field-even">Raises</dt>
<ddclass="field-even"><p><strong>RuntimeError</strong>– If <strong>ev_channel</strong> does not exist.</p>
</dd>
</dl>
</dd></dl>
<dlclass="py method">
<dtid="evennia.accounts.bots.RSSBot.execute_cmd">
<codeclass="sig-name descname">execute_cmd</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">txt</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">session</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#RSSBot.execute_cmd"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.RSSBot.execute_cmd"title="Permalink to this definition">¶</a></dt>
<dd><p>Take incoming data and send it to connected channel. This is
triggered by the bot_data_in Inputfunc.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>session</strong> (<aclass="reference internal"href="evennia.server.session.html#evennia.server.session.Session"title="evennia.server.session.Session"><em>Session</em></a><em>, </em><em>optional</em>) – Session responsible for this
<emclass="property">exception </em><codeclass="sig-name descname">DoesNotExist</code><aclass="headerlink"href="#evennia.accounts.bots.RSSBot.DoesNotExist"title="Permalink to this definition">¶</a></dt>
<emclass="property">exception </em><codeclass="sig-name descname">MultipleObjectsReturned</code><aclass="headerlink"href="#evennia.accounts.bots.RSSBot.MultipleObjectsReturned"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">path</code><emclass="property"> = 'evennia.accounts.bots.RSSBot'</em><aclass="headerlink"href="#evennia.accounts.bots.RSSBot.path"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="py attribute">
<dtid="evennia.accounts.bots.RSSBot.typename">
<codeclass="sig-name descname">typename</code><emclass="property"> = 'RSSBot'</em><aclass="headerlink"href="#evennia.accounts.bots.RSSBot.typename"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="py class">
<dtid="evennia.accounts.bots.GrapevineBot">
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.accounts.bots.</code><codeclass="sig-name descname">GrapevineBot</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#GrapevineBot"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.GrapevineBot"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">factory_path</code><emclass="property"> = 'evennia.server.portal.grapevine.RestartingWebsocketServerFactory'</em><aclass="headerlink"href="#evennia.accounts.bots.GrapevineBot.factory_path"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="py method">
<dtid="evennia.accounts.bots.GrapevineBot.start">
<codeclass="sig-name descname">start</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">ev_channel</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">grapevine_channel</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#GrapevineBot.start"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.GrapevineBot.start"title="Permalink to this definition">¶</a></dt>
<dd><p>Start by telling the portal to connect to the grapevine network.</p>
<codeclass="sig-name descname">at_msg_send</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#GrapevineBot.at_msg_send"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.GrapevineBot.at_msg_send"title="Permalink to this definition">¶</a></dt>
<dd><p>Shortcut here or we can end up in infinite loop</p>
</dd></dl>
<dlclass="py method">
<dtid="evennia.accounts.bots.GrapevineBot.msg">
<codeclass="sig-name descname">msg</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">text</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#GrapevineBot.msg"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.GrapevineBot.msg"title="Permalink to this definition">¶</a></dt>
<dd><p>Takes text from connected channel (only).</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>text</strong> (<em>str</em><em>, </em><em>optional</em>) – Incoming text from channel.</p>
</dd>
<dtclass="field-even">Keyword Arguments</dt>
<ddclass="field-even"><p><strong>options</strong> (<em>dict</em>) – Options dict with the following allowed keys:
- from_channel (str): dbid of a channel this text originated from.
- from_obj (list): list of objects sending this text.</p>
<emclass="property">exception </em><codeclass="sig-name descname">DoesNotExist</code><aclass="headerlink"href="#evennia.accounts.bots.GrapevineBot.DoesNotExist"title="Permalink to this definition">¶</a></dt>
<emclass="property">exception </em><codeclass="sig-name descname">MultipleObjectsReturned</code><aclass="headerlink"href="#evennia.accounts.bots.GrapevineBot.MultipleObjectsReturned"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">path</code><emclass="property"> = 'evennia.accounts.bots.GrapevineBot'</em><aclass="headerlink"href="#evennia.accounts.bots.GrapevineBot.path"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">typename</code><emclass="property"> = 'GrapevineBot'</em><aclass="headerlink"href="#evennia.accounts.bots.GrapevineBot.typename"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="py class">
<dtid="evennia.accounts.bots.DiscordBot">
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.accounts.bots.</code><codeclass="sig-name descname">DiscordBot</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#DiscordBot"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.DiscordBot"title="Permalink to this definition">¶</a></dt>
<p>Discord bot relay. You will need to set up your own bot
(<aclass="reference external"href="https://discord.com/developers/applications">https://discord.com/developers/applications</a>) and add the bot token as <strong>DISCORD_BOT_TOKEN</strong> to
<codeclass="sig-name descname">factory_path</code><emclass="property"> = 'evennia.server.portal.discord.DiscordWebsocketServerFactory'</em><aclass="headerlink"href="#evennia.accounts.bots.DiscordBot.factory_path"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="py method">
<dtid="evennia.accounts.bots.DiscordBot.at_init">
<codeclass="sig-name descname">at_init</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#DiscordBot.at_init"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.DiscordBot.at_init"title="Permalink to this definition">¶</a></dt>
<dd><p>Load required channels back into memory</p>
</dd></dl>
<dlclass="py method">
<dtid="evennia.accounts.bots.DiscordBot.start">
<codeclass="sig-name descname">start</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#DiscordBot.start"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.DiscordBot.start"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">at_pre_channel_msg</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">message</span></em>, <emclass="sig-param"><spanclass="n">channel</span></em>, <emclass="sig-param"><spanclass="n">senders</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#DiscordBot.at_pre_channel_msg"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.DiscordBot.at_pre_channel_msg"title="Permalink to this definition">¶</a></dt>
<dd><p>Called by the Channel just before passing a message into <strong>channel_msg</strong>.</p>
<p>We overload this to set the channel tag prefix.</p>
<codeclass="sig-name descname">channel_msg</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">message</span></em>, <emclass="sig-param"><spanclass="n">channel</span></em>, <emclass="sig-param"><spanclass="n">senders</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">relayed</span><spanclass="o">=</span><spanclass="default_value">False</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#DiscordBot.channel_msg"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.DiscordBot.channel_msg"title="Permalink to this definition">¶</a></dt>
<dd><p>Passes channel messages received on to discord</p>
<codeclass="sig-name descname">change_nickname</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">new_nickname</span></em>, <emclass="sig-param"><spanclass="n">guild_id</span></em>, <emclass="sig-param"><spanclass="n">user_id</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#DiscordBot.change_nickname"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.DiscordBot.change_nickname"title="Permalink to this definition">¶</a></dt>
<dd><p>Changes a given user’s nickname on the given guild the bot is in.</p>
<codeclass="sig-name descname">assign_role</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">role_id</span></em>, <emclass="sig-param"><spanclass="n">guild_id</span></em>, <emclass="sig-param"><spanclass="n">user_id</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#DiscordBot.assign_role"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.DiscordBot.assign_role"title="Permalink to this definition">¶</a></dt>
<dd><p>Assigns a user the role on the given guild the bot is in.</p>
<codeclass="sig-name descname">direct_msg</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">message</span></em>, <emclass="sig-param"><spanclass="n">sender</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#DiscordBot.direct_msg"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.DiscordBot.direct_msg"title="Permalink to this definition">¶</a></dt>
<dd><p>Called when the Discord bot receives a direct message on Discord.</p>
<li><p><strong>sender</strong> (<em>tuple</em><em>) </em><em>- The Discord info for the sender in the form</em><em> (</em><em>id</em><em>, </em><em>nickname</em>) –</p></li>
<li><p><strong>sender</strong> (tuple) - The Discord info for the sender in the form <ahref="#id1"><spanclass="problematic"id="id2">**</span></a>(id, nickname) –</p></li>
<li><p><strong>- Any additional keywords. Unused by default</strong><strong>, </strong><strong>but available for adding additional</strong> (<em>kwargs</em>) – flags or parameters.</p></li>
<codeclass="sig-name descname">execute_cmd</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">txt</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">session</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">type</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">sender</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/bots.html#DiscordBot.execute_cmd"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.bots.DiscordBot.execute_cmd"title="Permalink to this definition">¶</a></dt>
<dd><p>Take incoming data from protocol and send it to connected channel. This is
<li><p><strong>type</strong> (<em>str</em><em>, </em><em>optional</em>) – the protocol pre-processed it.</p></li>
<li><p><strong>sender</strong> (<em>tuple</em>) – strings, in the form of (id, nickname)</p></li>
<li><p><strong>- Any additional data specific to a particular type of actions. The data for</strong> (<em>kwargs</em>) – any Discord actions not pre-processed by the protocol will also be passed via kwargs.</p></li>
<emclass="property">exception </em><codeclass="sig-name descname">DoesNotExist</code><aclass="headerlink"href="#evennia.accounts.bots.DiscordBot.DoesNotExist"title="Permalink to this definition">¶</a></dt>
<emclass="property">exception </em><codeclass="sig-name descname">MultipleObjectsReturned</code><aclass="headerlink"href="#evennia.accounts.bots.DiscordBot.MultipleObjectsReturned"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">path</code><emclass="property"> = 'evennia.accounts.bots.DiscordBot'</em><aclass="headerlink"href="#evennia.accounts.bots.DiscordBot.path"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">typename</code><emclass="property"> = 'DiscordBot'</em><aclass="headerlink"href="#evennia.accounts.bots.DiscordBot.typename"title="Permalink to this definition">¶</a></dt>