MCPcopy Index your code
hub / github.com/botlabs-gg/yagpdb

github.com/botlabs-gg/yagpdb @v2.82.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.82.3 ↗ · + Follow
19,687 symbols 63,559 edges 1,674 files 6,240 documented · 32%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

YAGPDB - Yet Another General Purpose Discord Bot

YAGPDB is a multifunctional, modular Discord bot. It is modular in the sense that for most things plugins exist -- However, some plugins may depend on other plugins.

Plugins

  • YouTube Feed
  • Stream Announcements
  • Server Stats
  • Soundboard
  • Reputation
  • Reminders
  • Reddit Feed
  • Notifications
  • Moderation
  • Logs
  • Custom Commands
  • And More!

Useful Links

Selfhosting

There are two ways of selfhosting this bot: standalone, or dockerized.

General Bot Setup

Directions on creating an app and getting credentials may be found here.

YAGPDB does not require you to authorize the bot: all of that will be handled via the Control Panel.

In addition, you will need to add the following urls to the bot's "REDIRECT URI(S)" configuration:

HTTPS Options

YAGPDB supports two main HTTPS setups:

1. YAGPDB Handles HTTPS (Built-in)

Let YAGPDB serve HTTPS directly (no reverse proxy):

  • Just run with https (Default is true; you may specify this flag explicitly if desired): bash ./yagpdb --https=true
  • All HTTPS traffic is handled by YAGPDB.

2. Reverse Proxy Handles HTTPS (Recommended for Production)

Put YAGPDB behind a reverse proxy (like Nginx, Caddy, etc.):

  • Disable YAGPDB's built-in HTTPS server:
  • --https=false: YAGPDB uses plain HTTP internally.
  • --extHttps=true: Tell YAGPDB that HTTPS is handled externally. bash ./yagpdb --https=false --extHttps=true
  • Your proxy handles HTTPS, YAGPDB talks HTTP.

Hosting Dockerized

If you have docker-compose installed, that might be the fastest route of getting the bot up and running:

git clone https://github.com/botlabs-gg/yagpdb
cp yagpdb/yagpdb_docker/{app.example.env,app.env}
cp yagpdb/yagpdb_docker/{db.example.env,db.env}

Edit both env files accordingly. Make sure ports 80 and 443 are accessible on your network and that you have a proper image in docker-compose.yml:

docker-compose -f yagpdb/yagpdb_docker/docker-compose.yml up

Alternatively, you can run the bot behind a proxy:

docker network create proxy-tier
docker-compose -p proxy yagpdb/yagpdb_docker/docker-compose.proxy.yml up
docker-compose -f yagpdb/yagpdb_docker/docker-compose.proxied.yml up

During development, use the docker-compose.dev.yml file:

docker-compose -f yagpdb/yagpdb_docker/docker-compose.dev.yml up

Hosting Standalone

Requirements

  • Golang 1.23 or above
  • PostgreSQL 9.6 or later
  • Redis version 5.x or later

Setting Up

Configure Redis and Postgres with your desired settings.

In postgres, create a new user yagpdb and database yagpdb and grant that user access to that database.

Set up the environment variables with the credentials from the general setup. See the sample env file for a list of all enviroment variables.

Afterwards, run the build script located at /cmd/yagpdb/build.sh and start the bot using ./yagpdb:

git clone https://github.com/botlabs-gg/yagpdb
cd yagpdb/cmd/yagpdb
sh build.sh
./yagpdb -all

See ./yagpdb -help for all usable run flags. The webserver listens by default on ports 5000 (HTTP) and 5001 (HTTPS).

Databases

YAGPDB uses Redis for light data and caching, and postgresql for most configurations and heavy data, such as logs.

Updating

Updating with v1 and higher should migrate schemas automatically, but you should always make backups.

Breaking changes can be found in breaking_changes.md, which should always be consulted before updating.

Contributing

Please view the contributing guidelines before submitting any contributions.

See bot/plugin for info about bot plugins, web/plugin for web plugins and feeds/plugin for feeds if you wanna make a new fully fledged plugin.

Expect web, bot and feed instances to be run separately.

For basic utility/fun commands, you can just jam them in stdcommands. Use the existing commands there as an example of how to add one.

Please check CONTRIBUTING.md for further details.

Extension points exported contracts — how you extend this code

RulePart (Interface)
RulePart represents a single condition, trigger or effect [44 implementers]
automod/rulepart.go
MarshalerJSONObject (Interface)
MarshalerJSONObject is the interface to implement for struct to be encoded [40 implementers]
lib/gojay/encode.go
MessageComponent (Interface)
MessageComponent is a base interface for all message components. [24 implementers]
lib/discordgo/components.go
Cmd (Interface)
Cmd is the interface all commands must implement to be considered a command [28 implementers]
lib/dcmd/cmd.go
BotInitHandler (Interface)
Fired when the bot it starting up, not for the webserver [30 implementers]
bot/plugin.go
PluginWithFeatureFlags (Interface)
PluginWithFeatureFlags is a interface for plugins that provide their own feature-flags [9 implementers]
common/featureflags/featureflags.go
Plugin (Interface)
Plugin represents a plugin, all plugins needs to implement this at a bare minimum [5 implementers]
common/plugins.go
PluginWithSourceDisabler (Interface)
PluginWithSourceDisabler [5 implementers]
common/mqueue/mqueue.go

Core symbols most depended-on inside this repo

push
called by 2371
lib/template/exec.go
match
called by 1632
frontend/static/vendorr/codemirror/src/util/StringStream.js
append
called by 1472
frontend/static/vendorr/chartist/chartist.js
Pos
called by 1296
frontend/static/vendorr/codemirror/src/line/pos.js
New
called by 1266
lib/discordgo/event.go
$
called by 1113
frontend/static/vendorr/snap.svg/snap.svg.js
find
called by 1106
frontend/static/vendorr/codemirror/src/model/mark_text.js
eq
called by 720
frontend/static/vendorr/codemirror/test/driver.js

Shape

Function 9,780
Method 7,751
Struct 1,558
TypeAlias 326
FuncType 144
Interface 94
Class 34

Languages

Go65%
TypeScript35%

Modules by API surface

frontend/static/vendorr/datatables/extras/TableTools/pdfmake-0.1.32/pdfmake.min.js474 symbols
frontend/static/vendorr/codemirror/lib/codemirror.js429 symbols
lib/discordgo/eventhandlers.go362 symbols
frontend/static/vendorr/moment/moment.js245 symbols
lib/discordgo/restapi.go195 symbols
automod/triggers.go171 symbols
frontend/static/vendorr/summernote/summernote-lite.js161 symbols
frontend/static/vendorr/datatables/media/js/jquery.dataTables.js156 symbols
frontend/static/vendorr/datatables/extras/TableTools/DataTables-1.10.16/js/jquery.dataTables.js156 symbols
lib/template/parse/node.go150 symbols
frontend/static/vendorr/summernote/summernote.js149 symbols
frontend/static/vendorr/summernote/summernote-bs4.js149 symbols

For agents

$ claude mcp add yagpdb \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page