mirror of
https://github.com/RafaelSolVargas/Vulkan.git
synced 2025-10-29 16:57:23 +00:00
Renaming modules, removing useless and changing logic of bot initialization
This commit is contained in:
22
main.py
22
main.py
@@ -1,10 +1,9 @@
|
||||
import os
|
||||
import discord
|
||||
import os
|
||||
|
||||
from config import config
|
||||
from discord.ext import commands
|
||||
|
||||
|
||||
intents = discord.Intents.default()
|
||||
intents.members = True
|
||||
|
||||
@@ -12,19 +11,12 @@ bot = commands.Bot(command_prefix=config.BOT_PREFIX, pm_help=True,
|
||||
case_insensitive=True, intents=intents)
|
||||
bot.remove_command('help')
|
||||
|
||||
if config.BOT_TOKEN == "":
|
||||
exit()
|
||||
|
||||
if __name__ == '__main__':
|
||||
config.ABSOLUTE_PATH = os.path.dirname(os.path.abspath(__file__))
|
||||
config.COOKIE_PATH = config.ABSOLUTE_PATH + config.COOKIE_PATH
|
||||
for filename in os.listdir('./vulkan/commands'):
|
||||
if filename.endswith('.py'):
|
||||
bot.load_extension(f'vulkan.commands.{filename[:-3]}')
|
||||
|
||||
if config.BOT_TOKEN == "":
|
||||
print("Error: No bot token!")
|
||||
exit()
|
||||
|
||||
for extension in config.INITIAL_EXTENSIONS:
|
||||
try:
|
||||
bot.load_extension(extension)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
bot.run(config.BOT_TOKEN, bot=True, reconnect=True)
|
||||
bot.run(config.BOT_TOKEN, bot=True, reconnect=True)
|
||||
|
||||
Reference in New Issue
Block a user