From e08d306f49ca50d73b576cf37471fa854c0b9a4c Mon Sep 17 00:00:00 2001 From: TropiiDev Date: Sun, 16 Mar 2025 19:36:11 -0400 Subject: [PATCH] Implement a whisper command --- commands/whisper.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 commands/whisper.py diff --git a/commands/whisper.py b/commands/whisper.py new file mode 100644 index 0000000..1aeae9b --- /dev/null +++ b/commands/whisper.py @@ -0,0 +1,18 @@ +import discord +from discord import app_commands +from discord.ext import commands + +class Whisper(commands.Cog): + def __init__(self, bot): + self.bot = bot + + @commands.Cog.listener() + async def on_ready(self): + print("Whisper Online") + + @app_commands.command(name="whisper", description="secretly send someone a message") + async def whisper(self, interaction: discord.Interaction, user: discord.User, message: str): + await interaction.response.send_message(f"{user.mention}, {interaction.user.mention} whispered {message}", ephemeral=True) + +async def setup(bot): + await bot.add_cog(Whisper(bot)) \ No newline at end of file