Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil12-dev authored Apr 4, 2024
1 parent ec016d7 commit c472488
Show file tree
Hide file tree
Showing 13 changed files with 121 additions and 112 deletions.
2 changes: 1 addition & 1 deletion cogs/AntiSpam.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async def on_message(self, message):
warn_embed = disnake.Embed(
title="⚠️ Предупреждение за спам",
description=f"{message.author.mention}, ваши сообщения удаляются из-за подозрения в спаме.",
color=0xCD853F
color=0x2f3136
)
await message.author.send(embed=warn_embed)
except disnake.NotFound:
Expand Down
8 changes: 4 additions & 4 deletions cogs/AutoRole.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def on_member_join(self, member: disnake.Member):
role = guild.get_role(role_id)
try:
await member.add_roles(role)
emb = disnake.Embed(title=f"Привет {member.display_name}!", color=0xCD853F)
emb = disnake.Embed(title=f"Привет {member.display_name}!", color=0x2f3136)
emb.description = f"Я назначила тебе роль **{role.name}** на сервере {guild.name}."
await member.send(embed=emb)
except disnake.errors.Forbidden:
Expand All @@ -43,13 +43,13 @@ async def set_default_role(self, ctx, role: disnake.Role = None):

embed = disnake.Embed(
title=f"Роль {role.name} установлена как роль по умолчанию.",
color=0xCD853F
color=0x2f3136
)
else:
embed = disnake.Embed(
title="Ошибка при установке роли по умолчанию!",
description="Укажите корректную роль",
color=0xCD853F
color=0x2f3136
)
await ctx.send(embed=embed, ephemeral=True)

Expand All @@ -59,7 +59,7 @@ async def set_default_role_error(self, ctx, error):
embed = disnake.Embed(
title="Ошибка при установке роли по умолчанию!",
description="У вас нет разрешения управлять ролями!",
color=0xCD853F
color=0x2f3136
)
await ctx.send(embed=embed, ephemeral=True)

Expand Down
40 changes: 20 additions & 20 deletions cogs/admins.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async def kick_user(self, ctx: disnake.ApplicationCommandInteraction, user: disn
await user.send(f"Вы были кикнуты с сервера {ctx.guild.name}. Причина: {reason}")
except disnake.errors.HTTPException:
pass
embed = disnake.Embed(color=0xCD853F)
embed = disnake.Embed(color=0x2f3136)
embed.add_field(name="Kick", value=f"{ctx.author.mention} кикнула {user.mention} из {ctx.guild} сервера 😔")
embed.add_field(name="Причина", value=reason if reason else "Не указана")

Expand All @@ -58,7 +58,7 @@ async def clear(self, ctx, amount: int):
return

deleted = await ctx.channel.purge(limit=amount)
embed = disnake.Embed(color=0xCD853F)
embed = disnake.Embed(color=0x2f3136)
embed.add_field(name="Очистила чат", value=f"Удалила {len(deleted)} сообщений 😊", inline=False)
await ctx.send(embed=embed, ephemeral=True)

Expand All @@ -73,12 +73,12 @@ async def ban_user(self, ctx, user: disnake.Member, reason: str = None):
banned_user = c.fetchone()

if banned_user:
embed = disnake.Embed(title="Бан", description=f"{user.mention} Этот пользователь уже забанен.", color=0xCD853F)
embed = disnake.Embed(title="Бан", description=f"{user.mention} Этот пользователь уже забанен.", color=0x2f3136)
else:
await user.ban(reason=reason)
c.execute("INSERT INTO bans (user_id, username, reason) VALUES (?, ?, ?)", (user.id, user.name, reason))
conn.commit()
embed = disnake.Embed(title="Бан", description=f"{user.mention} Я забанила эту хамку.😤", color=0xCD853F)
embed = disnake.Embed(title="Бан", description=f"{user.mention} Я забанила эту хамку.😤", color=0x2f3136)
try:
await user.send(embed=embed)
except disnake.errors.HTTPException:
Expand All @@ -101,7 +101,7 @@ async def unban_user(self, ctx, user: disnake.User, reason: str = None):
c = conn.cursor()
c.execute("DELETE FROM bans WHERE user_id=?", (banned_user.id,))
conn.commit()
embed = disnake.Embed(title="Разбан", description=f"{banned_user.mention} был успешно разбанен.", color=0xCD853F)
embed = disnake.Embed(title="Разбан", description=f"{banned_user.mention} был успешно разбанен.", color=0x2f3136)
try:
await banned_user.send(embed=embed)
except disnake.errors.HTTPException:
Expand All @@ -116,7 +116,7 @@ async def unban_user(self, ctx, user: disnake.User, reason: str = None):
@commands.has_permissions(administrator=True)
async def echo(self, ctx: disnake.ApplicationCommandInteraction, channel: disnake.TextChannel, role: disnake.Role, *, message: str):
message = message.replace("-", "\n")
embed = disnake.Embed(color=0xCD853F)
embed = disnake.Embed(color=0x2f3136)
embed.add_field(name="", value=message, inline=False)

role_mention = role.mention
Expand All @@ -143,14 +143,14 @@ async def join(ctx: disnake.ApplicationCommandInteraction):
channel = ctx.author.voice.channel
await channel.connect()
embed = disnake.Embed(
color=0xCD853F,
color=0x2f3136,
title="Готово",
description=f"Успешно подключилась к голосовому каналу {channel.name}"
)
await ctx.send(embed=embed, ephemeral=True)

voice_channel = ctx.author.voice.channel
embed = disnake.Embed(color=0xCD853F)
embed = disnake.Embed(color=0x2f3136)
embed.add_field(name="voice", value=voice_channel.name, inline=False)
await ctx.send(embed=embed, ephemeral=True)

Expand All @@ -163,7 +163,7 @@ async def join(ctx: disnake.ApplicationCommandInteraction):
async def leave(ctx: disnake.ApplicationCommandInteraction):
if not ctx.guild.voice_client:
embed = disnake.Embed(
color=0xCD853F,
color=0x2f3136,
title="Ошибка",
description="Я не нахожусь в голосовом канале"
)
Expand All @@ -172,7 +172,7 @@ async def leave(ctx: disnake.ApplicationCommandInteraction):

await ctx.guild.voice_client.disconnect()
embed = disnake.Embed(
color=0xCD853F,
color=0x2f3136,
title="Готово",
description="Успешно отключилась от голосового канала"
)
Expand All @@ -185,7 +185,7 @@ async def leave(ctx: disnake.ApplicationCommandInteraction):
async def stay(ctx):
if not ctx.author.voice:
embed = disnake.Embed(
color=0xCD853F,
color=0x2f3136,
title="Ошибка",
description="Вы должны находиться в голосовом канале, чтобы использовать эту команду."
)
Expand All @@ -197,14 +197,14 @@ async def stay(ctx):
if voice_client and voice_client.is_connected():
await voice_client.move_to(vc)
embed = disnake.Embed(
color=0xCD853F,
color=0x2f3136,
title="Готово",
description=f'Я останусь в голосовом канале "{vc.name}" до тех пор, пока меня не попросят выйти. Для этого напиши /leave.'
)
else:
voice_client = await vc.connect()
embed = disnake.Embed(
color=0xCD853F,
color=0x2f3136,
title="Готово",
description="Удачно зашла в голосовой канал."
)
Expand All @@ -220,7 +220,7 @@ async def create_role(ctx, name: str):
embed = disnake.Embed(
title='Роль создана',
description=f'Новая роль {role.mention} была создана!',
color=0xCD853F
color=0x2f3136
)
await ctx.send(embed=embed, ephemeral=True)

Expand All @@ -232,7 +232,7 @@ async def assign_role(ctx, role: disnake.Role, member: disnake.Member):
embed = disnake.Embed(
title='Роль добавлена',
description=f'Пользователю {member.mention} была выдана роль {role.mention}!',
color=0xCD853F
color=0x2f3136
)
await ctx.send(embed=embed, ephemeral=True)

Expand All @@ -244,7 +244,7 @@ async def remove_role(ctx, role: disnake.Role, member: disnake.Member):
embed = disnake.Embed(
title='Роль удалена',
description=f'У пользователя {member.mention} была удалена роль {role.mention}!',
color=0xCD853F
color=0x2f3136
)
await ctx.send(embed=embed, ephemeral=True)

Expand All @@ -257,7 +257,7 @@ async def set_nickname(self, ctx, member: disnake.Member, new_nickname: str):
embed = disnake.Embed(
title="Изменение никнейма :pen_ballpoint:",
description=f"Никнейм участника {member.mention} был изменен на {new_nickname}.",
color=0xCD853F
color=0x2f3136
)
await ctx.send(embed=embed, ephemeral=True)

Expand All @@ -277,7 +277,7 @@ async def set_color_role(ctx, role: disnake.Role, color: str = None):

await role.edit(color=color)

embed = disnake.Embed(title='Цвет изменен', color=0xCD853F)
embed = disnake.Embed(title='Цвет изменен', color=0x2f3136)
embed.add_field(name='Роль', value=role.mention)
embed.add_field(name='Цвет', value=f'#{color.value:06x}')

Expand All @@ -295,7 +295,7 @@ async def set_color_role(ctx, role: disnake.Role, color: str = None):
@commands.has_permissions(administrator=True)
async def poll(self, ctx, *, text):
await ctx.channel.purge(limit=1)
poll = disnake.Embed(description=text, colour=randint(0, 0xCD853F))
poll = disnake.Embed(description=text, colour=randint(0, 0x2f3136))
poll.timestamp = datetime.utcnow()
msg = await ctx.channel.send(embed=poll)
await msg.add_reaction("✔")
Expand All @@ -314,7 +314,7 @@ async def send(self, ctx, member: disnake.Member, *, text):

success_embed = disnake.Embed(title="Сообщение отправлено!",
description=f"Успешно отправил участнику {member.mention}",
color=0xCD853F)
color=0x2f3136)
await ctx.send(embed=success_embed, ephemeral=True)


Expand Down
18 changes: 9 additions & 9 deletions cogs/econom.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async def daily(ctx: disnake.ApplicationCommandInteraction):
new_balance = balance + random.randint(50, 150)
c.execute('UPDATE economy SET balance = ?, last_daily = ? WHERE user_id = ?', (new_balance, int(datetime.utcnow().timestamp()), user_id))
conn.commit()
embed=disnake.Embed(color=0xCD853F)
embed=disnake.Embed(color=0x2f3136)
embed.add_field(name="Poli-coins", value="Ежедневный бонус", inline=False)
embed.add_field(name="Ты получил", value=f"{new_balance - balance} Poli-coins", inline=True)
await ctx.send(embed=embed, ephemeral=True)
Expand All @@ -65,12 +65,12 @@ async def balance(ctx: disnake.ApplicationCommandInteraction):
if not row:
c.execute('INSERT INTO economy (user_id, username, balance, last_daily) VALUES (?, ?, 0, 0)', (user_id, ctx.author.name))
conn.commit()
embed = disnake.Embed(color=0xCD853F)
embed = disnake.Embed(color=0x2f3136)
embed.add_field(name="Ваш баланс", value="На вашем счету: 0", inline=True)
await ctx.send(embed=embed, ephemeral=True)
else:
balance = row[0]
embed = disnake.Embed(color=0xCD853F)
embed = disnake.Embed(color=0x2f3136)
embed.add_field(name="Ваш баланс", value=f"На вашем счету: {balance}", inline=True)
await ctx.send(embed=embed, ephemeral=True)

Expand All @@ -97,7 +97,7 @@ async def heads_or_tails(ctx: disnake.ApplicationCommandInteraction, bet: int, g
c.execute('UPDATE economy SET balance = balance + ? WHERE user_id = ?', (winnings, user_id))
conn.commit()
message = f"{ctx.author.mention}, Вы выиграли {winnings} Poli-coins! Результат: {result}."
color = 0xCD853F
color = 0x2f3136
else:
c.execute('UPDATE economy SET balance = balance - ? WHERE user_id = ?', (bet, user_id))
conn.commit()
Expand Down Expand Up @@ -148,7 +148,7 @@ async def mine(self, ctx):
amount = random.randint(1, 10)
self.update_balance(user_id, amount)

embed = disnake.Embed(title="Вы заработали Poli-coins!", description=f"{ctx.author.mention}, вы заработали {amount} Poli-coins работая {profession} ⛏️!", color=0xCD853F)
embed = disnake.Embed(title="Вы заработали Poli-coins!", description=f"{ctx.author.mention}, вы заработали {amount} Poli-coins работая {profession} ⛏️!", color=0x2f3136)
await ctx.send(embed=embed, ephemeral=True)

@commands.cooldown(1, 86400, commands.BucketType.user)
Expand All @@ -159,7 +159,7 @@ async def work(self, ctx):
amount = random.randint(10, 50)
self.update_balance(user_id, amount)

embed = disnake.Embed(title="Вы заработали Poli-coins!", description=f"{ctx.author.mention}, вы заработали {amount} Poli-coins работая {profession} 👠!", color=0xCD853F)
embed = disnake.Embed(title="Вы заработали Poli-coins!", description=f"{ctx.author.mention}, вы заработали {amount} Poli-coins работая {profession} 👠!", color=0x2f3136)
await ctx.send(embed=embed, ephemeral=True)

@commands.cooldown(1, 86400, commands.BucketType.user)
Expand All @@ -170,7 +170,7 @@ async def code(self, ctx):
amount = random.randint(20, 100)
self.update_balance(user_id, amount)

embed = disnake.Embed(title="Вы заработали Poli-coins!", description=f"{ctx.author.mention}, вы заработали {amount} Poli-coins работая {profession} 💻!", color=0xCD853F)
embed = disnake.Embed(title="Вы заработали Poli-coins!", description=f"{ctx.author.mention}, вы заработали {amount} Poli-coins работая {profession} 💻!", color=0x2f3136)
await ctx.send(embed=embed, ephemeral=True)


Expand Down Expand Up @@ -201,7 +201,7 @@ async def transfer_coins(self, ctx: disnake.ApplicationCommandInteraction, amoun
c.execute('UPDATE economy SET balance = ? WHERE user_id = ?', (target_new_balance, target_id))
conn.commit()

embed = disnake.Embed(title="Перевод Poli-coins", description=f"{ctx.author.mention} успешно перевел {amount} Poli-coins пользователю {target.mention}.", color=0xCD853F)
embed = disnake.Embed(title="Перевод Poli-coins", description=f"{ctx.author.mention} успешно перевел {amount} Poli-coins пользователю {target.mention}.", color=0x2f3136)
await ctx.send(embed=embed, ephemeral=True)


Expand All @@ -212,7 +212,7 @@ async def set_balance(self, ctx: disnake.ApplicationCommandInteraction, target:
c.execute('UPDATE economy SET balance = ? WHERE user_id = ?', (new_balance, target_id))
conn.commit()

embed = disnake.Embed(title="Изменение баланса", color=0xCD853F)
embed = disnake.Embed(title="Изменение баланса", color=0x2f3136)
embed.add_field(name="Пользователь", value=target.mention, inline=False)
embed.add_field(name="Новый баланс", value=f"{new_balance} Poli-coins", inline=False)

Expand Down
7 changes: 3 additions & 4 deletions cogs/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,18 @@ async def on_message(self, message):
embed = disnake.Embed(
title="",
description=f"{message.author.mention}, Я удалила ваше сообщение, так как оно нарушает правила сервера! ❌",
color=0xCD853F
color=0x2f3136
)
await message.channel.send(embed=embed)
break



@commands.Cog.listener()
async def on_slash_command_error(self, interaction: disnake.Interaction, error):
if isinstance(error, commands.errors.CommandError):
embed = disnake.Embed(
title="Error",
color=0xCD853F,
color=0x2f3136,
description=f"Команда не смогла отправить ответ\n```js\n- Error Description: {str('{')}\n{error}\n{str('}')}\n```\nЕсли вы хотите помочь в разработке бота, то вы можете отправить эту ошибку нам на [support server](https://discord.gg/EepTPBS8) в [bugs-report](https://discord.gg/wUT3czzU) канал, после чего мы это исправим.")
await interaction.response.send_message(embed=embed, ephemeral=True)

Expand All @@ -50,7 +49,7 @@ async def on_slash_command_error(self, interaction: disnake.Interaction, error):

@commands.Cog.listener()
async def on_member_join(self, member):
emb = disnake.Embed(title="Привет! добро пожаловать на сервер...", color=0xCD853F)
emb = disnake.Embed(title="Привет! добро пожаловать на сервер...", color=0x2f3136)
emb.add_field(name="Мои команды", value="Чтобы узнать подробнее команды напиши - /help")

await member.send(embed=emb)
Expand Down
Loading

0 comments on commit c472488

Please sign in to comment.