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
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.io-0.8.2.tar.gz
(532.3 kB
view hashes)