From 743afcbc751b3113d2572186135d67c8783b9894 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 5 Aug 2020 02:13:25 +0200 Subject: [PATCH] Update docs accordingly --- docs_source/packs/command.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs_source/packs/command.rst b/docs_source/packs/command.rst index b1654917..97e2cfc0 100644 --- a/docs_source/packs/command.rst +++ b/docs_source/packs/command.rst @@ -14,9 +14,9 @@ A Command code looks like this: :: description = "Play ping-pong with the bot." - def __init__(self, interface): + def __init__(self, serf: "Serf", config): # This code is run just once, while the bot is starting - super().__init__() + super().__init__(serf=serf, config=config) async def run(self, args: rc.CommandArgs, data: rc.CommandData): # This code is run every time the command is called @@ -393,15 +393,15 @@ You can **call an event** from inside a command, and receive its return value. This may be used for example to get data from a different platform, such as getting the users online in a specific Discord server. -You can call an event with the :meth:`CommandInterface.call_herald_event` method: :: +You can call an event with the :meth:`Serf.call_herald_event` method: :: - result = await self.interface.call_herald_event("event_name") + result = await self.serf.call_herald_event("event_name") You can also pass parameters to the called event: :: - result = await self.interface.call_herald_event("event_name", ..., kwarg=..., *..., **...) + result = await self.serf.call_herald_event("event_name", ..., kwarg=..., *..., **...) -Errors raised by the event will also be raised by the :meth:`CommandInterface.call_herald_event` method as one of the exceptions described in the :ref:`Raising errors` section. +Errors raised by the event will also be raised by the :meth:`Serf.call_herald_event` method as one of the exceptions described in the :ref:`Raising errors` section. Displaying Keyboards ------------------------------------