2017-05-17 02:31:23 +02:00
=============
API Reference
=============
Messages
========
.. function :: display(msg)
Display a message to the user through the current window.
:param msg: The message to display.
:type msg: string
:rtype: none
.. function :: send(msg)
Send a message to the user specified by the currently open conversation.
:param msg: The message to display.
:type msg: string
:rtype: none
State
=====
.. function :: get_nick()
Return the user's current nickname.
:rtype: string
.. function :: get_status()
2017-05-17 14:37:05 +02:00
Return a string representing the user's current status. Can be either "online", "away", or "busy".
2017-05-17 02:31:23 +02:00
2017-05-17 14:37:05 +02:00
:rtype: string
2017-05-17 02:31:23 +02:00
.. function :: get_status_message()
Return the user's current status message.
:rtype: string
.. function :: get_all_friends()
Return a list of all the user's friends.
:rtype: list of (string, string) tuples containing the nickname followed by their public key
Commands
========
.. function :: execute(command, class)
2017-05-19 21:35:31 +02:00
Executes the given command. The API exports three constants for the class parameter; GLOBAL_COMMAND, CHAT_COMMAND, and GROUPCHAT_COMMAND.
2017-05-17 02:31:23 +02:00
:param command: The command to execute.
:type command: string
:param class: The class of the command.
:type class: int
:rtype: none
.. function :: register(command, help, callback)
Register a callback to be executed whenever command is run. The callback function will be called with one argument, a list of arguments from when the user calls the command.
:param command: The command to listen for.
:type command: string
:param help: A description of the command to be shown in the help menu.
:type help: string
:param callback: The function to be called.
:type callback: callable
:rtype: none