A fast, stateless http slash commands framework for scale. Built by the Crunchy bot team.

Overview

Roid 🤖

A fast, stateless http slash commands framework for scale. Built by the Crunchy bot team.



🚀 Installation

You can install roid in it's default configuration via:

pip install roid

You can install with the optional speedups e.g. orjson with:

pip install roid[speedups]

📚 Getting Started

You can get started with the following options, most of the public API is type hinted and a lot of the framework depends around this so you should be able to stand on your own two feet reasonable quickly.

  • Examples are the best / only place to start.

Basic Example

import os
import uvicorn

import roid

application_id = os.getenv("APPLICATION_ID")
public_key = os.getenv("PUBLIC_KEY")
token = os.getenv("BOT_TOKEN")

app = roid.SlashCommands(application_id, public_key, token)

# We can create async commands
@app.command("echo", "Echo a message.", guild_id=675647130647658527)
async def echo(message: str):
    return Response(content=message, flags=ResponseFlags.EPHEMERAL)


# Or sync commands which are ran in another thread.
# While this is not advised for everything, we do provide threadsafe interfaces
# to the state management system.
@app.command("echo-sync", "Echo a message with threading.", guild_id=675647130647658527)
def echo_sync(message: str):
    return Response(content=message, flags=ResponseFlags.EPHEMERAL)


if __name__ == "__main__":
    app.register_commands_on_start()
    uvicorn.run("app:app", port=8000)

❤️ Developer Note

Please note that this library is largely designed around what we need the framework to do rather than strictly as a general API framework.

You may notice rather opinionated things e.g. how we work command groups. Which are a trait of that. These things are generally subject to change with Discord but right now we thing the standard command groups look rather poor.

This framework is not for everyone, if you need the gateway or general REST api calls this is probably not the framework for you. (Although if you would like to add some more of the slash commands REST api then feel free to PR.)

This is also why there generally arent any forms of online docs for this, i'll get around to it, eventually.

You might also like...
A Python wrapper for discord slash-commands, designed to extend discord.py.

dislash.py An extending library for discord.py that allows to build awesome slash-commands. ⭐

A python library for creating Slack slash commands using AWS Lambda Functions

slashbot Slashbot makes it easy to create slash commands using AWS Lambda functions. These can be handy for creating a secure way to execute automated

Serves some data over HTTP, once. Based on the built-in Python module http.server

serve-me-once Serves some data over HTTP, once. Based on the built-in Python module http.server.

PathPicker accepts a wide range of input -- output from git commands, grep results, searches -- pretty much anything.After parsing the input, PathPicker presents you with a nice UI to select which files you're interested in. After that you can open them in your favorite editor or execute arbitrary commands. A selfbot made with DPY, doesn't have much commands but there's some useful commands to use.
A selfbot made with DPY, doesn't have much commands but there's some useful commands to use.

Phantom Selfbot A selfbot made in DPY, made by Zenith. How to use Add your token in token = 'YOUR-MOMS-TOKEN-HERE' Change the prefix in prefix = If

Pincer-ext-commands - A simple, lightweight package for pincer prefixed commands

pincer.ext.commands A reimagining of pincer's command system and bot system. Ins

 Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.
Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.

Japronto! There is no new project development happening at the moment, but it's not abandoned either. Pull requests and new maintainers are welcome. I

 Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.
Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.

Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.

HackBMU-5.0-Team-Ctrl-Alt-Elite - HackBMU 5.0 Team Ctrl Alt Elite

HackBMU-5.0-Team-Ctrl-Alt-Elite The search is over. We present to you ‘Health-A-

A discord bot wrapper for python have slash command

A discord bot wrapper for python have slash command

A Discord Bot - has a few commands. Built using python - Discord.py - RIP.
A Discord Bot - has a few commands. Built using python - Discord.py - RIP.

Discord_Bot A Discord Bot has been built here. It is capable of running a few commands. The below present screenshot should suffice in terms of explai

domhttpx is a google search engine dorker with HTTP toolkit built with python, can make it easier for you to find many URLs/IPs at once with fast time.
domhttpx is a google search engine dorker with HTTP toolkit built with python, can make it easier for you to find many URLs/IPs at once with fast time.

domhttpx is a google search engine dorker with HTTP toolkit built with python, can make it easier for you to find many URLs/IPs at once with fast time

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.

⚡ Fast • 🪶 Lightweight • 0️⃣ Dependency • 🔌 Pluggable • 😈 TLS interception • 🔒 DNS-over-HTTPS • 🔥 Poor Man's VPN • ⏪ Reverse & ⏩ Forward • 👮🏿 Simple and rapid application development framework, built on top of Flask. includes detailed security, auto CRUD generation for your models, google charts and much more. Demo (login with guest/welcome) - http://flaskappbuilder.pythonanywhere.com/
A discord http interactions framework built on top of Sanic

snowfin An async discord http interactions framework built on top of Sanic Installing for now just install the package through pip via github # Unix b

A simple discord slash command handler for for discord.py.
A simple discord slash command handler for for discord.py.

A simple discord slash command handler for discord.py About ⦿ Installation ⦿ Disclaimer ⦿ Examples ⦿ Documentation ⦿ Discussions Note that master bran

A drop-in vanilla discord.py cog to add slash command support with little to no code modifications

discord.py /slash cog A drop-in vanilla discord.py cog that acts as a translation layer to add slash command support with little to no code modificati

Slash util - A simple script to add application command support to discord.py v2.0
Slash util - A simple script to add application command support to discord.py v2.0

slash_util is a simple wrapper around slash commands for discord.py This is writ

Releases(0.4.3)
  • 0.4.3(Sep 21, 2021)

    This fixes several issues and adds some new features:

    • Type parsing bugs with commands and checks where the return annotation would be mistaken for an option to parse.
    • Deferred components can now set a local error handler like everything else.
    • App can be passed to commands, checks and other handlers via adding a parameter called app. Unfortunately, It's not possible to do this based on type hinting so the system requires this as a reserved name.
    Source code(tar.gz)
    Source code(zip)
  • 0.2.2(Sep 20, 2021)

    This fixes some spelling errors in the docs as well as some type hints for checks.

    Before they lead you to believe you should still return an Interaction vs returning a Response object.

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

  • 0.2.0(Sep 20, 2021)

    This version fixes some cleanup issues with the component system and also allows state to persist between edits where it would have previously been lost causing issues with deleting parents.

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

Owner
Harrison Burt
Programmer in Python, Rust, Js and Go lang.
Harrison Burt
Textual is a TUI (Text User Interface) framework for Python using Rich as a renderer.

Textual is a TUI (Text User Interface) framework for Python using Rich as a renderer. The end goal is to be able to rapidly create rich termin

Will McGugan 17k Jan 2, 2023
Cement is an advanced Application Framework for Python, with a primary focus on CLI

Cement Framework Cement is an advanced Application Framework for Python, with a primary focus on Command Line Interfaces (CLI). Its goal is to introdu

Data Folk Labs, LLC 1.1k Dec 31, 2022
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

Matheus Muguet 4 Feb 5, 2022
Attempting to create a framework for Discord Slash commands... yes

discord_slash.py Attempting to create a framework for Discord Slash commands... yes Installation pip install slashpy Documentation Coming soon™ Why is

AlexFlipnote 11 Mar 24, 2021
An example of using discordpy 2.0.0a to create a bot that supports slash commands

DpySlashBotExample An example of using discordpy 2.0.0a to create a bot that supports slash commands. This is not a fully complete bot, just an exampl

null 7 Oct 17, 2022
Discord music bot using discord.py, slash commands, and yt-dlp.

bop Discord music bot using discord.py, slash commands, and yt-dlp. Features Play music from YouTube videos and playlists Queue system with shuffle Sk

Hizkia Felix 3 Aug 11, 2022
An example Music Bot written in Disnake and uses slash commands to operate.

Music Bot An example music bot that is written in Disnake [Maintained discord.py Fork] Disnake Disnake is a maintained and updated fork of discord.py.

null 6 Jan 8, 2022
A Slash Commands 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 18 Nov 15, 2022
Your custom slash commands Discord bot!

Slashy - Your custom slash-commands bot Hey, I'm Slashy - your friendly neighborhood custom-command bot! The code for this bot exists because I'm like

Omar Zunic 8 Dec 20, 2022
Your custom slash commands Discord bot!

Slashy - Your custom slash-commands bot Hey, I'm Slashy - your friendly neighborhood custom-command bot! The code for this bot exists because I'm like

Omar Zunic 3 Jan 8, 2022