From ac8d64071d1fa37db357f6ada8fc88887dd315b9 Mon Sep 17 00:00:00 2001 From: Honza Date: Wed, 10 Apr 2024 15:17:17 +0200 Subject: [PATCH] made new bot with slash command from youtube tut --- gesmain.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 gesmain.py diff --git a/gesmain.py b/gesmain.py new file mode 100644 index 0000000..ea6e899 --- /dev/null +++ b/gesmain.py @@ -0,0 +1,20 @@ +import discord +from discord import app_commands +from discord.ext import commands + +bot = commands.Bot(command_prefix="&", intents = discord.Intents.all()) + +@bot.event +async def on_ready(): + print(f"Bot is up and ready, logged in as: {bot.user}") + try: + synced = await bot.tree.sync() + print(f"synced {len(synced)} command(s)") + except Exception as e: + print(e) + +@bot.tree.command(name="helou") +async def helou(interaction: discord.Interaction): + await interaction.response.send_message(f"HAAAJ {interaction.user.mention}! This is a slash command!!!", ephemeral=True) + +bot.run("MTIyNzMwMTk2MTc1ODQwODg5Ng.GTcFey.nlNOCHGYQ1F7imc3MbsMj34_BaWfLR7uGH3OcY") \ No newline at end of file