Welcome to discord.aio’s documentation!

See the reference documentation.

discord.aio

PyPI version Python version Module status License Discord Documentation Status
discord.aio is an asynchronous Discord API wrapper

Currently under very early development

Python 3.6+ only.

Documentation

You can find the module documentation here: documentation

Installation

With pip:

  • pip3 install discord.aio

From source:

  • git clone https://github.com/Ryozuki/discord.aio && cd discord.aio && pip3 install .

Local development

  • git clone https://github.com/Ryozuki/discord.aio
  • cd discord.aio && pip3 install -e .

Example bot

import asyncio
import os
import logging
from discordaio import DiscordBot

logging.basicConfig(
    level='DEBUG', format='%(asctime)s - %(name)s - %(levelname)s: %(message)s')
logger = logging.getLogger('my_lovely_bot')

if __name__ == '__main__':
    TOKEN = os.environ['DISCORD_TOKEN']

    bot = DiscordBot(TOKEN)

    @bot.event()
    async def on_ready():
        logger.info('Connected!')
        logger.info(f'My username is {bot.user}')

    @bot.event('on_message') # You can also use a custom function name.
    async def foo_bar(message):
        logger.info(f'{message.author}: {message.content}')

    bot.run()

Here you can find a more extensive example.

TODO

Indices and tables