Module based Discord Bot
Contributions should be done through issues and pull requests. If there is a new feature that is desired, add it as an issue then work on it from there.
Please follow PEP8 when contributing to this repository.
If adding features, do so through discord.py cogs. This makes the bot more expandable and allows users to host their code in their own repo.
- Create your cog. Pass in any required data (i.e. config values) as parameters for the class constructor.
- Add your code to the bot.
- If working in Ganymede repository: Put code in the
cogs
folder. Create an issue, branch, and pull request for the new content. - If working in your own repo: Create an issue, branch, and pull request and add the repo as a submodule. Use the following command to add it:
Make sure that the code can be imported into Ganymede. If it can't, it may need to be restructed to be importable (make the imported module top level)git submodule add link/to/repository
- If working in Ganymede repository: Put code in the
- Import into Ganymede.
- Inside
ganymede.py
, add any required config options to theconfig_options
list. - Import the cog at the top of the file under the
# Cogs
comment - Inside
run()
under the# Load cogs
comment, add the cog to the bot. If the cog needs a function called to run, call it here.
async def run(): ... # Load cogs cog1 = Cog1(bot, db) # Cog with initialization await cog1.setup() bot.add_cog(cog1) bot.add_cog(Cog2(bot)) # Cog without initialization
- Inside