diff --git a/README.md b/README.md index 1e0e30f..4d98aa9 100644 --- a/README.md +++ b/README.md @@ -7,32 +7,39 @@ http://discord.gg/GWdhBSp 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.bot.ownerlist self.ownerlist can be used to retrieve a `list` of user ID's. (`int`). Those ID's belong to contributors. -> self.defaultprefix +> self.bot.defaultprefix self.defaultprefix can be used to retrieve a `str` object of the default prefix. -> self.version +> self.bot.version self.version can be used to retrieve a `float` which represent the version number of the bot. -> self.display_name +> self.bot.display_name self.display_name returns a `str` which represent the display_name of the bot. -> self.mainenance +> self.bot.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: +if self.bot.mainenance: print('I am in the development branch') -if not self.mainenance: +if not self.bot.mainenance: print('I am in the master branch) ``` With other words. self.mainenance returns False in production and True in developer modus. +> self.bot.embed_color + +self.embed_color can be used to use the default color of out embed theme. +``` +discord.Embed(title='Foo', description='bar', color=self.bot.embed_color) +``` + ## 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. diff --git a/run.py b/run.py index 3342e7d..c3235a1 100644 --- a/run.py +++ b/run.py @@ -19,7 +19,7 @@ class SebiMachine(commands.Bot, LoadConfig): # Initialize and attach config / settings LoadConfig.__init__(self) commands.Bot.__init__(self, command_prefix=self.defaultprefix) - self.embed_color = discord.Color(0x00FFFF) + # Load plugins # Add your cog file name in this list diff --git a/src/cogs/code.py b/src/cogs/code.py index 7f07fdd..c288ee8 100644 --- a/src/cogs/code.py +++ b/src/cogs/code.py @@ -1,14 +1,9 @@ from discord.ext import commands import traceback -import discord -import inspect import textwrap from contextlib import redirect_stdout -from discord.errors import HTTPException -import psycopg2 import io -import asyncio -import re + class REPL: """Python in Discords""" diff --git a/src/config/config.py b/src/config/config.py index f32d0f6..b6f5acf 100644 --- a/src/config/config.py +++ b/src/config/config.py @@ -2,7 +2,7 @@ # -*- coding: -*- import json - +import discord class LoadConfig: """ @@ -19,6 +19,7 @@ class LoadConfig: self.version = self.config["version"] self.display_name = self.config["display_name"] self.maintenance = self.config["maintenance"] + self.embed_color = discord.Color(0x00FFFF) if self.maintenance == 'False': self.maintenance = False else: