1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 11:34:18 +00:00

Update docs accordingly

This commit is contained in:
Steffo 2020-08-05 02:13:25 +02:00
parent e990180743
commit 743afcbc75

View file

@ -14,9 +14,9 @@ A Command code looks like this: ::
description = "Play ping-pong with the bot." 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 # 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): async def run(self, args: rc.CommandArgs, data: rc.CommandData):
# This code is run every time the command is called # 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. 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: :: 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 Displaying Keyboards
------------------------------------ ------------------------------------