boucle for pour le chargement des cogs
This commit is contained in:
parent
3e1336b8b8
commit
37a17b8095
1 changed files with 4 additions and 10 deletions
14
src/main.py
14
src/main.py
|
@ -1,7 +1,7 @@
|
||||||
print("Chargement des extensions & librairie...", end = " ")
|
print("Chargement des extensions & librairie...", end = " ")
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from os import environ
|
from os import environ, listdir
|
||||||
from discord_slash import SlashCommand
|
from discord_slash import SlashCommand
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from utils.reminder import Reminder
|
from utils.reminder import Reminder
|
||||||
|
@ -10,15 +10,9 @@ customPrefix = environ['PREFIX']
|
||||||
client = commands.Bot(command_prefix = customPrefix, case_insensitive = True, intents = discord.Intents.all())
|
client = commands.Bot(command_prefix = customPrefix, case_insensitive = True, intents = discord.Intents.all())
|
||||||
slash = SlashCommand(client, sync_commands = True)
|
slash = SlashCommand(client, sync_commands = True)
|
||||||
|
|
||||||
client.load_extension("cogs.help")
|
for file in listdir("src/cogs"):
|
||||||
client.load_extension("cogs.utils")
|
if file.endswith(".py") and file.startswith("-") == False:
|
||||||
client.load_extension("cogs.internet")
|
client.load_extension(f"cogs.{file[:-3]}")
|
||||||
client.load_extension("cogs.music")
|
|
||||||
client.load_extension("cogs.games")
|
|
||||||
client.load_extension("cogs.fun")
|
|
||||||
client.load_extension("cogs.school")
|
|
||||||
client.load_extension("cogs.citation")
|
|
||||||
client.load_extension("cogs.confreriedukassoulait") # you can remove this cogs, only for my private guild
|
|
||||||
print("Terminé !")
|
print("Terminé !")
|
||||||
|
|
||||||
@client.event
|
@client.event
|
||||||
|
|
Reference in a new issue