slidge.core.command.base
#
Module Contents#
Classes#
Structured data as the result of a command |
|
Results of the search command (search for contacts via Jabber Search) |
|
A confirmation 'dialog' |
|
A form, to request user input |
|
Defines who can access a given Command |
|
Options to be used for |
|
Represents a field of the form that a user will see when registering to the gateway |
|
Abstract base class to implement gateway commands (chatbot and ad-hoc) |
Functions#
|
Attributes#
- class slidge.core.command.base.TableResult[source]#
Structured data as the result of a command
- class slidge.core.command.base.SearchResult[source]#
Bases:
TableResult
Results of the search command (search for contacts via Jabber Search)
- class slidge.core.command.base.Form[source]#
A form, to request user input
- class slidge.core.command.base.CommandAccess[source]#
-
Defines who can access a given Command
Initialize self. See help(type(self)) for accurate signature.
- class slidge.core.command.base.Option[source]#
Bases:
TypedDict
Options to be used for
FormField``s of type ``list-*
Initialize self. See help(type(self)) for accurate signature.
- class slidge.core.command.base.FormField[source]#
Represents a field of the form that a user will see when registering to the gateway via their XMPP client.
- var: str = ''[source]#
Internal name of the field, will be used to retrieve via
slidge.GatewayUser.registration_form
- private: bool = False[source]#
For sensitive info that should not be displayed on screen while the user types. Forces field_type to “text-private”
- value: str = ''[source]#
Pre-filled value. Will be automatically pre-filled if a registered user modifies their subscription
- class slidge.core.command.base.Command(xmpp)[source]#
Bases:
abc.ABC
Abstract base class to implement gateway commands (chatbot and ad-hoc)
- Parameters:
xmpp (slidge.core.gateway.BaseGateway) –
- ACCESS: CommandAccess[source]#
Who can use this command
- async run(session, ifrom, *args)[source]#
Entry point of the command
- Parameters:
session (Optional[slidge.core.session.BaseSession]) – If triggered by a registered user, its slidge Session
ifrom (slixmpp.JID) – 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
- Return type:
CommandResponseType