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
It's a Discord bot to control your PC using your Discord Channel or using Reco: Discord PC Remote Controller App.

Reco PC Server Reco PC Server is a cross platform PC Controller Discord Bot which is a modified and improved version of Chimera for Reco-Discord PC Re

Arvinth Krishna 12 Aug 31, 2022
Discord bot script for sending multiple media files to a discord channel according to discord limitations.

Discord Bulk Image Sending Bot Send bulk images to Discord channel. This is a bot script that will allow you to send multiple images to Discord channe

Nikola Arbov 1 Jan 13, 2022
Discord.py-Bot-Template - Discord Bot Template with Python 3.x

Discord Bot Template with Python 3.x This is a template for creating a custom Di

Keagan Landfried 3 Jul 17, 2022
An Open-Source Discord bot created to provide basic functionality which should be in every discord guild. We use this same bot with additional configurations for our guilds.

A Discord bot completely written to be taken from the source and built according to your own custom needs. This bot supports some core features and is

Tesseract Coding 14 Jan 11, 2022
Discord ToolBox is a discord bot developed by DJD320 created for the purpose of having some convenient tools in the form of a single bot.

Discord ToolBox Discord ToolBox is a discord bot developed by DJD320 created for the purpose of having some convenient tools in the form of a single b

null 3 Aug 7, 2021
Linky bot, A open-source discord bot that allows you to add links to ur website, youtube url, etc for the people all around discord to see!

LinkyBot Linky bot, An open-source discord bot that allows you to add links to ur website, youtube url, etc for the people all around discord to see!

AlexyDaCoder 1 Sep 20, 2022
Image-Bot-Discord - This Is a discord bot that shows the specific image you search from Google

Advanced Discord.py Image Bot CREDITS Made by RLX and Mathiscool README by Milrato Installation Guide in .env Adjust the TOKEN python main.py to start

RLX 3 Jan 16, 2022
Example-bot-discord - Example bot discord xD

example-python-bot-discord Clone this repository Grab a token on Discord's devel

Amitminer 1 Mar 14, 2022
YouTube-Discord-Bot - Discord Bot to Search YouTube

YouTube Bot Info YouTube Bot is a discord bot where you can search for anything

Riceblades11 10 Mar 5, 2022
SongLink Discord Bot - Discord bot to share music links easily

SongLink_Discord_Bot Discord bot to share music links easily. Take a link from y

Edgar Lefevre 4 Feb 18, 2022