You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.5 KiB

.. currentmodule:: discord
API Reference
===============
The following section outlines the API of pydiscord.
Client
-------
.. autoclass:: Client
:members:
.. _discord-api-events:
Event Reference
~~~~~~~~~~~~~~~~
This page outlines the different types of events listened to by :meth:`Client.event`.
.. function:: on_ready()
Called when the client is done preparing the data received from Discord. Usually after login is successful
and the :attr:`Client.servers` and co. are filled up.
.. function:: on_message(message)
Called when a message is created and sent to a server.
:param message: A :class:`Message` of the current message.
.. function:: on_response(response)
Called whenever a message is received from the websocket. Used mainly for debugging purposes.
The parameter passed is raw data that was parsed via ``json.loads``.
:param response: The received message response after gone through ``json.loads``.
.. function:: on_message_delete(message)
Called when a message is deleted from any given server.
:param message: A :class:`Message` of the deleted message.
Data Classes
--------------
Some classes are just there to be data containers, this lists them. It should be assumed that *all* classes in this category are immutable and should not be modified.
.. autoclass:: User
:members:
.. autoclass:: Message
:members:
.. autoclass:: Server
:members:
.. autoclass:: Channel
:members:
.. autoclass:: PrivateChannel
:members: