Development (#16)

* heroku yml

* owner list from env

* bot key from enviroment var

* app json

* heroku button

* again

* Update README.md

* fixing syntax hopefully

* error fixing

* enviroments added

* opsy forgot a }

* trying again

* Update app.json

* Update app.json

* Update app.json

* Update app.json

* Update app.json

* Update __main__.py

* Update app.json

* Update __main__.py

* removed prints
This commit is contained in:
Raatty 2018-05-23 20:32:20 +12:00 committed by GitHub
parent 523485461f
commit 88f2c4d087
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 2 deletions

View File

@ -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)

15
app.json Normal file
View File

@ -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
}
}
}

3
heroku.yml Normal file
View File

@ -0,0 +1,3 @@
build:
docker:
worker: dockerfile

View File

@ -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"])

View File

@ -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"]