added requirements.txt
This commit is contained in:
17
test.py
17
test.py
@@ -1,3 +1,4 @@
|
||||
import asyncio
|
||||
import logging
|
||||
import sys
|
||||
from os import path
|
||||
@@ -6,7 +7,7 @@ import disnake
|
||||
from disnake import OptionChoice, OptionType, Option
|
||||
from disnake.ext import commands
|
||||
|
||||
from lib.CogsPrepare import cog_list, work_with_cogs
|
||||
from lib.CogsPrepare import work_with_cogs
|
||||
from lib.Comands import determine_prefix
|
||||
|
||||
if not path.isfile('prefix.json'):
|
||||
@@ -29,19 +30,7 @@ bot = commands.Bot(command_prefix=determine_prefix,
|
||||
logging.basicConfig(stream=sys.stdout, filemode='w', level='INFO',
|
||||
format='%(asctime)s - %(levelname)s - %(module)s - %(message)s')
|
||||
|
||||
for filename in cog_list():
|
||||
try:
|
||||
bot.load_extension(f'cogs.{filename}')
|
||||
logging.info(f'Loaded cog {filename}')
|
||||
|
||||
except commands.ExtensionNotFound:
|
||||
logging.error(f"Error: {filename} couldn't be found to load.")
|
||||
|
||||
except commands.ExtensionFailed as error:
|
||||
logging.error(f'Error: {filename} failed to load properly.', error)
|
||||
|
||||
except commands.ExtensionError:
|
||||
logging.error(f'Error: unknown error with {filename}')
|
||||
asyncio.run(work_with_cogs('load', bot))
|
||||
|
||||
|
||||
@bot.event
|
||||
|
||||
Reference in New Issue
Block a user