slidge.command.user
#
Module Contents#
Classes#
Abstract base class to implement gateway commands (chatbot and ad-hoc) |
|
Abstract base class to implement gateway commands (chatbot and ad-hoc) |
|
Abstract base class to implement gateway commands (chatbot and ad-hoc) |
|
Abstract base class to implement gateway commands (chatbot and ad-hoc) |
|
Abstract base class to implement gateway commands (chatbot and ad-hoc) |
|
Abstract base class to implement gateway commands (chatbot and ad-hoc) |
- class slidge.command.user.Search(xmpp)#
Abstract base class to implement gateway commands (chatbot and ad-hoc)
- Parameters:
xmpp (slidge.core.gateway.BaseGateway) –
- async run(session, _ifrom, *args)#
Entry point of the command
- Parameters:
session (Optional[slidge.util.types.AnyBaseSession]) – 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
_ifrom (slixmpp.JID) –
- Returns:
Either a TableResult, a Form, a Confirmation, a text, or None
- Return type:
Union[slidge.command.base.Form, slidge.command.base.SearchResult, None]
- raise_if_not_authorized(jid)#
Raise an appropriate error is jid is not authorized to use the command
- Parameters:
jid (slixmpp.JID) – jid of the entity trying to access the command
- Return type:
Optional[BaseSession[Any, Any]]
:return:session of JID if it exists
- class slidge.command.user.Unregister(xmpp)#
Abstract base class to implement gateway commands (chatbot and ad-hoc)
- Parameters:
xmpp (slidge.core.gateway.BaseGateway) –
- NODE :str#
Name of the node used for ad-hoc commands
- CHAT_COMMAND :str#
Text to send to the gateway to trigger the command via a message
- async run(session, _ifrom, *_)#
Entry point of the command
- Parameters:
session (Optional[slidge.util.types.AnyBaseSession]) – 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
_ifrom (slixmpp.JID) –
_ (Any) –
- Returns:
Either a TableResult, a Form, a Confirmation, a text, or None
- Return type:
- raise_if_not_authorized(jid)#
Raise an appropriate error is jid is not authorized to use the command
- Parameters:
jid (slixmpp.JID) – jid of the entity trying to access the command
- Return type:
Optional[BaseSession[Any, Any]]
:return:session of JID if it exists
- class slidge.command.user.SyncContacts(xmpp)#
Abstract base class to implement gateway commands (chatbot and ad-hoc)
- Parameters:
xmpp (slidge.core.gateway.BaseGateway) –
- NODE :str#
Name of the node used for ad-hoc commands
- CHAT_COMMAND :str#
Text to send to the gateway to trigger the command via a message
- async run(session, _ifrom, *_)#
Entry point of the command
- Parameters:
session (Optional[slidge.util.types.AnyBaseSession]) – 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
- Return type:
- raise_if_not_authorized(jid)#
Raise an appropriate error is jid is not authorized to use the command
- Parameters:
jid (slixmpp.JID) – jid of the entity trying to access the command
- Return type:
Optional[BaseSession[Any, Any]]
:return:session of JID if it exists
- class slidge.command.user.ListContacts(xmpp)#
Abstract base class to implement gateway commands (chatbot and ad-hoc)
- Parameters:
xmpp (slidge.core.gateway.BaseGateway) –
- NAME :str#
Friendly name of the command, eg: “do something with stuff”
- HELP :str#
Long description of what the command does
- NODE :str#
Name of the node used for ad-hoc commands
- CHAT_COMMAND :str#
Text to send to the gateway to trigger the command via a message
- async run(session, _ifrom, *_)#
Entry point of the command
- Parameters:
session (Optional[slidge.util.types.AnyBaseSession]) – 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
_ifrom (slixmpp.JID) –
- Returns:
Either a TableResult, a Form, a Confirmation, a text, or None
- Return type:
- raise_if_not_authorized(jid)#
Raise an appropriate error is jid is not authorized to use the command
- Parameters:
jid (slixmpp.JID) – jid of the entity trying to access the command
- Return type:
Optional[BaseSession[Any, Any]]
:return:session of JID if it exists
- class slidge.command.user.ListGroups(xmpp)#
Abstract base class to implement gateway commands (chatbot and ad-hoc)
- Parameters:
xmpp (slidge.core.gateway.BaseGateway) –
- NAME :str#
Friendly name of the command, eg: “do something with stuff”
- HELP :str#
Long description of what the command does
- NODE :str#
Name of the node used for ad-hoc commands
- CHAT_COMMAND :str#
Text to send to the gateway to trigger the command via a message
- async run(session, _ifrom, *_)#
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
- raise_if_not_authorized(jid)#
Raise an appropriate error is jid is not authorized to use the command
- Parameters:
jid (slixmpp.JID) – jid of the entity trying to access the command
- Return type:
Optional[BaseSession[Any, Any]]
:return:session of JID if it exists
- class slidge.command.user.Login(xmpp)#
Abstract base class to implement gateway commands (chatbot and ad-hoc)
- Parameters:
xmpp (slidge.core.gateway.BaseGateway) –
- NODE :str#
Name of the node used for ad-hoc commands
- CHAT_COMMAND :str#
Text to send to the gateway to trigger the command via a message
- async run(session, _ifrom, *_)#
Entry point of the command
- Parameters:
session (Optional[slidge.util.types.AnyBaseSession]) – 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
- raise_if_not_authorized(jid)#
Raise an appropriate error is jid is not authorized to use the command
- Parameters:
jid (slixmpp.JID) – jid of the entity trying to access the command
- Return type:
Optional[BaseSession[Any, Any]]
:return:session of JID if it exists