dev #4

Merged
Arthur merged 12 commits from dev into main 2024-06-02 15:04:56 +02:00
1 changed files with 4 additions and 3 deletions
Showing only changes of commit 7675b24af2 - Show all commits

View File

@ -19,7 +19,7 @@ class MyClient(commands.Bot):
intents.message_content = True
super().__init__(intents=intents, command_prefix=".")
self.MY_GUILD = discord.Object(id=getenv("GUILD_ID"))
self.MY_GUILDS = [discord.Object(id=int(guild_id)) for guild_id in getenv("GUILD_ID").split(',')]
self.initial_extensions = ["cogs." + f[:-3] for f in listdir("./cogs") if
f.endswith(".py") and f.__str__() != "__init__.py"]
@ -30,8 +30,9 @@ class MyClient(commands.Bot):
for extension in self.initial_extensions:
await self.load_extension(extension)
self.tree.copy_global_to(guild=self.MY_GUILD)
await self.tree.sync(guild=self.MY_GUILD)
for guild in self.MY_GUILDS:
self.tree.copy_global_to(guild=guild)
await self.tree.sync(guild=guild)
async def on_ready(self):
print(f'Logged in as {self.user} (ID: {self.user.id})')