Rapptz c3e7ba3671 Message.channel's Object instance has an is_private attribute now.
This was to allow for basic checks such as message.channel.is_private
to succeed at the very least. It is a very small mitigation and not
perfect since it doesn't have every attribute that PrivateChannel
itself has. However you could retrieve the user info through the
Message.author attribute.
2015-11-28 23:06:23 -05:00
2015-11-28 21:00:35 -05:00
2015-09-16 17:27:52 -04:00
2015-11-28 20:55:41 -05:00

discord.py

PyPI PyPI PyPI

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.

If you want to install the development version of the library, then do the following:

pip install git+https://github.com/Rapptz/discord.py@develop

Note that this requires git to be installed.

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 70 MiB
Languages
Python 100%