Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Commit 3364b7d

Browse files
committed
Docs: Add comments
1 parent 2cc637d commit 3364b7d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • projects/Chat-GPT-Discord-Bot

projects/Chat-GPT-Discord-Bot/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ def __init__(self, *, intents: discord.Intents):
5757
# This allows for faster bot testing and development.
5858
async def setup_hook(self):
5959
# This copies the global commands over to your guild(s).
60-
self.tree.clear_commands(guild=discord_server_1)
60+
self.tree.clear_commands(guild=discord_server_1) # Prevents command duplication.
6161
await self.tree.sync(guild=discord_server_1)
6262
self.tree.clear_commands(guild=discord_server_2)
63-
await self.tree.sync(guild=discord_server_2)
63+
await self.tree.sync(guild=discord_server_2) # Prevents command duplication.
6464
# You can replace these 4 lines with "await self.tree.sync()" if you want the bots commands to...
6565
# be added to all servers its in (won't take long if your bot isn't in many servers otherwise it could take up to an hour)
6666

@@ -561,7 +561,7 @@ async def send(interaction: discord.Interaction, prompt: str, img_dimensions: st
561561
img_dimensions = img_dimensions.lower()
562562

563563
# Send as followup message
564-
await interaction.followup.send(f"{dalle2(prompt, img_dimensions)} IMAGE LINK EXPIRES IN <t:{int(time.mktime(future_time.timetuple()))}:R>")
564+
await interaction.followup.send(f"{dalle2(prompt, img_dimensions)} IMAGE LINK EXPIRES IN <t:{int(time.mktime(future_time.timetuple()))}:R>") # Convert future_time to unix timestamp.
565565
except Exception as e:
566566
# Handle exceptions
567567
print(f"An error occurred: {str(e)}")

0 commit comments

Comments
 (0)