slidge.core.command.admin#

Commands only accessible for slidge admins

Module Contents#

Classes#

AdminCommand

Abstract base class to implement gateway commands (chatbot and ad-hoc)

Info

Abstract base class to implement gateway commands (chatbot and ad-hoc)

DeleteUser

Abstract base class to implement gateway commands (chatbot and ad-hoc)

ChangeLoglevel

Abstract base class to implement gateway commands (chatbot and ad-hoc)

class slidge.core.command.admin.AdminCommand(xmpp)[source]#

Bases: slidge.core.command.base.Command

Abstract base class to implement gateway commands (chatbot and ad-hoc)

Parameters:

xmpp (slidge.core.gateway.BaseGateway) –

ACCESS[source]#
class slidge.core.command.admin.Info(xmpp)[source]#

Bases: AdminCommand

Abstract base class to implement gateway commands (chatbot and ad-hoc)

Parameters:

xmpp (slidge.core.gateway.BaseGateway) –

NAME = 'List registered users'[source]#
HELP = 'List the users registered to this gateway'[source]#
async run(_session, _ifrom, *_)[source]#

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

class slidge.core.command.admin.DeleteUser(xmpp)[source]#

Bases: AdminCommand

Abstract base class to implement gateway commands (chatbot and ad-hoc)

Parameters:

xmpp (slidge.core.gateway.BaseGateway) –

NAME = 'Delete a user'[source]#
HELP = 'Unregister a user from the gateway'[source]#
async run(_session, _ifrom, *_)[source]#

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

async delete(form_values, _session, _ifrom)[source]#
Parameters:

form_values (dict[str, str]) –

async finish(_session, _ifrom, jid)[source]#
Parameters:

jid (slixmpp.JID) –

class slidge.core.command.admin.ChangeLoglevel(xmpp)[source]#

Bases: AdminCommand

Abstract base class to implement gateway commands (chatbot and ad-hoc)

Parameters:

xmpp (slidge.core.gateway.BaseGateway) –

NAME = 'Change the verbosity of the logs'[source]#
HELP = 'Set the logging level'[source]#
async run(_session, _ifrom, *_)[source]#

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

async static finish(form_values, _session, _ifrom)[source]#
Parameters:

form_values (dict[str, str]) –