mirror of
https://github.com/RafaelSolVargas/Vulkan.git
synced 2025-10-29 16:57:23 +00:00
Finishing ErrorHandler integration
This commit is contained in:
parent
3639ba3280
commit
29998997bc
7
main.py
7
main.py
@ -3,6 +3,7 @@ import discord
|
||||
|
||||
from config import config
|
||||
from discord.ext import commands
|
||||
from vulkan.ErrorHandler import ErrorHandler
|
||||
|
||||
|
||||
intents = discord.Intents.default()
|
||||
@ -12,6 +13,7 @@ bot = commands.Bot(command_prefix=config.BOT_PREFIX, pm_help=True,
|
||||
case_insensitive=True, intents=intents)
|
||||
bot.remove_command('help')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
config.ABSOLUTE_PATH = os.path.dirname(os.path.abspath(__file__))
|
||||
config.COOKIE_PATH = config.ABSOLUTE_PATH + config.COOKIE_PATH
|
||||
@ -20,11 +22,12 @@ if __name__ == '__main__':
|
||||
print("Error: No bot token!")
|
||||
exit()
|
||||
|
||||
bot.log_error = ErrorHandler('errors') # Creating the error handler
|
||||
|
||||
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)
|
||||
|
||||
@ -22,7 +22,6 @@ class ErrorHandler():
|
||||
|
||||
full_path = self.__open_file()
|
||||
if isinstance(full_path, bool):
|
||||
print('Parei')
|
||||
return False
|
||||
|
||||
error_str = self.__prepare_error(error)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user