Skip to content
/ pycord Public

pycord - A discord api wrapper written in python!

License

Notifications You must be signed in to change notification settings

kyb3r/pycord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NOTE: This is a dead project.

python 3.6 docs

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

import pycord

client = 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 events

client.login('token')

Quick Examples

How to send messages

await ctx.reply('content')
await channel.send('content')
await message.reply('content')
await message.channel.send('content')

How to send embeds

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)