slidgram.command¶
Classes¶
Abstract base class to implement gateway commands (chatbot and ad-hoc) |
Module Contents¶
- class slidgram.command.JoinPublicChat(xmpp)[source]¶
Bases:
slidge.command.Command
Abstract base class to implement gateway commands (chatbot and ad-hoc)
- Parameters:
xmpp (slidge.core.gateway.BaseGateway)
- NAME = '🚪 Join a telegram chat'[source]¶
Friendly name of the command, eg: “do something with stuff”
- HELP = 'Join a public channel, private group or supergroup'[source]¶
Long description of what the command does
- CATEGORY[source]¶
If used, the command will be under this top-level category. Use the same string for several commands to group them. This hierarchy only used for the adhoc interface, not the chat command interface.
- async run(_session, _ifrom, *_args)[source]¶
Entry point of the command
- Parameters:
session – If triggered by a registered user, its slidge Session
ifrom – JID of the command-triggering entity
args – When triggered via chatbot type message, additional words after the CHAT_COMMAND string was passed
- Returns:
Either a TableResult, a Form, a Confirmation, a text, or None
- static finish(form_values, session, _ifrom)[source]¶
- Async:
- Parameters:
form_values (dict)
session (slidgram.session.Session)