diff --git a/README.md b/README.md index eea3036..0e1e939 100644 --- a/README.md +++ b/README.md @@ -60,4 +60,4 @@ If you are stuck in any way shape or form you can always contact anyone who work - http://discord.gg/GWdhBSp - http://chillout.ueuo.com - http://trello.com/b/x02goBbW/sebis-bot-tutorial-roadmap - +[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/Raatty/Sebi-Machine/tree/development) diff --git a/app.json b/app.json new file mode 100644 index 0000000..d5d8b35 --- /dev/null +++ b/app.json @@ -0,0 +1,15 @@ +{ + "name":"sebi-machine", + "stack":"container", + "env": { + + "ownerlist": { + "description": "comma seperated list of owner ids", + "required": true + }, + "botkey": { + "description": "bot token", + "required": true + } + } +} diff --git a/heroku.yml b/heroku.yml new file mode 100644 index 0000000..2d41892 --- /dev/null +++ b/heroku.yml @@ -0,0 +1,3 @@ +build: + docker: + worker: dockerfile diff --git a/src/__main__.py b/src/__main__.py index 8b4ecd8..e6b15ea 100644 --- a/src/__main__.py +++ b/src/__main__.py @@ -10,6 +10,7 @@ import json import logging import random import traceback +import os import discord from discord.ext import commands @@ -98,4 +99,7 @@ client = SebiMachine() # I am 99% certain this is valid! with open(in_here('config', 'PrivateConfig.json')) as fp: PrivateConfig = json.load(fp) +if PrivateConfig["bot-key"] == '': + PrivateConfig["bot-key"] = os.getenv('botkey') + client.run(PrivateConfig["bot-key"]) diff --git a/src/config/config.py b/src/config/config.py index b6f5acf..fe00265 100644 --- a/src/config/config.py +++ b/src/config/config.py @@ -3,6 +3,7 @@ import json import discord +import os class LoadConfig: """ @@ -14,7 +15,10 @@ class LoadConfig: self.config = json.load(fp) # Initialize config - self.ownerlist = self.config["ownerlist"] + if self.config["ownerlist"] != []: + self.ownerlist = self.config["ownerlist"] + else: + self.ownerlist = [int(i) for i in os.getenv('ownerlist').split(',')] self.defaultprefix = self.config["prefix"] self.version = self.config["version"] self.display_name = self.config["display_name"]