Update main.py

This commit is contained in:
ElBe 2022-10-15 10:39:20 +02:00 committed by GitHub
parent 69c8b91020
commit 14b1594c53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,10 +2,11 @@
Discord bot template.
© by ElBe.
Version: 0.1.9-R
Version: 0.1.9.1-R
'''
#Imports
import os
import discord
from discord import utils
import asyncio
@ -17,6 +18,7 @@ import psutil
#Bot modules
import bot_functions
import command
#Start
print('Discord.py Bot')
@ -42,7 +44,7 @@ MISSING = utils.MISSING
starttime = time.time()
#JSON data
token = bot_functions.json_module.get_config('Config')['Token']
token = str(os.environ['token'])
version = bot_functions.json_module.get_config('Config')['Version']
credits = bot_functions.json_module.get_config('Config')['Credits']
footer = bot_functions.json_module.get_config('Config')['Footer']
@ -54,6 +56,10 @@ commands = bot_functions.json_module.get_config('Commands')
logging.basicConfig(filename='log.txt', level=logging.INFO)
intents = discord.Intents.all()
#Create commands
if bot_functions.json_module.get_config('Created', 'commands.json') == 0:
command.run()
#Main
class Bot(discord.Client):
'''Bot.'''