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
A library for demo trading | backtest and forward test simulation

Trade Engine a library for demo trading | backtest and forward test simulation Features Limit/Market orders: you can place a Limit or Market order in

Ali Moradi 7 Jul 02, 2022
A powerfull Zee5 Downloader Bot With Permeneant Thumbnail Support 💯 With Love From NexonHex

Zᴇᴇ5 DL A ᴘᴏᴡᴇʀғᴜʟʟ Zᴇᴇ5 Dᴏᴡɴʟᴏᴀᴅᴇʀ Bᴏᴛ Wɪᴛʜ Pᴇʀᴍᴇɴᴇᴀɴᴛ Tʜᴜᴍʙɴᴀɪʟ Sᴜᴘᴘᴏʀᴛ 💯 Wɪᴛʜ Lᴏᴠᴇ Fʀᴏᴍ NᴇxᴏɴHᴇx Wʜᴀᴛ Cᴀɴ I Dᴏ ? • ɪ ᴄᴀɴ Uᴘʟᴏᴀᴅ ᴀs ғɪʟᴇ/ᴠɪᴅᴇᴏ ғʀᴏᴍ

Psycharmers 4 Jan 19, 2022
Simple Translator in Python

Simple Translator in Python Project Description: In this project, we'll be making a very simple translator in Python using some libraries. Requirement

Hassan Shahzad 3 Jan 23, 2022
Compulsory join Telegram Bot

mussjoin About Compulsory join Telegram Bot this Telegram Bot Application can be added users to Telegram Channel or Group compulsorily. in addition wh

Hamed Mohammadvand 4 Dec 03, 2021
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 3 Oct 09, 2021
A discord bot thet lets you play Space invaders.

space_Invaders A discord bot thet lets you play Space invaders. It is my first discord bot... so please give any suggestions to improve it :] Commands

2 Dec 30, 2021
The wrapper you need for the osu!api v2

oppy (op.py) oppy is the wrapper for use on the osu! v2 API. Version 1.0.0 Installation To install please use pip to install oppy pip install op.py To

Wayde 2 May 01, 2022
Select random winners for a Twitter giveaway

twitter_picker Select random winners for a Twitter giveaway Once the Twitter giveaway (or airdrop) is closed, assign a number to each participant. The

Michael Rawner 1 Dec 11, 2021
Role Based Access Control for Slack-Bolt Applications

Role Based Access Control for Slack-Bolt Apps Role Based Access Control (RBAC) is a term applied to limiting the authorization for a specific operatio

Jeremy Schulman 7 Jan 06, 2022
Terminal Bot which will Execute your Commands From telegram bot!

Terminal-Bot see this bot alive: https://t.me/HerokuTerminal_Bot With this bot you can execute system commands on your server. how to config? clone or

Moshe 41 Dec 09, 2022
Space Bot, a Discord bot built for HackerSpace Club of PES University

Space Bot Space Bot, a Discord bot built for HackerSpace Club of PES University What can Space Bot do? Space Bot allows you to lookup any mentor or to

HackerSpace @PESU 7 Oct 23, 2022
An instagram bot developed in Python with Selenium that helps you get more Instagram followers.

instabot An instagram bot developed in Python with Selenium that helps you get more Instagram followers. Install You’ll need to have: Python Selenium

65 Nov 22, 2022
Jupyter notebooks and AWS CloudFormation template to show how Hudi, Iceberg, and Delta Lake work

Modern Data Lake Storage Layers This repository contains supporting assets for my research in modern Data Lake storage layers like Apache Hudi, Apache

Damon P. Cortesi 25 Oct 31, 2022
Update your World of Warcraft AddOns hosted on GitHub

AddOns Update Tool Tool to update World of Warcraft AddOns hosted on GitHub Features Pure Python: only Dulwich and Colorlog Multithreaded tasks Manual

Mr. Alchemist 16 Dec 06, 2022
WaifuGen - A program made in waifuGen that generates SFW and NSFW waifus from the waifu.pics API

waifuGen A program made in waifuGen that generates SFW and NSFW waifus from the

1 Jan 05, 2022
Cogs for Red-DiscordBot

matcha-cogs Cogs for Red-DiscordBot. Installation [p]repo add matcha-cogs

MatchaTeaLeaf 2 Aug 27, 2022
With Google Drive API. My computer and my phone are in love now.

Channel trought Google Drive Google Drive API In this case, "Google Drive App" is the program. To install everything you need(has some extra things),

Luis Quiñones Requelme 1 Dec 15, 2021
A simple tool which automate commands of discord economy bots

A simple tool which automate commands of discord economy bots. Fully configurable using an intuitive configuration made in YAML

SkydenFly 5 Sep 18, 2022
My personal template for a discord bot, including an asynchronous database and colored logging :)

My personal template for a discord bot, including an asynchronous database and colored logging :)

Timothy Pidashev 9 Dec 24, 2022
Group Chat Spammer For Discord

Group Chat Spammer For Discord Free and public gc spammer

Dreamy 20 Dec 27, 2022