mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-06-30 16:40:05 +08:00
Merge pull request #8 from LAION-AI/bot-to-laion-update
Bot to laion update
This commit is contained in:
+11
-3
@@ -27,6 +27,9 @@ headers = {"X-API-Key": API_SERVER_KEY}
|
||||
|
||||
# For testing only.
|
||||
TEST_GUILD = os.getenv("TEST_GUILD")
|
||||
TEST_GUILD_LAION = os.getenv("TEST_GUILD_LAION")
|
||||
# TEST_GUILD = False
|
||||
guild_ids = [TEST_GUILD, TEST_GUILD_LAION]
|
||||
|
||||
|
||||
# Initiate the client and command tree to create slash commands.
|
||||
@@ -39,9 +42,14 @@ class OpenChatGPTClient(discord.Client):
|
||||
if TEST_GUILD:
|
||||
# When testing the bot it's handy to run in a single server (called a
|
||||
# Guide in the API). This is relatively fast.
|
||||
guild = discord.Object(id=TEST_GUILD)
|
||||
self.tree.copy_global_to(guild=guild)
|
||||
await self.tree.sync(guild=guild)
|
||||
for guild_id in guild_ids:
|
||||
guild = discord.Object(id=guild_id)
|
||||
self.tree.copy_global_to(guild=guild)
|
||||
await self.tree.sync(guild=guild)
|
||||
|
||||
# guild = discord.Object(id=TEST_GUILD)
|
||||
# self.tree.copy_global_to(guild=guild)
|
||||
# await self.tree.sync(guild=guild)
|
||||
else:
|
||||
# This can take up to an hour for the commands to be registered.
|
||||
await self.tree.sync()
|
||||
|
||||
Reference in New Issue
Block a user