diff --git a/cogs/aboutcommand.py b/cogs/aboutcommand.py index f7210d3..996abd8 100644 --- a/cogs/aboutcommand.py +++ b/cogs/aboutcommand.py @@ -6,12 +6,12 @@ class AboutCommand(commands.Cog): def __init__(self, bot): self.bot = bot - @commands.slash_command(name="about") + @commands.slash_command(name="бот", description="Показывает информацию о боте и их разработчиках") async def about(self, ctx: disnake.AppCommandInteraction): embed = disnake.Embed(title='О боте', description='Многофункциональный бот.', color=0x00ff00) embed.set_author(name='Hyper Tech') embed.add_field(name='Автор', value='<@795901895666434070> а так же <@662994219794956298>\n') - embed.add_field(name='Версия', value='v1.01.') + embed.add_field(name='Версия', value='v1.02.') embed.add_field(name='Дата выпуска', value='23.04.2023') await ctx.send(embed=embed) diff --git a/cogs/avatarcommand.py b/cogs/avatarcommand.py index d996fd6..e9c9131 100644 --- a/cogs/avatarcommand.py +++ b/cogs/avatarcommand.py @@ -6,7 +6,7 @@ class AvatarCommand(commands.Cog): def __init__(self, bot): self.bot = bot - @commands.slash_command(name="avatar") + @commands.slash_command(name="аватар", description="Показывает аватар указанного пользователя") async def avatar(self, ctx: disnake.AppCommandInteraction, member: disnake.Member = None): if not member: member = ctx.author diff --git a/cogs/bancommands.py b/cogs/bancommands.py index 6529edf..2137123 100644 --- a/cogs/bancommands.py +++ b/cogs/bancommands.py @@ -6,7 +6,7 @@ class BanCommands(commands.Cog): def __init__(self, bot): self.bot = bot - @commands.slash_command(name="ban", description="Изгоняет указанного участника с сервера навсегда.") + @commands.slash_command(name="бан", description="Изгоняет указанного участника с сервера навсегда.") async def ban(self, ctx: disnake.AppCommandInteraction, member: disnake.Member, *, reason=None): if disnake.utils.get(ctx.author.roles, id=1060542125621649458): await member.ban(reason=reason) @@ -15,7 +15,7 @@ class BanCommands(commands.Cog): await ctx.send(f'{ctx.author.mention}, у вас нет роли <@&1060542125621649458>.') @commands.has_any_role(1060542125621649458) - @commands.slash_command(name="unban") + @commands.slash_command(name="унбан", description="Снимает блокировку") async def unban(self, ctx: disnake.AppCommandInteraction, *, user: disnake.User): if disnake.utils.get(ctx.author.roles, id=1060542125621649458): await ctx.guild.unban(user) diff --git a/cogs/coinscommand.py b/cogs/coinscommand.py index fe9eb25..56fef12 100644 --- a/cogs/coinscommand.py +++ b/cogs/coinscommand.py @@ -8,8 +8,11 @@ class CoinsCommand(commands.Cog): def __init__(self, bot): self.bot = bot - @commands.slash_command(name="coins") + @commands.slash_command(name="coins", description="Игра в Орел и Решку") async def coins(self, ctx: disnake.AppCommandInteraction): + if ctx.guild.id != 1099696069257990214: + await ctx.send('Эта команда доступна только на определенном сервере') + return coin = ["Орел", "Решка"] result = random.choice(coin) await ctx.send("Орел или решка? Угадайте! Результат будет через 3 секунды...") diff --git a/cogs/commands.py b/cogs/commands.py index ee89610..373cc1e 100644 --- a/cogs/commands.py +++ b/cogs/commands.py @@ -6,7 +6,7 @@ class HelpCommand(commands.Cog): def __init__(self, bot): self.bot = bot - @commands.slash_command(name="commands") + @commands.slash_command(name="помощь", description="Показывает все команды бота") async def commands(self, ctx: disnake.AppCommandInteraction): embed = disnake.Embed(title="Помощь по командам", description="Вот список всех моих команд и их описания:") embed.add_field(name="/help", value="Показывает список всех доступных команд.") @@ -15,7 +15,10 @@ class HelpCommand(commands.Cog): embed.add_field(name="/ball", value="Даёт верные ответы на все ваши вопросы.") embed.add_field(name="/math", value="Можно решить любые математические примеры.") embed.add_field(name="/ticket", value="Создает тикет") - embed.add_field(name="/dog", value="Показывает фото случайной собаки.") + embed.add_field(name="/ban", value="Выдает бан пользователю (Использовать может только модератор)") + embed.add_field(name="/about", value="Показывает информацию о боте") + embed.add_field(name="/avatar", value="Показывает аватар выбранного пользователя.") + await ctx.send(embed=embed) diff --git a/cogs/dogcommands.py b/cogs/dogcommands.py index 9ae4982..2c55abd 100644 --- a/cogs/dogcommands.py +++ b/cogs/dogcommands.py @@ -7,11 +7,11 @@ class DogCommands(commands.Cog): def __init__(self, bot): self.bot = bot - @commands.slash_command(name="dog") + @commands.slash_command(name="собака", description="Показывает фото случайной собаки") async def dog(self, ctx: disnake.AppCommandInteraction): response = requests.get('https://dog.ceo/api/breeds/image/random') img_url = response.json()['message'] - embed = disnake.Embed(title='Случайная собака', color=0x00ff00) + embed = disnake.Embed(title='Случайная собака', color=0x00f8fe) embed.set_image(url=img_url) await ctx.send(embed=embed) diff --git a/cogs/magicballcommand.py b/cogs/magicballcommand.py index a746d50..506f7cf 100644 --- a/cogs/magicballcommand.py +++ b/cogs/magicballcommand.py @@ -7,14 +7,15 @@ class MagicBallCommand(commands.Cog): def __init__(self, bot): self.bot = bot - @commands.slash_command(name="ball", description="Даёт верные ответы на все ваши вопросы.") + @commands.slash_command(name="шар", description="Даёт верные ответы на все ваши вопросы.") async def ball(self, ctx: disnake.AppCommandInteraction, *, question): answers = [ "Я не знаю.", "Да.", "Нет.", "Возможно.", - "Спроси позже." + "Спроси позже.", + "Иди нахуй." ] await ctx.send(f"Ваш вопрос: {question}\nМой ответ: {random.choice(answers)}") diff --git a/cogs/mathcommands.py b/cogs/mathcommands.py index 973413f..727b301 100644 --- a/cogs/mathcommands.py +++ b/cogs/mathcommands.py @@ -6,11 +6,11 @@ class MathCommands(commands.Cog): def __init__(self, bot): self.bot = bot - @commands.slash_command(name="math") + @commands.slash_command(name="калькулятор", description="Помогает решить любой пример") async def math(self, ctx: disnake.AppCommandInteraction, *, equation): try: result = eval(equation) - await ctx.send(f'Задача: {equation} = {result}') + await ctx.send(f'Задача: {equation} = {result}') except: await ctx.send('Ошибка при выполнении вычислений.') diff --git a/cogs/pingcommands.py b/cogs/pingcommands.py index eba5895..04d913a 100644 --- a/cogs/pingcommands.py +++ b/cogs/pingcommands.py @@ -7,7 +7,7 @@ class PingCommands(commands.Cog): self.bot = bot @commands.has_any_role(1091637465858715648) - @commands.slash_command(name="ping") + @commands.slash_command(name="ping", description="Показывает состояние бота") async def ping(self, ctx: disnake.AppCommandInteraction): if disnake.utils.get(ctx.author.roles, id=1091637465858715648): if ctx.channel.id == 1060544039767789639: diff --git a/cogs/testcommands.py b/cogs/testcommands.py index 4dcc3bf..29dae7f 100644 --- a/cogs/testcommands.py +++ b/cogs/testcommands.py @@ -8,7 +8,7 @@ class MuteCommands(commands.Cog): def __init__(self, bot): self.bot = bot - @commands.slash_command(name="mute", description="Заглушает по всему серверу на указанное время.") + @commands.slash_command(name="мут", description="Заглушает пользователя по всему серверу на указанное время.") @commands.has_permissions(manage_roles=True) async def mute(self, ctx: disnake.AppCommandInteraction, member: disnake.Member, time: int, *, reason=None): if disnake.utils.get(ctx.author.roles, id=1060541642450411560): @@ -30,7 +30,7 @@ class MuteCommands(commands.Cog): else: await ctx.send(f'{ctx.author.mention}, у вас нет роли <@&1060541642450411560>.') - @commands.slash_command(name="unmute", description="Снимает мут с указанного пользователя.") + @commands.slash_command(name="унмут", description="Снимает мут с указанного пользователя.") @commands.has_permissions(manage_roles=True) async def unmute(self, ctx: disnake.AppCommandInteraction, member: disnake.Member): if disnake.utils.get(ctx.author.roles, id=1060541642450411560): diff --git a/cogs/ticketscommand.py b/cogs/ticketscommand.py index 3cbf8e0..4a3bf35 100644 --- a/cogs/ticketscommand.py +++ b/cogs/ticketscommand.py @@ -8,7 +8,7 @@ class TicketsCommand(commands.Cog): ticket_channel = None - @commands.slash_command(name="ticket") + @commands.slash_command(name="ticket", description="Создает тикет") @commands.has_permissions(manage_channels=True) async def ticket(self, ctx: disnake.AppCommandInteraction): global ticket_channel @@ -24,7 +24,7 @@ class TicketsCommand(commands.Cog): except: await ctx.send('Ошибка при создании канала. Пожалуйста, попробуйте позже.') - @commands.slash_command(name="close_ticket") + @commands.slash_command(name="close_ticket", description="Закрывает тикет") @commands.has_permissions(manage_channels=True) async def close_ticket(self, ctx: disnake.AppCommandInteraction): global ticket_channel diff --git a/main.py b/main.py index c3335d1..7673571 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,6 @@ import json import os - +import settings import disnake from disnake.ext import commands @@ -28,13 +28,13 @@ async def on_ready(): print("Bot is ready") -@bot.command(name="super_secret_command") +@bot.command(name="секрет") async def secret(ctx): await ctx.message.delete() await ctx.send(f'Привет, {ctx.author.mention}. Это тайное сообщение!') -@bot.command(name="news") +@bot.slash_command(name="news", description="Показывает последние новости (но это не точно...)") async def news(ctx): # Ваш код для получения новостей page_news = [ @@ -58,7 +58,7 @@ async def news(ctx): await ctx.send(embed=embed) -@bot.command(name="setmoderator") +@bot.slash_command(name="setmoderator", description="Выдает роль модератора") @commands.has_guild_permissions(administrator=True) async def set_moderator(ctx: disnake.AppCommandInteraction, member: disnake.Member): member = member or ctx.message.author @@ -69,7 +69,7 @@ async def set_moderator(ctx: disnake.AppCommandInteraction, member: disnake.Memb await ctx.send(f"Пользователю {member.mention} была выдана роль {role.mention}") -@bot.command(name="deletemoderator") +@bot.command(name="deletemoderator", description="Снимает роль модератора") @commands.has_guild_permissions(administrator=True) async def delete_moderator(ctx: disnake.AppCommandInteraction, member: disnake.Member): member = member or ctx.message.author