Python library for Discord API based around asyncio.
Project description
Qord
Python library for Discord API based around asyncio.
Features:
- Object oriented, user friendly interface with no dirty payloads.
- Easy to customise and manage.
- Robust handling of HTTP ratelimits.
- Supports automatic gateway sharding.
Development stage
Qord is currently under it's initial development (alpha) stage. During this phase, There may be breaking changes and public user-facing API should not be considered stable. There would be no efforts in keeping backward compatibility. While the library currently supports the basic functionalities required to build a bot, many essential features are yet to be implemented and for this reason, Qord isn't yet a library to choose for making full fledged bots.
The complete lifetime of 0.x version is considered the development phase. More info about this semantic versioning specification is here
Installation
Qord is installed using Python's traditional package manager, pip.
pip install -U qord
ℹ️ On Windows and Mac, you might need to prefix the above command with
python -m
for it work.
Qord requires Python 3.8 or higher. The dependencies are handled by pip automatically, See complete list of dependencies in here.
Usage
To whet your appetite, Let's get a quickstart with an example of a simple "Ping-Pong" bot.
import qord
intents = qord.Intents.unprivileged()
intents.message_content = True
client = qord.Client(intents=intents)
@client.event(qord.GatewayEvent.READY)
async def on_ready(event):
print("Bot is ready.")
print(f"Shards: {client.shards_count}")
print(f"User: {client.user.proper_name}")
print(f"Guilds: {len(client.cache.guilds())}")
@client.event(qord.GatewayEvent.MESSAGE_CREATE)
async def on_message_create(event):
message = event.message
if message.author.bot:
# Don't respond to bot messages.
return
if message.content == "!ping":
await message.channel.send("Pong!")
client.start("BOT_TOKEN")
For a brief explanation of this example, see it's explanation. More examples in the examples
directory.
Contributing
Qord is under heavy development. You can help us in reaching 100% coverage of Discord API by reporting bugs, suggesting features or even directly contributing to the code base, See Contribution Guidelines.
Copyright (C) nerdguyahmad and contributors 2022, Under the MIT license.
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.