mirror of
https://github.com/neoarz/Syntrel.git
synced 2025-12-25 11:40:12 +01:00
feat(read description): Add translate utility cog and update categories
Introduces a new 'translate' command under a utilities category, with language autocomplete and Google Translate integration. Updates README and help command to reflect the new category and command. Renames 'rr.py' to 'rickroll.py'. Updates moderation cogs to use a new icon URL for embed authors.
This commit is contained in:
@@ -41,7 +41,7 @@ class Ban(commands.Cog, name="ban"):
|
||||
title="Ban",
|
||||
description=f"**{user}** was banned by **{context.author}**!",
|
||||
color=0x7289DA,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
embed.add_field(name="Reason:", value=reason)
|
||||
await context.send(embed=embed)
|
||||
return
|
||||
@@ -50,7 +50,7 @@ class Ban(commands.Cog, name="ban"):
|
||||
title="Error!",
|
||||
description="I don't have permission to ban this user.",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await context.send(embed=embed, ephemeral=True)
|
||||
return
|
||||
except Exception:
|
||||
@@ -58,7 +58,7 @@ class Ban(commands.Cog, name="ban"):
|
||||
title="Error!",
|
||||
description="An error occurred while trying to ban the user.",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await context.send(embed=embed, ephemeral=True)
|
||||
return
|
||||
|
||||
@@ -67,7 +67,7 @@ class Ban(commands.Cog, name="ban"):
|
||||
title="Missing Permissions!",
|
||||
description="You don't have the `Ban Members` permission to use this command.",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await context.send(embed=embed, ephemeral=True)
|
||||
return
|
||||
|
||||
@@ -76,7 +76,7 @@ class Ban(commands.Cog, name="ban"):
|
||||
title="Cannot Ban User",
|
||||
description="This user has a higher or equal role to me. Make sure my role is above theirs.",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await context.send(embed=embed, ephemeral=True)
|
||||
return
|
||||
|
||||
@@ -86,7 +86,7 @@ class Ban(commands.Cog, name="ban"):
|
||||
title="Cannot Ban User",
|
||||
description="You cannot ban this user as they have a higher or equal role to you.",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await context.send(embed=embed, ephemeral=True)
|
||||
return
|
||||
|
||||
@@ -111,7 +111,7 @@ class Ban(commands.Cog, name="ban"):
|
||||
title="Ban",
|
||||
description=f"You were banned by **{context.author}** from **{context.guild.name}**!\nReason: {reason}",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await member.send(embed=dm_embed)
|
||||
except (discord.Forbidden, discord.HTTPException):
|
||||
pass
|
||||
@@ -128,7 +128,7 @@ class Ban(commands.Cog, name="ban"):
|
||||
title="Ban",
|
||||
description=f"**{user}** was banned by **{context.author}**!",
|
||||
color=0x7289DA,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
embed.add_field(name="Reason:", value=reason)
|
||||
|
||||
if delete_messages != "none":
|
||||
@@ -145,7 +145,7 @@ class Ban(commands.Cog, name="ban"):
|
||||
title="Error!",
|
||||
description="I don't have permission to ban this user. Make sure my role is above theirs.",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await context.send(embed=embed, ephemeral=True)
|
||||
except discord.HTTPException as e:
|
||||
if "Cannot ban the owner of a guild" in str(e):
|
||||
@@ -153,20 +153,20 @@ class Ban(commands.Cog, name="ban"):
|
||||
title="Cannot Ban User",
|
||||
description="You cannot ban the server owner.",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
else:
|
||||
embed = discord.Embed(
|
||||
title="Error!",
|
||||
description=f"Discord API error: {str(e)}",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await context.send(embed=embed, ephemeral=True)
|
||||
except Exception as e:
|
||||
embed = discord.Embed(
|
||||
title="Debug Error!",
|
||||
description=f"Error type: {type(e).__name__}\nError message: {str(e)}",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await context.send(embed=embed, ephemeral=True)
|
||||
|
||||
except Exception as e:
|
||||
@@ -174,7 +174,7 @@ class Ban(commands.Cog, name="ban"):
|
||||
title="Error!",
|
||||
description="An unexpected error occurred.",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await context.send(embed=embed, ephemeral=True)
|
||||
|
||||
async def delete_all_user_messages(self, guild: discord.Guild, user_id: int) -> None:
|
||||
|
||||
@@ -37,7 +37,7 @@ class HackBan(commands.Cog, name="hackban"):
|
||||
title="Ban",
|
||||
description=f"**{user}** (ID: {user_id}) was banned by **{context.author}**!",
|
||||
color=0x7289DA,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
embed.add_field(name="Reason:", value=reason)
|
||||
await context.send(embed=embed)
|
||||
except Exception:
|
||||
@@ -45,7 +45,7 @@ class HackBan(commands.Cog, name="hackban"):
|
||||
title="Error!",
|
||||
description="An error occurred while trying to ban the user. Make sure ID is an existing ID that belongs to a user.",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await context.send(embed=embed)
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class Kick(commands.Cog, name="kick"):
|
||||
title="Error!",
|
||||
description="This user is not in the server.",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await context.send(embed=embed, ephemeral=True)
|
||||
return
|
||||
|
||||
@@ -38,7 +38,7 @@ class Kick(commands.Cog, name="kick"):
|
||||
title="Missing Permissions!",
|
||||
description="You don't have the `Kick Members` permission to use this command.",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await context.send(embed=embed, ephemeral=True)
|
||||
return
|
||||
|
||||
@@ -47,7 +47,7 @@ class Kick(commands.Cog, name="kick"):
|
||||
title="Cannot Kick User",
|
||||
description="This user has a higher or equal role to me. Make sure my role is above theirs.",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await context.send(embed=embed, ephemeral=True)
|
||||
return
|
||||
|
||||
@@ -57,7 +57,7 @@ class Kick(commands.Cog, name="kick"):
|
||||
title="Cannot Kick User",
|
||||
description="You cannot kick this user as they have a higher or equal role to you.",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await context.send(embed=embed, ephemeral=True)
|
||||
return
|
||||
|
||||
@@ -69,7 +69,7 @@ class Kick(commands.Cog, name="kick"):
|
||||
title="Kick",
|
||||
description=f"You were kicked by **{context.author}** from **{context.guild.name}**!\nReason: {reason}",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
|
||||
)
|
||||
except (discord.Forbidden, discord.HTTPException):
|
||||
@@ -81,7 +81,7 @@ class Kick(commands.Cog, name="kick"):
|
||||
title="Kick",
|
||||
description=f"**{user}** was kicked by **{context.author}**!",
|
||||
color=0x7289DA,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
embed.add_field(name="Reason:", value=reason)
|
||||
|
||||
await context.send(embed=embed)
|
||||
@@ -91,7 +91,7 @@ class Kick(commands.Cog, name="kick"):
|
||||
title="Error!",
|
||||
description="I don't have permission to kick this user. Make sure my role is above theirs.",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await context.send(embed=embed, ephemeral=True)
|
||||
except discord.HTTPException as e:
|
||||
if "Cannot kick the owner of a guild" in str(e):
|
||||
@@ -99,20 +99,20 @@ class Kick(commands.Cog, name="kick"):
|
||||
title="Cannot Kick User",
|
||||
description="You cannot kick the server owner.",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
else:
|
||||
embed = discord.Embed(
|
||||
title="Error!",
|
||||
description=f"Discord API error: {str(e)}",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await context.send(embed=embed, ephemeral=True)
|
||||
except Exception as e:
|
||||
embed = discord.Embed(
|
||||
title="Debug Error!",
|
||||
description=f"Error type: {type(e).__name__}\nError message: {str(e)}",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await context.send(embed=embed, ephemeral=True)
|
||||
|
||||
except Exception as e:
|
||||
@@ -120,7 +120,7 @@ class Kick(commands.Cog, name="kick"):
|
||||
title="Error!",
|
||||
description="An unexpected error occurred.",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await context.send(embed=embed, ephemeral=True)
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ class Nick(commands.Cog, name="nick"):
|
||||
title="Missing Permissions!",
|
||||
description="You are missing the permission(s) `manage_nicknames` to execute this command!",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
return await context.send(embed=embed, ephemeral=True)
|
||||
|
||||
if not context.guild.me.guild_permissions.manage_nicknames:
|
||||
@@ -39,7 +39,7 @@ class Nick(commands.Cog, name="nick"):
|
||||
title="Missing Permissions!",
|
||||
description="I am missing the permission(s) `manage_nicknames` to execute this command!",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
return await context.send(embed=embed, ephemeral=True)
|
||||
|
||||
member = context.guild.get_member(user.id) or await context.guild.fetch_member(
|
||||
@@ -51,14 +51,14 @@ class Nick(commands.Cog, name="nick"):
|
||||
title="Nickname",
|
||||
description=f"**{member}'s** new nickname is **{nickname}**!",
|
||||
color=0x7289DA,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await context.send(embed=embed)
|
||||
except:
|
||||
embed = discord.Embed(
|
||||
title="Missing Permissions!",
|
||||
description="An error occurred while trying to change the nickname of the user. Make sure my role is above the role of the user you want to change the nickname.",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await context.send(embed=embed, ephemeral=True)
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class Purge(commands.Cog, name="purge"):
|
||||
description=f"**{context.author}** cleared **{len(purged_messages)-1}** messages!",
|
||||
color=0x7289DA,
|
||||
)
|
||||
embed.set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
embed.set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await context.channel.send(embed=embed)
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class Warnings(commands.Cog, name="warnings"):
|
||||
title="Missing Permissions!",
|
||||
description="You are missing the permission(s) `manage_messages` to execute this command!",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
return await self.send_embed(context, embed, ephemeral=True)
|
||||
|
||||
if context.invoked_subcommand is None:
|
||||
@@ -42,7 +42,7 @@ class Warnings(commands.Cog, name="warnings"):
|
||||
description="Please specify a subcommand.\n\n**Subcommands:**\n`add` - Add a warning to a user.\n`remove` - Remove a warning from a user.\n`list` - List all warnings of a user.",
|
||||
color=0x7289DA,
|
||||
)
|
||||
embed.set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
embed.set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await self.send_embed(context, embed)
|
||||
|
||||
@warning.command(
|
||||
@@ -68,7 +68,7 @@ class Warnings(commands.Cog, name="warnings"):
|
||||
title="Missing Permissions!",
|
||||
description="You are missing the permission(s) `manage_messages` to execute this command!",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
return await self.send_embed(context, embed, ephemeral=True)
|
||||
member = context.guild.get_member(user.id) or await context.guild.fetch_member(
|
||||
user.id
|
||||
@@ -81,7 +81,7 @@ class Warnings(commands.Cog, name="warnings"):
|
||||
description=f"**{member}** was warned by **{context.author}**!\nTotal warns for this user: {total}",
|
||||
color=0x7289DA,
|
||||
)
|
||||
embed.set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
embed.set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
embed.add_field(name="Reason:", value=reason)
|
||||
await self.send_embed(context, embed)
|
||||
try:
|
||||
@@ -90,7 +90,7 @@ class Warnings(commands.Cog, name="warnings"):
|
||||
description=f"You were warned by **{context.author}** in **{context.guild.name}**!\nReason: {reason}",
|
||||
color=0xE02B2B,
|
||||
)
|
||||
dm_embed.set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
dm_embed.set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await member.send(embed=dm_embed)
|
||||
except:
|
||||
fallback = discord.Embed(
|
||||
@@ -123,7 +123,7 @@ class Warnings(commands.Cog, name="warnings"):
|
||||
title="Missing Permissions!",
|
||||
description="You are missing the permission(s) `manage_messages` to execute this command!",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
return await self.send_embed(context, embed, ephemeral=True)
|
||||
member = context.guild.get_member(user.id) or await context.guild.fetch_member(
|
||||
user.id
|
||||
@@ -134,7 +134,7 @@ class Warnings(commands.Cog, name="warnings"):
|
||||
description=f"Removed the warning **#{warn_id}** from **{member}**!\nTotal warns for this user: {total}",
|
||||
color=0x7289DA,
|
||||
)
|
||||
embed.set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
embed.set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
await self.send_embed(context, embed)
|
||||
|
||||
@warning.command(
|
||||
@@ -154,11 +154,11 @@ class Warnings(commands.Cog, name="warnings"):
|
||||
title="Missing Permissions!",
|
||||
description="You are missing the permission(s) `manage_messages` to execute this command!",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
return await self.send_embed(context, embed, ephemeral=True)
|
||||
warnings_list = await self.bot.database.get_warnings(user.id, context.guild.id)
|
||||
embed = discord.Embed(title=f"Warnings of {user}", color=0x7289DA)
|
||||
embed.set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
|
||||
embed.set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
description = ""
|
||||
if len(warnings_list) == 0:
|
||||
description = "This user has no warnings."
|
||||
|
||||
Reference in New Issue
Block a user