From 038cfa9d8bb07122d8ceced7374febf0be2b378c Mon Sep 17 00:00:00 2001 From: annihilator708 Date: Mon, 21 May 2018 03:33:29 +0200 Subject: [PATCH] Rewrote readme, cogs can now be put into a list. --- README.md | 40 +++++++++++++++++++++++++++++++++++++--- cogs.txt | 3 +++ run.py | 7 ++++--- 3 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 cogs.txt diff --git a/README.md b/README.md index 9bb9447..b4384ea 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,41 @@ # Sebi-Machine -Guild-bot +Dedicated discord bot for Sebi's bot tutorial. -Needs discord rewrite module. +http://discord.gg/GWdhBSp + +## Important things to know + +This bot extends the rewrite version of discord.py. A couple of variables have been added to give you easy access to a couple of objects listed here. + +> self.ownerlist + +self.ownerlist can be used to retrieve a `list` of user ID's. (`int`). Those ID's belong to contributors. +> self.defaultprefix + +self.defaultprefix can be used to retrieve a `str` object of the default prefix. +> self.version + +self.version can be used to retrieve a `float` which represent the version number of the bot. +> self.display_name + +self.display_name returns a `str` which represent the display_name of the bot. +> self.mainenance + +self.maintenance is equal to `True` or `False`. If you would like to exclude code in the master branch, use this. Make sure this one is installed. +example: +```py +if self.mainenance: + print('I am in the development branch') -When you add your cog makesure to add it also in the bot initial fase. Which can be found in run.py. \ No newline at end of file +if not self.mainenance: + print('I am in the master branch) +``` + +## Initialize a cog +Cogs can be placed in `./src/cogs`. Overall the `src` folder is the place to put code in. +Make sure to update the `requirements.txt` and it is important to add the name of your cog file into the `cogs.txt` list. Otherwise it may turn out that your cog wont load. + +## Update source code +There is a git command available provided by Dusty. `S!git pull` should pull the latest commits into the docker container. Make sure afterwards to reload the cog. +If you are stuck in any way shape or form you can always contact anyone who works on this project. Dont forget to check `S!help`. \ No newline at end of file diff --git a/cogs.txt b/cogs.txt new file mode 100644 index 0000000..5069854 --- /dev/null +++ b/cogs.txt @@ -0,0 +1,3 @@ +example +upload +git \ No newline at end of file diff --git a/run.py b/run.py index 7370ddf..1f5d10d 100644 --- a/run.py +++ b/run.py @@ -23,10 +23,11 @@ class SebiMachine(commands.Bot, LoadConfig): # Load plugins # Add your cog file name in this list - cogs = ['example', 'upload', 'git'] - + with open('cogs.txt', 'r') as cog_file: + cogs = cog_file.readlines() for cog in cogs: - print(cog) + print(f'Loaded:{cog}') + cog = cog.replace('\n', '') self.load_extension(f'src.cogs.{cog}') async def on_ready(self):