Update main.py
This commit is contained in:
parent
69c8b91020
commit
14b1594c53
@ -2,10 +2,11 @@
|
|||||||
Discord bot template.
|
Discord bot template.
|
||||||
© by ElBe.
|
© by ElBe.
|
||||||
|
|
||||||
Version: 0.1.9-R
|
Version: 0.1.9.1-R
|
||||||
'''
|
'''
|
||||||
|
|
||||||
#Imports
|
#Imports
|
||||||
|
import os
|
||||||
import discord
|
import discord
|
||||||
from discord import utils
|
from discord import utils
|
||||||
import asyncio
|
import asyncio
|
||||||
@ -17,6 +18,7 @@ import psutil
|
|||||||
|
|
||||||
#Bot modules
|
#Bot modules
|
||||||
import bot_functions
|
import bot_functions
|
||||||
|
import command
|
||||||
|
|
||||||
#Start
|
#Start
|
||||||
print('Discord.py Bot')
|
print('Discord.py Bot')
|
||||||
@ -42,7 +44,7 @@ MISSING = utils.MISSING
|
|||||||
starttime = time.time()
|
starttime = time.time()
|
||||||
|
|
||||||
#JSON data
|
#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']
|
version = bot_functions.json_module.get_config('Config')['Version']
|
||||||
credits = bot_functions.json_module.get_config('Config')['Credits']
|
credits = bot_functions.json_module.get_config('Config')['Credits']
|
||||||
footer = bot_functions.json_module.get_config('Config')['Footer']
|
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)
|
logging.basicConfig(filename='log.txt', level=logging.INFO)
|
||||||
intents = discord.Intents.all()
|
intents = discord.Intents.all()
|
||||||
|
|
||||||
|
#Create commands
|
||||||
|
if bot_functions.json_module.get_config('Created', 'commands.json') == 0:
|
||||||
|
command.run()
|
||||||
|
|
||||||
#Main
|
#Main
|
||||||
class Bot(discord.Client):
|
class Bot(discord.Client):
|
||||||
'''Bot.'''
|
'''Bot.'''
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user