super edit thay mama

This commit is contained in:
Alex D
2023-04-24 17:55:03 +03:00
parent 4731006753
commit cb8fb7d359
13 changed files with 51 additions and 47 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ class AboutCommand(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.slash_command()
@commands.slash_command(name="about")
async def about(self, ctx: disnake.AppCommandInteraction):
embed = disnake.Embed(title='О боте', description='Многофункциональный бот.', color=0x00ff00)
embed.set_author(name='Hyper Tech')
+1 -1
View File
@@ -6,7 +6,7 @@ class AvatarCommand(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.slash_command()
@commands.slash_command(name="avatar")
async def avatar(self, ctx: disnake.AppCommandInteraction, member: disnake.Member = None):
if not member:
member = ctx.author
+3 -3
View File
@@ -6,7 +6,7 @@ class BanCommands(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.slash_command(description="Изгоняет указанного участника с сервера навсегда.")
@commands.slash_command(name="ban", 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,8 +15,8 @@ class BanCommands(commands.Cog):
await ctx.send(f'{ctx.author.mention}, у вас нет роли <@&1060542125621649458>.')
@commands.has_any_role(1060542125621649458)
@commands.slash_command()
async def unban(ctx: disnake.AppCommandInteraction, *, user: disnake.User):
@commands.slash_command(name="unban")
async def unban(self, ctx: disnake.AppCommandInteraction, *, user: disnake.User):
if disnake.utils.get(ctx.author.roles, id=1060542125621649458):
await ctx.guild.unban(user)
if (user.name, user.discriminator) == (user.name, user.discriminator):
+1 -1
View File
@@ -8,7 +8,7 @@ class CoinsCommand(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.slash_command()
@commands.slash_command(name="coins")
async def coins(self, ctx: disnake.AppCommandInteraction):
coin = ["Орел", "Решка"]
result = random.choice(coin)
+1 -1
View File
@@ -6,7 +6,7 @@ class HelpCommand(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.slash_command()
@commands.slash_command(name="commands")
async def commands(self, ctx: disnake.AppCommandInteraction):
embed = disnake.Embed(title="Помощь по командам", description="Вот список всех моих команд и их описания:")
embed.add_field(name="/help", value="Показывает список всех доступных команд.")
+1 -1
View File
@@ -7,7 +7,7 @@ class DogCommands(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.slash_command()
@commands.slash_command(name="dog")
async def dog(self, ctx: disnake.AppCommandInteraction):
response = requests.get('https://dog.ceo/api/breeds/image/random')
img_url = response.json()['message']
+1 -1
View File
@@ -7,7 +7,7 @@ class MagicBallCommand(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.slash_command(description="Даёт верные ответы на все ваши вопросы.")
@commands.slash_command(name="ball", description="Даёт верные ответы на все ваши вопросы.")
async def ball(self, ctx: disnake.AppCommandInteraction, *, question):
answers = [
"Я не знаю.",
+1 -1
View File
@@ -6,7 +6,7 @@ class MathCommands(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.slash_command()
@commands.slash_command(name="math")
async def math(self, ctx: disnake.AppCommandInteraction, *, equation):
try:
result = eval(equation)
+1 -1
View File
@@ -7,7 +7,7 @@ class PingCommands(commands.Cog):
self.bot = bot
@commands.has_any_role(1091637465858715648)
@commands.slash_command()
@commands.slash_command(name="ping")
async def ping(self, ctx: disnake.AppCommandInteraction):
if disnake.utils.get(ctx.author.roles, id=1091637465858715648):
if ctx.channel.id == 1060544039767789639:
+11 -11
View File
@@ -8,39 +8,39 @@ class MuteCommands(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.slash_command(description="Заглушает по всему серверу на указанное время.")
@commands.slash_command(name="mute", 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):
guild = ctx.guild
mutedRole = disnake.utils.get(guild.roles, name="Muted")
muted_role = disnake.utils.get(guild.roles, name="Muted")
if not mutedRole:
mutedRole = await guild.create_role(name="Muted")
if not muted_role:
muted_role = await guild.create_role(name="Muted")
# Проверка роли на каждый чат
for channel in guild.channels:
await channel.set_permissions(mutedRole, speak=False, send_messages=False)
await channel.set_permissions(muted_role, speak=False, send_messages=False)
await member.add_roles(mutedRole, reason=reason)
await member.add_roles(muted_role, reason=reason)
await ctx.send(f"{member.mention} был замучен на {time} секунд. Причина: {reason}.")
await asyncio.sleep(time)
await member.remove_roles(mutedRole)
await member.remove_roles(muted_role)
await ctx.send(f"{member.mention} больше не замучен.")
else:
await ctx.send(f'{ctx.author.mention}, у вас нет роли <@&1060541642450411560>.')
@commands.slash_command(description="Снимает мут с указанного пользователя.")
@commands.slash_command(name="unmute", 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):
mutedRole = disnake.utils.get(ctx.guild.roles, name="Muted")
muted_role = disnake.utils.get(ctx.guild.roles, name="Muted")
if mutedRole not in member.roles:
if muted_role not in member.roles:
await ctx.send(f"{member.mention} не замучен.")
return
await member.remove_roles(mutedRole)
await member.remove_roles(muted_role)
await ctx.send(f"{member.mention} больше не замучен.")
else:
await ctx.send(f'{ctx.author.mention}, у вас нет роли <@&1060541642450411560>.')
+2 -2
View File
@@ -8,7 +8,7 @@ class TicketsCommand(commands.Cog):
ticket_channel = None
@commands.slash_command()
@commands.slash_command(name="ticket")
@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()
@commands.slash_command(name="close_ticket")
@commands.has_permissions(manage_channels=True)
async def close_ticket(self, ctx: disnake.AppCommandInteraction):
global ticket_channel