Create slashcomandexample.py
This commit is contained in:
parent
cda46777a7
commit
41d5349bd9
1 changed files with 22 additions and 0 deletions
22
customcommands/slashcomandexample.py
Normal file
22
customcommands/slashcomandexample.py
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
import discord
|
||||||
|
from discord.ext import commands
|
||||||
|
from discord import app_commands
|
||||||
|
|
||||||
|
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!",
|
||||||
|
color=discord.Color.blue()
|
||||||
|
)
|
||||||
|
exampleembed.set_footer(text=f"Requested by {interaction.user.name}", icon_url=interaction.user.avatar.url)
|
||||||
|
|
||||||
|
await interaction.followup.send(embed=exampleembed)
|
||||||
|
|
||||||
|
async def setup(bot):
|
||||||
|
await bot.add_cog(Ping(bot))
|
Loading…
Add table
Add a link
Reference in a new issue