Added a Char Limit to the report function. Updated the tasks to now inlcude choices

This commit is contained in:
Dan
2024-05-05 20:44:03 -04:00
parent bb5c034309
commit b904b1087d
2 changed files with 34 additions and 4 deletions

View File

@ -33,10 +33,15 @@ class Nessa(discord.Client):
@self.tree.command(name="report_issue", description="Send an anonymous issue report.")
async def report_issue(interaction: discord.Interaction, message: str):
# Check if the message exceeds 1000 characters
if len(message) > 1000:
await interaction.response.send_message("Wowie, that's a long message there. Chief asked for messages to be no longer than 1000 characters. Please shorten it and try again.", ephemeral=True)
return
# Your Discord user ID
your_user_id = OWNER_ID
your_user_id = OWNER_ID # Make sure OWNER_ID is defined somewhere in your code
# Fetch your user object using your ID
owner = await bot.fetch_user(your_user_id)
owner = await self.fetch_user(your_user_id)
# Send the DM to you
await owner.send(f"Hey Chief, I got a report for you: {message}")
# Respond to the user to confirm the message has been sent