/discord

⚙️ Some small cogs and stuff for Pycord

Primary LanguagePython

⚙️ Some things for Pycord

Constructive suggestions are welcome

roles - Powerful role management system
  • Give users a simple role management UI
  • Define multiple commands/menus at runtime
  • Allow only a single role per menu (e.g. for letting the user choose a role icon role)
  • To use, see main.py#L4-L117 for how to define menus, then import roles and call roles.Roles()
  • This will register at least 1 new command based on the settings provided

colors - Easy color role management for both admins and users - Inspired by Reactify
  • Admins can easily define new color roles by prefixing them with [C] (or change the prefix)
  • The cog will build a simple menu for users based on these rules
  • To use, simply add some color roles to your server, then import & add the cog
  • This will register /colors

imdb - Simple IMDb lookup
  • This cog requires a local copy of the IMDb dataset. The DB takes up 10GB+ but is much faster and more reliable than not using one
  • Search by name or provide an ID
  • To use, make sure you generate an sqlite db, then import and add the cog
  • This will register /imdb
from cogs import imdb
bot.add_cog(imdb.Imdb(bot, db="sqlite:///imdb.sqlite"))

simple_publisher - Invite me! - Automagically publish messages from Announcement channels
  • The bot has to have the View Channel, Send Messages, Manage Messages and Read Message History permissions on any channel(s) you want to publish from; revoke these permissions to stop it from publishing
  • To use, simply import and register the cog

Usage

Check out bots/example.py for basic usage of all the cogs

The other bots contain various other practical examples:

  • Several implement the logging handler from utils/webhook.py, which posts logging messages to a Discord webhook
  • hideaway shows usage of the roles cog, and registers /customize, which combines views from both roles and colors into an interactive menu

In supervisor, you can see some examples on using supervisord to manage bot instances. listener.py can post supervisor events to a Discord webhook

Screenshots

/customize
roles
imdb
colors