Coder Social home page Coder Social logo

pycord's Introduction

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.