slidge_whatsapp.command#
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) |
Module Contents#
- class slidge_whatsapp.command.Logout(xmpp)[source]#
Bases:
slidge.command.Command
Abstract base class to implement gateway commands (chatbot and ad-hoc)
- Parameters:
xmpp (slidge.core.gateway.BaseGateway) β
- NAME = 'π Disconnect from WhatsApp'[source]#
Friendly name of the command, eg: βdo something with stuffβ
- HELP = "Disconnects active WhatsApp session without removing any linked device credentials. To...[source]#
Long description of what the command does
- async run(session, ifrom, *args)[source]#
Entry point of the command
- Parameters:
session (Optional[slidge_whatsapp.session.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
- Return type:
- class slidge_whatsapp.command.PairPhone(xmpp)[source]#
Bases:
slidge.command.Command
Abstract base class to implement gateway commands (chatbot and ad-hoc)
- Parameters:
xmpp (slidge.core.gateway.BaseGateway) β
- NAME = 'π± Complete registration via phone number'[source]#
Friendly name of the command, eg: βdo something with stuffβ
- HELP = 'As an alternative to QR code verification, this allows you to complete registration by inputing...[source]#
Long description of what the command does
- CHAT_COMMAND = 'pair-phone'[source]#
Text to send to the gateway to trigger the command via a message
- async run(session, ifrom, *args)[source]#
Entry point of the command
- Parameters:
session (Optional[slidge_whatsapp.session.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
- Return type:
- static finish(form_values, session, _ifrom)[source]#
- Async:
- Parameters:
form_values (dict) β
session (slidge_whatsapp.session.Session) β
_ifrom (slixmpp.JID) β
- class slidge_whatsapp.command.ChangePresence(xmpp)[source]#
Bases:
slidge.command.Command
Abstract base class to implement gateway commands (chatbot and ad-hoc)
- Parameters:
xmpp (slidge.core.gateway.BaseGateway) β
- NAME = 'π΄ Set WhatsApp web presence'[source]#
Friendly name of the command, eg: βdo something with stuffβ
- HELP = "If you want to receive notifications in the WhatsApp official client,you need to set your...[source]#
Long description of what the command does
- async run(session, ifrom, *args)[source]#
Entry point of the command
- Parameters:
session (Optional[slidge_whatsapp.session.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
- Return type:
- static finish(form_values, session, _ifrom)[source]#
- Async:
- Parameters:
form_values (dict) β
session (slidge_whatsapp.session.Session) β
_ifrom (slixmpp.JID) β
- class slidge_whatsapp.command.SubscribeToPresences(xmpp)[source]#
Bases:
slidge.command.Command
Abstract base class to implement gateway commands (chatbot and ad-hoc)
- Parameters:
xmpp (slidge.core.gateway.BaseGateway) β
- NAME = "π Subscribe to contacts' presences"[source]#
Friendly name of the command, eg: βdo something with stuffβ
- HELP = "Subscribes to and refreshes contacts' presences; typically this is done automatically, but...[source]#
Long description of what the command does
- CHAT_COMMAND = 'subscribe'[source]#
Text to send to the gateway to trigger the command via a message
- async run(session, ifrom, *args)[source]#
Entry point of the command
- Parameters:
session (Optional[slidge_whatsapp.session.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
- Return type: