slidge.command.admin
#
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.admin.AdminCommand(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[BaseSession[Any, Any]]) – If triggered by a registered user, its slidge Session
ifrom (slixmpp.JID) – 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:
CommandResponseType
- 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.admin.ListUsers(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.admin.SlidgeInfo(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.admin.DeleteUser(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.admin.ChangeLoglevel(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.admin.Exec(xmpp)#
Abstract base class to implement gateway commands (chatbot and ad-hoc)
- async run(session, ifrom, *args)#
Entry point of the command
- Parameters:
session – 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
- 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