Use env vars, fixes #62

This commit is contained in:
Stijn De Clercq 2021-06-19 20:11:55 +02:00
parent a08bfca4c7
commit 418dc41126
10 changed files with 96 additions and 106 deletions

View file

@ -5,6 +5,7 @@ from discord.ext import commands
from functions import checks, easterEggResponses
from functions.database import stats, muttn, custom_commands
import pytz
from settings import READY_MESSAGE, SANDBOX, STATUS_MESSAGE
import time
import traceback
@ -30,20 +31,13 @@ class Events(commands.Cog):
"""
Function called when the bot is ready & done leading.
"""
# Change status
with open("files/status.txt", "r") as statusFile:
status = statusFile.readline()
# Set status
await self.client.change_presence(status=discord.Status.online, activity=discord.Game(STATUS_MESSAGE))
await self.client.change_presence(status=discord.Status.online, activity=discord.Game(str(status)))
# Print a message in the terminal to show that he's ready
with open("files/readyMessage.txt", "r") as readyFile:
readyMessage = readyFile.readline()
print(readyMessage)
print(READY_MESSAGE)
# Add constants to the client as a botvar
self.client.constants = constants.Live if "zandbak" not in readyMessage else constants.Zandbak
self.client.constants = constants.Live if SANDBOX else constants.Zandbak
@commands.Cog.listener()
async def on_message(self, message):

View file

@ -246,7 +246,7 @@ class Tasks(commands.Cog):
Task that checks for new Ufora announcements every few minutes
"""
# Don't run this when testing
if self.client.user.id == int(constants.coolerDidierId):
if self.client.user.id != int(constants.didierId):
return
# Get new notifications