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: