Skip to content

Commit

Permalink
- Send timestamp in two messages: rendered and non-rendered time
Browse files Browse the repository at this point in the history
  • Loading branch information
soksanichenko committed Sep 24, 2024
1 parent 8ac307f commit 25232d6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions sources/scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,27 @@ async def set_timezone(
)


@bot.tree.context_menu(name='Remove fixed message')
async def remove_fixed_message(
interaction: discord.Interaction,
message: discord.Message,
):
"""Remove fixed message using a bot's command"""
if message.author != bot.user and message.content.endswith(
f"\nOriginal message posted by {interaction.user.mention}",
):
await message.delete()
await interaction.response.send_message(
'The message is deleted',
ephemeral=True,
)
else:
await interaction.response.send_message(
'That message is not yours',
ephemeral=True,
)


@discord.app_commands.describe(
time='Please input a time in any suitable format in your region'
)
Expand Down

0 comments on commit 25232d6

Please sign in to comment.