Skip to content

NotUSeee/yourbot-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YourBot SDK

SDK for building plugins for the YourBot Discord bot platform.

YourBot runs marketplace plugins in sandboxed Docker containers. This SDK is the official Python interface plugins use to receive Discord events, call the Discord API, store data, render dashboards, and emit metrics — all routed through the platform so plugins never need direct network access or credentials.

Install

pip install yourbot-sdk

Python 3.10 or newer.

Hello, plugin

from yourbot_sdk import Plugin, Context

plugin = Plugin()

@plugin.on_event("message_create")
def on_message(ctx: Context, event: dict):
    if "!ping" in event.get("content", ""):
        ctx.discord.send_message(
            channel_id=event["channel_id"],
            content="Pong!",
        )

plugin.run()  # must be the last line

Drop this in a folder named my_plugin/ as __main__.py, zip it, and upload it via the Developer Portal.

CLI

The package installs a yourbot command for scaffolding and a local dev loop:

yourbot new my_plugin     # scaffold a new plugin from the template
yourbot dev               # run your plugin locally against a mock host

Documentation

Full plugin contract, capability reference, and publishing guide:

License

MIT — see LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages