Toby Harradine d1a46acc9a PostgreSQL driver, tests against DB backends, and general drivers cleanup (#2723)
* PostgreSQL driver and general drivers cleanup

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Make tests pass

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Add black --target-version flag in make.bat

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Rewrite postgres driver

Most of the logic is now in PL/pgSQL.

This completely avoids the use of Python f-strings to format identifiers into queries. Although an SQL-injection attack would have been impossible anyway (only the owner would have ever had the ability to do that), using PostgreSQL's format() is more reliable for unusual identifiers. Performance-wise, I'm not sure whether this is an improvement, but I highly doubt that it's worse.

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Reformat

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Fix PostgresDriver.delete_all_data()

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Clean up PL/pgSQL code

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* More PL/pgSQL cleanup

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* PL/pgSQL function optimisations

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Ensure compatibility with PostgreSQL 10 and below

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* More/better docstrings for PG functions

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Fix typo in docstring

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Return correct value on toggle()

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Use composite type for PG function parameters

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Fix JSON driver's Config.clear_all()

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Correct description for Mongo tox recipe

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Fix linting errors

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Update dep specification after merging bumpdeps

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Add towncrier entries

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Update from merge

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Mention [postgres] extra in install docs

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Support more connection options and use better defaults

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Actually pass PG env vars in tox

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Replace event trigger with manual DELETE queries

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-08-26 22:02:26 -04:00
2019-03-28 13:41:17 -04:00
2019-07-17 11:12:43 +10:00


Red - Discord Bot
Red Discord Bot

Music, Moderation, Trivia, Stream Alerts and Fully Modular.

Discord Server Support Red on Patreon! Made with Python 3.7 Localized with Crowdin discord.py

Travis CI Red on readthedocs.org Code Style: Black

OverviewInstallationDocumentationPluginsCommunityLicense

Overview

Red is a fully modular bot meaning all features and commands can be enabled/disabled to your liking, making it completely customizable. This is also a self-hosted bot meaning you will need to host and maintain your own instance. You can turn Red into an admin bot, music bot, trivia bot, new best friend or all of these together!

Installation is easy, and you do NOT need to know anything about coding! Aside from installation and updating, every part of the bot can be controlled from within Discord.

The default set of modules includes and is not limited to:

  • Moderation features (kick/ban/softban/hackban, mod-log, filter, chat cleanup)
  • Trivia (lists are included and can be easily added)
  • Music features (YouTube, SoundCloud, local files, playlists, queues)
  • Stream alerts (Twitch, Youtube, Mixer, Hitbox, Picarto)
  • Bank (slot machine, user credits)
  • Custom commands
  • Imgur/gif search
  • Admin automation (self-role assignment, cross-server announcements, mod-mail reports)
  • Customisable command permissions

Additionally, other plugins (cogs) can be easily found and added from our growing community of cog repositories.

Installation

The following platforms are officially supported:

If after reading the guide you are still experiencing issues, feel free to join the Official Discord Server and ask in the #support channel for help.

Plugins

Red is fully modular, allowing you to load and unload plugins of your choice, and install 3rd party plugins directly from Discord! A few examples are:

  • Cleverbot integration (talk to Red and she talks back)
  • Ban sync
  • Welcome messages
  • Casino
  • Reaction roles
  • Slow Mode
  • AniList
  • And much, much more!

Feel free to take a peek at a list of available 3rd party cogs!

Join the community!

Red is in continuous development, and its supported by an active community which produces new content (cogs/plugins) for everyone to enjoy. New features are constantly added. If you cant find the cog youre looking for, consult our guide on building your own cogs!

Join us on our Official Discord Server!

License

Released under the GNU GPL v3 license.

Red is named after the main character of "Transistor", a video game by Super Giant Games.

Artwork created by Sinlaire on Deviant Art for the Red Discord Bot Project.

Languages
Python 98.9%
PLpgSQL 0.9%