Skip to content
Yet another general purpose discord bot
Go CSS HTML JavaScript Other
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci ci: improve misc artifacts formatting Jul 17, 2019
automod all: seperate db schemas into multiple parts to avoid deadlocks on st… Jul 20, 2019
automod_legacy automod_legacy: moved invite regex test to common, where it belongs Jul 15, 2019
autorole autorole: add config option to disable retroactive scans for non prem… Jul 21, 2019
aylien Merge branch 'dev' May 31, 2019
bot bot: fix panic in GetMessages when limit-1 messages in state was avai… Aug 18, 2019
cah Merge branch 'dev' May 31, 2019
cmd main: more logging during startup Aug 1, 2019
commands commands: add config option to not set typing Jul 21, 2019
common update version to 1.19.19 Aug 17, 2019
customcommands cc: add the current custom command to local variables Aug 1, 2019
discordlogger Merge branch 'dev' May 31, 2019
feeds all: improve formatting, use retryableredit command funcs for reliabi… May 27, 2019
logs logs: fix username and nickname logging being disabled in default con… Aug 1, 2019
moderation moderation: don't prefix with author if bot is the perpetrator Jun 27, 2019
notifications eventsystem: redo emiting method and ordering May 17, 2019
premium premium: set YAGPDB_PREMIUM_ALL_GUILDS_PREMIUM=1 to make all guilds p… Aug 2, 2019
reddit all: seperate db schemas into multiple parts to avoid deadlocks on st… Jul 20, 2019
reminders finish migrating all plugins to ne wlogging Apr 30, 2019
reputation all: seperate db schemas into multiple parts to avoid deadlocks on st… Jul 20, 2019
rolecommands rolcommands: add stat tracking for assigned roles Jul 21, 2019
rsvp all: seperate db schemas into multiple parts to avoid deadlocks on st… Jul 20, 2019
safebrowsing all: finishing up work on new config system for May 26, 2019
serverstats serverstats: fixed partial loading not loading the stylesheet Jul 28, 2019
soundboard all: seperate db schemas into multiple parts to avoid deadlocks on st… Jul 20, 2019
stdcommands bot: add global ratelimit propegation Aug 16, 2019
streaming Merge branch 'dev' May 31, 2019
tickets tickets: add seperate transcript channel for admin only tickets Aug 2, 2019
timezonecompanion tzcompanion: stricter regexes, no longer matches on A and P alone Jul 20, 2019
twitter all: seperate db schemas into multiple parts to avoid deadlocks on st… Jul 20, 2019
verification verification: don't retry on failed finding verification model Jul 21, 2019
web web: proper ip extraction of ipv6 Jul 30, 2019
yagpdb_docker Merge branch 'dev' Jul 30, 2019
youtube Merge branch 'dev' May 31, 2019
.gitignore add more stuff to .gitignore Nov 4, 2018
CONTRIBUTING.md Updated all (hopefully) of the discord invites on the cp to the new f… Apr 15, 2019
LICENSE Update license (#444) May 6, 2019
README.md docker-compose: Duplicate config across configurations, fix running (#… Jul 27, 2019
SUGGESTION_TEMPLATE.md Update SUGGESTION_TEMPLATE.md (#453) May 26, 2019
breaking_changes.md add new breaking change to breaking_changes.txt Jul 27, 2019
info.html fixed typo (#354) Oct 28, 2018

README.md

YAGPDB

Yet another general purpose discord bot

YAGPDB is a multifunctional, modular Discord bot. It's modular in that plugins exist for the most part on their own (with exceptions to some lazy things in the main stylesheet), some plugins do however depend on other plugins (most plugins depend on the commands plugin, for example).

Links

Running YAGPDB yourself

Running this bot may seem challenging, and that's because I don't have time to make it easy to run for everyone, for the most part, it should run fine after the initial work has been done. Please view this page for more information.

Updating

Updating after v1 should migrate schemas automatically, but you should always take backups beforehand if things go wrong.

I will put breaking changes in the breaking_changes.md file, which you should always read before updating.

There's 2 ways of running this bot

  1. Using Docker
  2. Standalone

I will not help with basic problems or how to do unrelated things (how to run it on startup for example), use Google, if those well written tutorials and articles confuse you, how the hell is a guy with English as a second language gonna be any better?

(There's still a lot of contributing you can do without this though, such as writing docs, fixing my horrible typos and so on)

General Discord 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:

Docker quickstart

If you have docker-compose installed, it will offer the fastest route to getting up-and-running.

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

Edit app.env and db.env to specify the Discord bot values from above.

Make sure ports 80 and 443 are accessible on your network and launch:

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

The bot will connect automatically and the control panel will be available via your host after a short setup.

If you are running several bots (or other websites alongside the bot), consider running a proxy such as jrcs/letsencrypt-nginx-proxy-companion.

First, start the proxy. This needs to be started only once and is shared by all websites:

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

And then start the bot using the proxy:

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

Standalone/Manual setup

Requirements

  • Fairly recent go version (1.11 or later, I use new features as soon as they're out, so watch out in breaking_changes)
  • PostgreSQL 9.6 or later
  • Redis version 3.x or later (maybe it's possible to get it working with earlier versions, however I'm not 100% sure)

I may update the bot at any point to require newer versions of any of these, so you should ALWAYS check breaking_changes before updating.

First step is to set those up and get them running:

  1. Install and configure redis and postgres with your desired settings (my DM's are not Google, you'll have to figure at least this much out on your own...)
  2. Create a user named yagpdb and database named yagpdb which the user yagpdb has write access to
  3. Update your env vars with the config (see example env file in cmd/yagpdb/)
  4. Done.

Steps for building:

YAGPDB currently uses a lot of alternative branches of my projects, mainly because I also use a discordgo fork with a lot of goodies in it (why not push my changes upstream? Cause a shit ton of breaking changes that would never get accepted)

I'm working towards making YAGPDB fully go get ...-able

git clone -b yagpdb https://github.com/jonas747/discordgo $GOPATH/src/github.com/jonas747/discordgo
git clone -b dgofork https://github.com/jonas747/dutil $GOPATH/src/github.com/jonas747/dutil
git clone -b dgofork https://github.com/jonas747/dshardmanager $GOPATH/src/github.com/jonas747/dshardmanager
go get -v -d github.com/jonas747/yagpdb/cmd/yagpdb
cd $GOPATH/src/github.com/jonas747/yagpdb/cmd/yagpdb
go build

After this, unless you wanna run it in testing mode using YAGPDB_TESTING=yes you have to run cmd/yagpdb/copytemplates.sh to copy all the plugin specific template files into the cmd/yagpdb/templates/plugins folder.

You can now run ./yagpdb

Configuration is done through environment variables. See cmd/yagpdb/sampleenvfile for what environment variables are available.

You can run the web server, bot, reddit and youtube parts as separate processes (some smallish limitations require to to run it on the same machine, will likely be removed soon as I'm gonna need to work on horizontal scaling soon)

You specify -bot to run the bot, -web to run the web server, -feeds "youtube,reddit" to run the reddit and youtube feeds.

The web server by default (unless -pa) listens on 5000(http) and 5001(https) So if you're behind a NAT, forward those, if not you can either use the -pa switch or add an entry to iptables.

Plugins

Standard plugins:

  • Youtube-Feed
  • Stream-announcements
  • Server Stats
  • Soundboard
  • Reputation
  • Reminder
  • Reddit-Feed
  • Notifications
  • Moderation
  • Logs
  • Custom commands
  • And More!

Planned plugins

See the Issues Tab for more

Core packages:

  • Web: The core web server package, in charge of authentication.
  • Bot: Core bot package, delegates events to plugins.
  • Common: Handles all the common stuff between web and bot (config, discord session, redis pool etc).
  • Feeds: Handles all feeds, personally I like to run each feed as its own service, that way I can start and stop individual feeds without taking everything down.
  • Commands: Handles all commands.

Currently, YAGPDB builds everything into one executable and you run the bot with the -bot switch, the web server with the -web switch and so on (see -h for help).

Databases

YAGPDB uses redis for light data and caching (and some remnants of configuration).

It uses PostgreSQL for most configuration and more heavy data (logs and such).

Contributing new features

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.

If you need any help finding things in the source or have any other questions, don't be afraid of messaging me.

You can’t perform that action at this time.