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
2015-09-16 17:27:52 -04:00
2015-09-03 07:17:13 -04:00

discord.py

discord.py is an API wrapper for Discord written in Python.

This was written to allow easier writing of bots or chat logs.

Installing

Installing is pretty easy.

pip install discord.py

Will install the latest 'stable' version of the library.

This module is alpha!

The discord API is constantly changing and the wrapper API is as well. There will be no effort to keep backwards compatibility.

I recommend that you follow the discussion in the unofficial Discord API discord channel and update your installation periodically through pip install --upgrade discord.py.

Quick Example

import discord

client = discord.Client()
client.login('email', 'password')

@client.event
def on_message(message):
    if message.content.startswith('!hello'):
        client.send_message(message.channel, 'Hello was received!')

@client.event
def on_ready():
    print('Logged in as')
    print(client.user.name)
    print(client.user.id)
    print('------')

client.run()

You can find examples in the examples directory.

Requirements

  • Python 2.7+ or Python 3.3+.
  • ws4py library
  • requests library

Usually pip will handle these for you.

Description
No description provided
Readme MIT 68 MiB
Languages
Python 100%