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
Unofficial Meteor Client wiki

Welcome to the Unofficial Meteor Client wiki! Meteor FAQs | A rewritten and better FAQ page. Installation Guide | A guide on how to install Meteor Cli

Anti Cope 0 Feb 21, 2022
Library to manage your own custom RPC on your desktop

Info I don't recommend novices setting this up yourself. It requires Redis, a server to host the API on, and a bit of understanding of Windows & Pytho

Isaac K 1 Apr 16, 2022
💻 Discord-Auto-Translate-Bot - If you type in the chat room, it automatically translates.

💻 Discord-Auto-Translate-Bot - If you type in the chat room, it automatically translates.

LeeSooHyung 2 Jan 20, 2022
Discord bot for calculating basic operations and formulas. (Early Development)

MathBot Discord bot for calculating basic operations and formulas. (Early Development) Commits Feel free to contribute to this bot by forking and pull

4 Jul 14, 2022
Async wrapper over hentaichan.live

hentai-chan-api-async is a small asynchronous parser library that will allow you to easily use manga from https://hentaichan.live Recommended to use python3.7+

7 Dec 15, 2022
Get random jokes bapack2 on telegram

Jokes Bapack2 Telegram Bot Get random jokes bapack2 from jokes-bapack2-api on telegram bot Screenshot Requirements python pip pipenv python-telegram-b

Miftah Afina 2 Nov 17, 2021
A multi-platform HTTP(S) Reverse Shell Server and Client in Python 3

Phantom - A multi-platform HTTP(S) Reverse Shell Server and Client Phantom is a multi-platform HTTP(S) Reverse Shell server and client in Python 3. Bi

85 Nov 18, 2022
A telegram bot to track whales activities on multiple blockchains.

Telegram Bot : Whale Watcher A straightforward telegram bot written in python to track whales activity on multiple blockchains, using whale-alert API

Laurenz Bougan 1 Dec 10, 2021
Use Seaborn to visualize interpret the byte layout of Solana account types

solana-account-vis Use Seaborn to visually interpret the byte layout of Solana account types Usage from account_visualization import generate_account_

Jarry Xiao 15 Aug 25, 2022
Flood discord webhooks

Webhook-Spammer Flood discord webhooks Asynchronous webhook spammer Fast & Efficient Usage - Use it with atleast 500 threads Put a valid webhook Use a

trey 1 Apr 22, 2022
A Discord Bot created using Pycord!

Hey, I am Slash Bot. A Bot which works with Slash Commands! Prerequisites Python 3+ Check out. the requirements.txt and install all the pakages. Insta

Saumya Patel 1 Nov 29, 2021
Finds Jobs on LinkedIn using web-scraping

Find Jobs on LinkedIn 📔 This program finds jobs by scraping on LinkedIn 👨‍💻 Relies on User Input. Accepts: Country, City, State 📑 Data about jobs

Matt 44 Dec 27, 2022
Python written Rule34 API

Python written Rule34 API

1 Nov 11, 2021
Zero2 Discord bot is written with Discord.py using Python.

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

Siva Avanish 4 Nov 08, 2021
ByDiego Token Grabber is a Discord Stealer

ByDiego Token Grabber is a Discord Stealer. This way you can get too much information from x person if you pass it on and open it

zByDiegoM.T 4 Mar 11, 2022
OpenSea-Python-Bot - OpenSea Python Bot can be used in 2 modes

OpenSea-Python-Bot OpenSea Python Bot can be used in 2 modes. When --nft paramet

49 Feb 10, 2022
Module to use some statistics from Spotify API

statify Module to use some statistics from Spotify API To use it you have to import the functions into your own project. You have also to authenticate

Miguel Cózar 2 Jun 02, 2022
Sends messages to a Discord webhook whenever you make a new commit to your local git repository.

Git-Notif Sends messages to a Discord webhook whenever you make a new commit to your local git repository. Usage Just drop notifier.py into your git h

1 May 29, 2022
Backlog API v2 Client Library for Python

BacklogPy - Backlog API v2 Client Library for Python BacklogPy is Backlog API v2 Client Library for Python 2/3 Install You can install the client libr

Koudai Aono 7 Dec 16, 2022
Efetuar teste de automação usando linguagem gherkin

🚀 Teste-de-Automação - QA---CI-T 🚀 Descrição • Primeira Parte • Segunda Parte • Terceira Parte Contributors Descrição Efetuamos testes de automação

Eliel martins 6 Dec 07, 2021