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) |
|
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.SyncContacts(xmpp)#
Abstract base class to implement gateway commands (chatbot and ad-hoc)
- Parameters:
xmpp (slidge.core.gateway.BaseGateway) –
- 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) –
- 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) –
- 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) –
- CATEGORY: str | None#
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, *_)#
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
- class slidge.command.user.CreateGroup(xmpp)#
Abstract base class to implement gateway commands (chatbot and ad-hoc)
- Parameters:
xmpp (slidge.core.gateway.BaseGateway) –
- 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
- class slidge.command.user.Unregister(xmpp)#
Abstract base class to implement gateway commands (chatbot and ad-hoc)
- Parameters:
xmpp (slidge.core.gateway.BaseGateway) –
- CATEGORY: str | None#
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, *_)#
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