matridge.command¶
Classes¶
Abstract base class to implement gateway commands (chatbot and ad-hoc) |
|
Abstract base class to implement gateway commands (chatbot and ad-hoc) |
Module Contents¶
- class matridge.command.ListSpaces(xmpp)[source]¶
Bases:
slidge.command.Command
Abstract base class to implement gateway commands (chatbot and ad-hoc)
- Parameters:
xmpp (slidge.core.gateway.BaseGateway)
- 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 (matridge.session.Session) – If triggered by a registered user, its slidge Session
ifrom – JID of the command-triggering entity
args (str) – 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:
slidge.command.Form
- static finish(form_values, session, _ifrom, rooms)[source]¶
- Async:
- Parameters:
form_values (slidge.command.base.FormValues)
session (matridge.session.Session)
rooms (list[nio.MatrixRoom])
- class matridge.command.ManageTrust(xmpp)[source]¶
Bases:
slidge.command.Command
Abstract base class to implement gateway commands (chatbot and ad-hoc)
- Parameters:
xmpp (slidge.core.gateway.BaseGateway)
- NAME = '🤝 Manage trust in devices'[source]¶
Friendly name of the command, eg: “do something with stuff”
- 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 (matridge.session.Session) – If triggered by a registered user, its slidge Session
ifrom – JID of the command-triggering entity
args (str) – 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:
Union[slidge.command.Form, str]
- async step2(form_values, session, _ifrom, devices)[source]¶
- Parameters:
form_values (slidge.command.base.FormValues)
session (matridge.session.Session)