Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kyb3r/pycord
pycord - A discord api wrapper written in python!
https://github.com/kyb3r/pycord
api-client discord discord-api discord-bot pycord python-3-6
Last synced: 6 days ago
JSON representation
pycord - A discord api wrapper written in python!
- Host: GitHub
- URL: https://github.com/kyb3r/pycord
- Owner: kyb3r
- License: mit
- Created: 2017-09-16T13:03:46.000Z (over 7 years ago)
- Default Branch: dev
- Last Pushed: 2020-11-29T09:32:39.000Z (about 4 years ago)
- Last Synced: 2024-12-20T23:23:52.307Z (8 days ago)
- Topics: api-client, discord, discord-api, discord-bot, pycord, python-3-6
- Language: Python
- Homepage:
- Size: 660 KB
- Stars: 35
- Watchers: 8
- Forks: 6
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
## About
Pycord is a Discord API wrapper currently in development. It's easy to use, object oriented and asynchronous using the `trio` async I/O library. It features a super simple commands framework inspired by discord.py's one that makes writing Discord bots a breeze.## Installation
You can easily install the pre-release of this library by doing `pip3 install py-cord` (not the latest)## Event Registration
```py
import pycordclient = pycord.Client()
@client.on('ready')
async def on_ready(time):
print(f'Booted up in {time:.2f} seconds')
print(f'Logged in as: {client.user}')
print(f'User ID: {client.user.id}')
print(f'Is Bot: {client.user.bot}')
print(f'With {len(client.guilds)} guilds')@client.on('message')
async def ping_command(message):
if message.content.startswith('py.ping'):
await message.reply('Pong!')message_count = 0
@client.on('message')
async def stats(message):
message_count += 1
# easily register multiple eventsclient.login('token')
```### Quick Examples
How to send messages
```py
await ctx.reply('content')
await channel.send('content')
await message.reply('content')
await message.channel.send('content')
```How to send embeds
```py
em = pycord.Embed(title='Hi there', color=0x00FFFF)
em.set_author('Bob')
em.add_field('oi','this is a value')await channel.send('pretext', embed=em)
```