The big security update.
This commit is contained in:
+19
-3
@@ -7,6 +7,8 @@ import Cryptocoin
|
||||
import Chatbot
|
||||
import logging
|
||||
import importlib
|
||||
import configparser
|
||||
import base64
|
||||
|
||||
from discord.ext import commands
|
||||
|
||||
@@ -20,11 +22,25 @@ bot.add_cog(General.General(bot))
|
||||
bot.add_cog(Cryptocoin.Cryptocoin(bot))
|
||||
bot.add_cog(Chatbot.Chatbot(bot))
|
||||
|
||||
tokenfile = open("stroopwafel.token","r")
|
||||
token = tokenfile.readline().strip()
|
||||
#tokenfile = open("stroopwafel.token","r")
|
||||
#token = tokenfile.readline().strip()
|
||||
config = configparser.ConfigParser()
|
||||
config.read('stroopwafel.ini')
|
||||
bot.tokens = config["tokens"]
|
||||
bot.hdChannels = config["channels"]
|
||||
#passwords are base64 encoded, which makes it like 1% safer
|
||||
bot.passwords = {}
|
||||
for pw in config["passwords"]:
|
||||
try:
|
||||
bot.passwords[pw] = (base64.standard_b64decode(config["passwords"][pw])).decode()
|
||||
except:
|
||||
print("Problem with decoding password!")
|
||||
bot.passwords[pw] = config["passwords"][pw]
|
||||
|
||||
|
||||
@bot.event
|
||||
@asyncio.coroutine
|
||||
def on_ready():
|
||||
print('Logged in as:\n{0} (ID: {0.id})'.format(bot.user))
|
||||
|
||||
bot.run(token)
|
||||
bot.run(bot.tokens["discordbot"])
|
||||
|
||||
Reference in New Issue
Block a user