Skip to main content

Asynchronous Discord API Wrapper For Python

Project description

Asynchronous Discord API Wrapper for Python

Features

  • Sane Handling of 429s
  • User friendly interface

Installing

To Install discord.io Just run the following command:

pip install discord.io

To install our speed requirements just run the following command:

pip install discord.io[speed]

For voice support run the following command:

pip install discord.io[voice]

Examples

This is a quick usecase example for the library!

import discord

client = discord.Client()

@client.event
async def on_ready():
    print('ready!')

@client.slash_command()
async def ping(interaction):
    await interaction.respond('pong!')

client.run('my_bot_token')

This is another example but with a prefixed command

import discord

client = discord.Client()

@client.event
async def on_ready():
    print('ready!')

@client.event
async def on_message(msg):
    if msg.author.bot:
        return
    
    if msg.content.startswith('!ping'):
        await msg.send('Pong!')

client.run('my_bot_token')

Useful Links

The discord.io discord server

Project details


Download files

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

Source Distribution

discord.io-0.8.2.tar.gz (532.3 kB view hashes)

Uploaded Source

Supported by

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