The Discord bot framework for Python

Overview

Pycordia

⚠️ Note!

As of now, this package is under early development so functionalities are bound to change drastically.

We don't recommend you currently use Pycordia in a production environment.

A work-in-progress Discord API wrapper for Python with a simple gateway and some common events implemented.

While there's currently no documentation available, use the examples for guidance. If you have any questions, feel free to join our Discord server to follow the changes we make, as well as receive help and talk with others!

Our examples (and future documentation) assume you're at a level of Python where you can comfortably work with Discord bots.

⚙️ Installation

Pycordia has been well tested on Python 3.8, however, 3.7 and above are supported.

Installing from PIP

The easiest way to get Pycordia on your system is by installing it through pip.

$ pip install pycordia               # Should work everywhere
$ pip3 install pycordia              # Should work on most *nix systems; use on MacOS
$ python -m pip install pycordia     # Alternative; should work everywhere
$ python3 -m pip install pycordia    # Alternative; use on MacOS
$ py -3 -m pip install pycordia      # Alternative; use on Windows

Installing from Source

If you prefer installing Pycordia from source, proceed with the following:


First, clone this repository either through Git or Github.

Next, proceed to run the setup.py file as in:

$ python setup.py sdist     # Should work everywhere
$ python3 setup.py sdist    # Should work on most *nix systems; use on MacOS
$ py -3 setup.py sdist      # Should work on Windows

cd into the new dist directory and run the created .tar.gz file.

$ pip install pycordia-<version>.tar.gz         # Should work everywhere
$ pip3 install pycordia-<version>.tar.gz        # Should work on most *nix systems; use on MacOS
$ python -m pip install pycordia-....tar.gz     # Alternative; should work everywhere
$ python3 -m pip install pycordia-....tar.gz    # Alternative; use on MacOS
$ py -3 -m pip install pycordia-....tar.gz      # Alternative; use on Windows

🏓 Example of a simple Ping-Pong Bot

from pycordia import events, models
import pycordia
import dotenv
import os

dotenv.load_dotenv()
client = pycordia.Client(intents=pycordia.Intents.all())

@client.event
async def on_ready(event: events.ReadyEvent):
    print(f"{event.user} ready to do stuff!", client.intents)

@client.event
async def on_message_create(msg: models.Message):
    if msg.author.bot or not msg.content:
        return

    if msg.content.startswith(".ping"):
        embed = models.Embed.create(description=":ping_pong: Pong!")
        embed.color = 0xFF123A

        await models.Message.create(client, embeds=[embed]).send(msg.channel_id)

client.run(os.getenv("DISCORD_TOKEN"))

Events

  • on_ready: events.ReadyEvent
  • on_message_create: models.Message
  • on_typing_start: events.TypingStartEvent
  • on_message_delete, on_message_delete_bulk: events.MessageDeleteEvent
  • on_message_update: models.Message
  • on_channel_create, on_channel_update, on_channel_delete: models.Channel

For all other undocumented events, you'll receive raw JSON data which you'll have to handle yourself.

🔖 Things to do

  • Improve currently available models
  • Add slash commands
  • Add all other event wrappers

📖 Contribute

Feel free to contribute any bug fixes, new features, or general improvements to the Pycordia project.

You might also like...
Anime-Discord-Bot - Lightweight anime searching Discord bot supported by the AnilistPython library (anilist.co APIv2 wrapper))
VoiceMaster-Discord-Bot - Fork from original Discord bot with max channel limit, staff role and more

VoiceMaster VoiceMaster is a discord bot created to change the way servers work,

A discord Server Bot made with Python, This bot helps people feel better by inspiring them with motivational quotes or by responding with a great message, also the users of the server can create custom messages by telling the bot with Commands.
A discord Server Bot made with Python, This bot helps people feel better by inspiring them with motivational quotes or by responding with a great message, also the users of the server can create custom messages by telling the bot with Commands.

A discord Server Bot made with Python, This bot helps people feel better by inspiring them with motivational quotes or by responding with a great message, also the users of the server can create custom messages by telling the bot with Commands.

Aqui está disponível GRATUITAMENTE, um bot de discord feito em python, saiba que, terá que criar seu bot como aplicação, e utilizar seu próprio token, e lembrando, é um bot básico, não se utiliza Cogs nem slash commands nele!

BotDiscordPython Aqui está disponível GRATUITAMENTE, um bot de discord feito em python, saiba que, terá que criar seu bot como aplicação, e utilizar s

MusicBot is the original Discord music bot written for Python 3.5+, using the discord.py library
MusicBot is the original Discord music bot written for Python 3.5+, using the discord.py library

The original MusicBot for Discord (formerly SexualRhinoceros/MusicBot)

Michelle is a Discord Bot coded in Python with Discord.py by Mudit07.
Michelle is a Discord Bot coded in Python with Discord.py by Mudit07.

Michelle is a Discord Bot coded in Python with Discord.py by Mudit07.

Zero2 Discord bot is written with Discord.py using Python.
Zero2 Discord bot is written with Discord.py using Python.

Zero2 Discord bot is written with Discord.py using Python.

Barbot is a discord bot made from discord.py and python, barbot is most to fun and roleplay for servers!
Barbot is a discord bot made from discord.py and python, barbot is most to fun and roleplay for servers!

BarBot Main source of barbot Overview Barbot is a discord bot made from discord.py and python, barbot is most to fun and roleplay for servers! Links i

Comments
  • Revert the previous PR

    Revert the previous PR

    Setup:

    1. Delete the gh-pages branch, and create a new gh-pages orphan branch
    2. Create a personal access token in settings
    3. Create a new secret by the name of ACCESS_TOKEN in this repository, and set its value to the token
    4. Configure Github Pages to serve files from the root folder of the gh-pages branch
    5. Change the github repository in line 5 of the sphinx-build.yml workflow

    Once you commit your changes, the workflow should run again, and commit the docs to gh-pages. LMK if anything breaks! 😄

    opened by classPythonAddike 0
  • Added documentation workflow

    Added documentation workflow

    Added a documentation workflow, which uses sphinx to build the docs.

    What it does -

    • Installs git, python and clones the repo to a container
    • Installs packages from the requirements.txt
    • Builds the docs, removes unnecessary files, like source code, requirements.txt, setup.py, etc
    • Configures git
    • Then pushes the docs to the gh-pages branch, using a personal access token for auth

    Setup:

    1. Delete the gh-pages branch, and create a new gh-pages orphan branch
    2. Create a personal access token in settings
    3. Create a new secret by the name of ACCESS_TOKEN in this repository, and set its value to the token
    4. Configure Github Pages to serve files from the root folder of the gh-pages branch
    5. Change the github repository in line 5 of the sphinx-build.yml workflow

    Once you commit your changes, the workflow should run again, and commit the docs to gh-pages. LMK if anything breaks! 😄

    opened by classPythonAddike 0
  • Improved message caching, split up examples and added channel events

    Improved message caching, split up examples and added channel events

    Implemented the Channel model, and added wrappers for -

    1. CHANNEL_CREATE
    2. CHANNEL_UPDATE
    3. CHANNEL_DELETE

    I also improved the message caching - (checking to see if the cache has reached the size limit, before adding a message into it)

    I did test out these, and they all worked :eyes: lmk if something doesn't function as expected!

    opened by classPythonAddike 0
  • New features

    New features

    Ello :smilecat:

    Features I added -

    1. Added a user and guilds attribute to the Client class
    2. Added __repr__ methods for some of the classes
    3. Declared constants to house the api, cdn, and websocket url
    4. Also made it possible to get user info from their id

    LMK if you want any changes to be implemented, hope you like it! :smilecatadidas:

    opened by classPythonAddike 0
Releases(0.2.1)
  • 0.2.1(Nov 3, 2021)

    After a while of no updates, version 0.2.1 is here. It adds some general improvements and other quality-of-life things.

    Notable features

    • Client.on() decorator; another way of doing Client.register_events
    • Client.get_* methods; another way of using the respective model's from_id methods
    • User.created_on: check when an user was created
    • Typehinting fixes; this should make Pycordia fair better with certain linters and tools.
    • Other general improvements and minor fixes
    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Oct 5, 2021)

    This is the first major release of Pycordia. It introduces many changes related to performance, models, and other things.

    • Errors and representations are clearer
    • No longer required to provide Client to models
    • Support for multiple event handlers (for same event)

    The full list of changes can be found here

    Source code(tar.gz)
    Source code(zip)
  • 0.1.2(Sep 20, 2021)

    This update contains a general improvement to the websocket. It now implements compression and works far more reliably than in previous versions.

    Source code(tar.gz)
    Source code(zip)
  • 0.1.1(Sep 12, 2021)

    This is a minor update that fixes some bugs:

    • Migrated from await to asyncio.gather for events, this allow the events to be truly asynchronous.
    • Other general improvements
    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(Sep 11, 2021)

    This is the first semi-stable release of Pycordia. It includes the most common features of a bot, including event handling, message creation, embeds, updates, and more.

    Source code(tar.gz)
    Source code(zip)
Owner
Ángel Carias
Developer and designer.
Ángel Carias
My Discord Bot that I used to learn Python. Please disregard the unstructured code!

Botsche My personal Discord Bot. To run this bot, change TOKEN in config.ini to your Discord Bot Token, which can be retrieved from your Discord Dev

Mats Voss 1 Nov 29, 2021
Spore Api

SporeApi Spore Api Simple example: import asyncio from spore_api.client import SporeClient async def main() - None: async with SporeClient() a

LEv145 16 Aug 02, 2022
칼만 필터는 어렵지 않아(저자 김성필) 파이썬 코드(Unofficial)

KalmanFilter_Python 칼만 필터는 어렵지 않아(저자 김성필) 책을 공부하면서, Matlab 코드를 Python으로 변환한 것입니다. Contents Part01. Recursive Filter Chapter01. Average Filter Chapter0

Donghun Park 20 Oct 28, 2022
Want to play What Would Rather on your Server? Invite the bot now!😏

What is this Bot? 👀 What You Would Rather? is a Guessing game where you guess one thing. Long Description short Take this example: You typed r!rather

丂ㄚ么乙ツ 2 Nov 17, 2021
This repository contains code written in the AWS Cloud Development Kit (CDK)

This repository contains code written in the AWS Cloud Development Kit (CDK) which launches infrastructure across two different regions to demonstrate using AWS AppSync in a multi-region setup.

AWS Samples 5 Jun 03, 2022
Check and write all account info + Check nitro on account

Discord-Token-Checker Check and write all account info + Check nitro on account Also check https://github.com/GuFFy12/Discord-Token-Parser (Parse disc

36 Jan 01, 2023
A pypi package that helps in generating discord bots.

A pypi package that helps in generating discord bots.

KlevrHQ 3 Nov 17, 2021
A working selfbot for discord

React Selfbot Yes, for real ⚠ "Maintained" version: https://github.com/AquaSelfBot/AquaSelfbot ⚠ Why am I making this open source? Because can't stop

3 Jan 25, 2022
A Happy and lightweight Python Package that Provides an API to search for articles on Google News and returns a JSON response.

A Happy and lightweight Python Package that Provides an API to search for articles on Google News and returns a JSON response.

Muhammad Abdullah 273 Dec 31, 2022
Ross Virtual Assistant is a programme which can play Music, search Wikipedia, open Websites and much more.

Ross-Virtual-Assistant Ross Virtual Assistant is a programme which can play Music, search Wikipedia, open Websites and much more. Installation Downloa

Jehan Patel 4 Nov 08, 2021
DongTai API SDK For Python

DongTai-SDK-Python Quick start You need a config file config.json { "DongTai":{ "token":"your token", "url":"http://127.0.0.1:90"

huoxian 50 Nov 24, 2022
Esse script procura qualquer, dados que você queira na wikipedia! Em breve traremos um com dados em toda a internet.

Buscador de dados simples Dependências necessárias Para você poder começar a utilizar esta ferramenta, você vai precisar da dependência "wikipedia", p

Erick Campoy 4 Feb 24, 2022
A Flask & Twilio Secret Santa app.

🎄 ✨ Secret Santa Twilio ✨ 📱 A contactless Secret Santa game built with Python, Flask and Twilio! Prerequisites 📝 A Twilio account. Sign up here ngr

Sangeeta Jadoonanan 5 Dec 23, 2021
Implementation of Chatterbot using Discord API

discord-chat-bot Implementation of Chatterbot using Discord API. Usage Due to the necessity of storing files to train the AI, the bot is not hosted pu

kiwijuice56 0 Sep 29, 2022
This very basic script can be used to automate COVID-19 vaccination slot booking on India's Co-WIN Platform.

COVID-19 Vaccination Slot Booking Script This very basic CLI based script can be used to automate covid vaccination slot booking on Co-WIN Platform. I

605 Dec 14, 2022
Python binding for Microsoft LightGBM

pyLightGBM: python binding for Microsoft LightGBM Features: Regression, Classification (binary, multi class) Feature importance (clf.feature_importanc

Ardalan 330 Nov 18, 2022
AWS Enumeration and Footprinting Tool

Quiet Riot 🎶 C'mon, Feel The Noise 🎶 An enumeration tool for scalable, unauthenticated validation of AWS principals; including AWS Acccount IDs, roo

Wes Ladd 89 Jan 05, 2023
Data Platform com AWS CDK

Welcome to your CDK Python project! This is a blank project for Python development with CDK. The cdk.json file tells the CDK Toolkit how to execute yo

Andre Sionek 8 Jul 02, 2022
A Serverless Application Model stack that persists the $XRP price to the XRPL every minute as a TrustLine. There are no servers, it is effectively a "smart contract" in Python for the XRPL.

xrpl-price-persist-oracle-sam This is a XRPL Oracle that publishes external data into the XRPL. This Oracle was inspired by XRPL-Labs/XRPL-Persist-Pri

Joseph Chiocchi 11 Dec 17, 2022
A discord bot that moderates your server!

Staff Bot para Discord O que é? É um bot que modera o seu servidor no Discord, apagando mensagens indesejadas que os usuários mandem! Como usar Primei

Isac Gonçalves Cunha 3 Oct 07, 2021