goober/assets/cogs/slashcomandexample.py

28 lines
818 B
Python
Raw Normal View History

2025-01-06 12:22:36 +01:00
import discord
from discord.ext import commands
from discord import app_commands
2025-07-23 10:19:08 +03:00
2025-01-06 12:22:36 +01:00
class Ping(commands.Cog):
def __init__(self, bot):
self.bot = bot
@app_commands.command(name="slashcommand", description="slashcommandexample")
async def ping(self, interaction: discord.Interaction):
await interaction.response.defer()
exampleembed = discord.Embed(
title="Pong!!",
description="The Beretta fires fast and won't make you feel any better!",
2025-07-23 10:19:08 +03:00
color=discord.Color.blue(),
)
exampleembed.set_footer(
text=f"Requested by {interaction.user.name}",
icon_url=interaction.user.avatar.url,
2025-01-06 12:22:36 +01:00
)
await interaction.followup.send(embed=exampleembed)
2025-07-23 10:19:08 +03:00
2025-01-06 12:22:36 +01:00
async def setup(bot):
await bot.add_cog(Ping(bot))