Files
Main-tech/cogs/pingcommands.py
T
2024-01-13 15:59:47 +03:00

23 lines
786 B
Python

import disnake
from disnake.ext import commands
class PingCommands(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.has_any_role(1091637465858715648)
@commands.slash_command(name="ping", description="Показывает состояние бота")
async def ping(self, ctx: disnake.AppCommandInteraction):
if disnake.utils.get(ctx.author.roles, id=):
if ctx.channel.id == :
await ctx.send("Понг!")
else:
await ctx.send('Вы не можете использовать эту команду в текущем канале.')
else:
await ctx.send(f'{ctx.author.mention}, у вас нет роли .')
def setup(bot):
bot.add_cog(PingCommands(bot))