Cogs system initialised
This commit is contained in:
parent
696d3921cb
commit
74ff357853
|
@ -0,0 +1,11 @@
|
|||
from discord.ext import commands
|
||||
|
||||
|
||||
class EDT:
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
print("EDT loaded")
|
||||
|
||||
|
||||
def setup(bot):
|
||||
bot.add_cog(EDT(bot))
|
13
main.py
13
main.py
|
@ -16,10 +16,17 @@ MY_GUILD = discord.Object(id=getenv("GUILD_ID")) # replace with your guild id
|
|||
|
||||
class MyClient(discord.Client):
|
||||
def __init__(self):
|
||||
super().__init__(intents=None)
|
||||
super().__init__(intents=discord.Intents.none())
|
||||
self.tree = app_commands.CommandTree(self)
|
||||
|
||||
self.initial_extensions = ["cogs." + f[:-3] for f in os.listdir("./cogs") if f.endswith(".py") and f.name != "__init__.py"]
|
||||
|
||||
async def setup_hook(self):
|
||||
|
||||
# cogs
|
||||
for extension in self.initial_extensions:
|
||||
await self.load_extension(extension)
|
||||
|
||||
self.tree.copy_global_to(guild=MY_GUILD)
|
||||
await self.tree.sync(guild=MY_GUILD)
|
||||
|
||||
|
@ -29,7 +36,6 @@ client = MyClient()
|
|||
eleves = get_eleves()
|
||||
|
||||
|
||||
|
||||
@client.event
|
||||
async def on_ready():
|
||||
print(f'Logged in as {client.user} (ID: {client.user.id})')
|
||||
|
@ -46,7 +52,8 @@ async def on_ready():
|
|||
]
|
||||
)
|
||||
@app_commands.describe(groupe="Votre groupe de colle, groupe ∈ ⟦1, 15⟧")
|
||||
@app_commands.describe(langues="Les options de langue que vous suivez. (Les langues suivies à H4 ne sont pas gérées, mettez 'Autres')")
|
||||
@app_commands.describe(
|
||||
langues="Les options de langue que vous suivez. (Les langues suivies à H4 ne sont pas gérées, mettez 'Autres')")
|
||||
@app_commands.describe(split="Créer deux fichiers différentes, un pour les colles et un pour le rest de l'EDT.")
|
||||
async def edt(
|
||||
interaction: discord.Interaction,
|
||||
|
|
Loading…
Reference in New Issue