732 Commits

Author SHA1 Message Date
Hornwitser
9ab1d041d4 Log to root logger by default in on_error
Change the default implementation of on_error to log to the root logger
instead of discord.client and clarify that the exception is being
ignored.  This ensures that a message will be output to standard error
in case the logging module has not been configured.

Also removes the argument printing for the default on_error, this is due
to them often being too long, that they could cause another exception to
be thrown, and because it sometimes causes sensitive information to be
output such as Discord tokens and session ids.  It was also possible for
the length to get in the megabyte range with exceptions thrown by
on_socket_raw_receive in READY events.
2015-10-21 01:03:25 +02:00
Hornwitser
07adb330db Add events for sniffing the WebSocket data
Add on_socket_raw_receive and on_socket_raw_send events for sniffing the
data being received and sent on the websocket. Useful for debugging and
logging websocket messages received and sent on the link to Discord's
servers.
2015-10-16 16:20:04 -04:00
Rapptz
411b477a02 Separate colour tuple into its own class.
Also enumerate all the constant colours that Discord currently
supports.
2015-10-16 07:48:50 -04:00
Rapptz
ab2512785b Handle VOICE_STATE_UPDATE websocket events.
This adds a lot of new attributes into the Member class
such as giving a voice_channel that the user is currently connected
to. Initially there was a plan to have a voice_members attribute
in the Channel class but this proved to be difficult when it came to
actually removing users from the voice channel as the response would
return channel_id as null.

Fixes #16.
2015-10-15 01:37:55 -04:00
Rapptz
4ff7d22edd Handle GUILD_ROLE_UPDATE websocket events. 2015-10-15 01:37:55 -04:00
Rapptz
16a20e5f2f Handle GUILD_ROLE_DELETE websocket events. 2015-10-15 01:37:54 -04:00
Rapptz
9235a34916 Handle GUILD_ROLE_CREATE websocket events. 2015-10-15 01:37:54 -04:00
Rapptz
1f37fe72f2 Documentation cleanup.
Documented the new way of listening to events as well the new
events that could be listened thanks to the recent refactor.

Also uses the versionadded directive to document when something new
is added to the library.
2015-10-13 05:39:59 -04:00
Hornwitser
e258c9b893 Clarify logging and on_error documentation
Change the description of on_error to reflect that exceptions are logged
and not output by default. Add a note about not configuring logging
causing exceptions to be silently ignored in handlers in the API. And
add some more explanations and a simpler configuration example to the
logging description.
2015-10-06 19:09:16 +02:00
Hornwitser
74a06e0b79 Change behaviour of on_error
Change how the old style on_error event is called to match the new style
on_error event.  Both are now called in case an exception is raised in
an user defined event handler, and will by default print the arguments
of the event tha raised the exception and the traceback for the
exception.  In addition, overridding the on_error handler supresses this
behaviour.
2015-10-06 19:09:16 +02:00
Rapptz
120b9cd3b2 Listen to CHANNEL_UPDATE events and add on_channel_update 2015-09-25 16:09:10 -04:00
Rapptz
bbf1c5418b Add support for logging. 2015-09-16 17:27:52 -04:00
Rapptz
a2b981d19e Document discord.utils.find function 2015-09-14 00:08:43 -04:00
Rapptz
73919fe152 Documentation fixes and version bump. 2015-09-05 01:05:08 -04:00
Rapptz
4aecd5f7b5 Add on_error event for doing something about uncaught exceptions. 2015-09-05 00:46:18 -04:00
Rapptz
e11aaa0566 Add on_member_update event. 2015-09-04 23:50:32 -04:00
Rapptz
80eb567520 Add support for creating invites. 2015-09-04 23:23:47 -04:00
Rapptz
c98a723f06 Add on_server_create and on_server_delete events. 2015-09-03 04:22:46 -04:00
Rapptz
e60777e68b Document exceptions and change conf.py version detection. 2015-08-28 17:24:35 -04:00
Rapptz
5db2b31114 Version bump to v0.4.0. 2015-08-27 22:15:01 -04:00
Rapptz
b466a2615e Handle GUILD_MEMBER_REMOVE/GUILD_MEMBER_ADD events.
Thanks izy.
2015-08-27 19:42:07 -04:00
Rapptz
795b8ceffe on_status now takes only a member. 2015-08-27 17:45:43 -04:00
Rapptz
49bc2dbf48 Documentation update. 2015-08-26 07:46:46 -04:00
Rapptz
9f601a24b1 Add logout support and on_disconnect event. 2015-08-24 00:00:42 -04:00
Rapptz
35084cf98a Add support for channel creation events. 2015-08-23 23:37:56 -04:00
Rapptz
3346b28fee Add on_channel_delete event. 2015-08-23 02:53:56 -04:00
Rapptz
1f980361e3 Sandbox events so exceptions being thrown don't break the client. 2015-08-23 02:43:04 -04:00
Rapptz
6445641f9e Add on_status event. 2015-08-23 02:16:05 -04:00
Rapptz
44953e7a3f Rename project from pydiscord to discord.py 2015-08-22 07:43:41 -04:00
Rapptz
ef7dd42f28 Add on_message_edit event. 2015-08-21 22:02:03 -04:00
Rapptz
f580441c10 Add on_message_delete event and Client.messages attribute. 2015-08-21 18:55:57 -04:00
Rapptz
3e0f09d32c Initial commit 2015-08-21 18:18:34 -04:00