Skip to main content

A python wrapper for the Discord API

Project description

# discord.py

[![PyPI](https://img.shields.io/pypi/v/discord.py.svg)](https://pypi.python.org/pypi/discord.py/)
[![PyPI](https://img.shields.io/pypi/dm/discord.py.svg)](https://pypi.python.org/pypi/discord.py/)
[![PyPI](https://img.shields.io/pypi/pyversions/discord.py.svg)](https://pypi.python.org/pypi/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.

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][ch] and update your installation periodically through `pip install --upgrade discord.py`.

[ch]: https://discord.gg/0SBTUU1wZTUzBx2q

## Quick Example

```py
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.

## Related Projects

- [discord.js](https://github.com/discord-js/discord.js)
- [discord.io](https://github.com/izy521/discord.io)
- [Discord.NET](https://github.com/RogueException/Discord.Net)
- [DiscordSharp](https://github.com/Luigifan/DiscordSharp)
- [Discord4J](https://github.com/knobody/Discord4J)
- [discordrb](https://github.com/meew0/discordrb)

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

discord.py-0.9.0.zip (45.7 kB view details)

Uploaded Source

File details

Details for the file discord.py-0.9.0.zip.

File metadata

  • Download URL: discord.py-0.9.0.zip
  • Upload date:
  • Size: 45.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for discord.py-0.9.0.zip
Algorithm Hash digest
SHA256 2af82920224f60c5afb719a49357fea9d2ccdfbafee745ec96dd33d039968ec9
MD5 c8a09475a22303097840ef7af20e7403
BLAKE2b-256 d74e52e8eac49724252b875651bbaf35b6212776a7ef3e9884d5661b0131fdc9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page