made new bot with slash command from youtube tut
This commit is contained in:
+20
@@ -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")
|
||||||
Reference in New Issue
Block a user