cleanup
git commit -m cleanup
This commit is contained in:
parent
14d35dc6d4
commit
9b410e0b48
21
README.md
21
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.
|
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.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.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.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.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.
|
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.
|
Make sure this one is installed.
|
||||||
example:
|
example:
|
||||||
```py
|
```py
|
||||||
if self.mainenance:
|
if self.bot.mainenance:
|
||||||
print('I am in the development branch')
|
print('I am in the development branch')
|
||||||
|
|
||||||
if not self.mainenance:
|
if not self.bot.mainenance:
|
||||||
print('I am in the master branch)
|
print('I am in the master branch)
|
||||||
```
|
```
|
||||||
With other words. self.mainenance returns False in production and True in developer modus.
|
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
|
## Initialize a cog
|
||||||
Cogs can be placed in `./src/cogs`. Overall the `src` folder is the place to put code in.
|
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.
|
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.
|
||||||
|
|||||||
2
run.py
2
run.py
@ -19,7 +19,7 @@ class SebiMachine(commands.Bot, LoadConfig):
|
|||||||
# Initialize and attach config / settings
|
# Initialize and attach config / settings
|
||||||
LoadConfig.__init__(self)
|
LoadConfig.__init__(self)
|
||||||
commands.Bot.__init__(self, command_prefix=self.defaultprefix)
|
commands.Bot.__init__(self, command_prefix=self.defaultprefix)
|
||||||
self.embed_color = discord.Color(0x00FFFF)
|
|
||||||
|
|
||||||
# Load plugins
|
# Load plugins
|
||||||
# Add your cog file name in this list
|
# Add your cog file name in this list
|
||||||
|
|||||||
@ -1,14 +1,9 @@
|
|||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
import traceback
|
import traceback
|
||||||
import discord
|
|
||||||
import inspect
|
|
||||||
import textwrap
|
import textwrap
|
||||||
from contextlib import redirect_stdout
|
from contextlib import redirect_stdout
|
||||||
from discord.errors import HTTPException
|
|
||||||
import psycopg2
|
|
||||||
import io
|
import io
|
||||||
import asyncio
|
|
||||||
import re
|
|
||||||
|
|
||||||
class REPL:
|
class REPL:
|
||||||
"""Python in Discords"""
|
"""Python in Discords"""
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
# -*- coding: <encoding name> -*-
|
# -*- coding: <encoding name> -*-
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
import discord
|
||||||
|
|
||||||
class LoadConfig:
|
class LoadConfig:
|
||||||
"""
|
"""
|
||||||
@ -19,6 +19,7 @@ class LoadConfig:
|
|||||||
self.version = self.config["version"]
|
self.version = self.config["version"]
|
||||||
self.display_name = self.config["display_name"]
|
self.display_name = self.config["display_name"]
|
||||||
self.maintenance = self.config["maintenance"]
|
self.maintenance = self.config["maintenance"]
|
||||||
|
self.embed_color = discord.Color(0x00FFFF)
|
||||||
if self.maintenance == 'False':
|
if self.maintenance == 'False':
|
||||||
self.maintenance = False
|
self.maintenance = False
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user