Skip to content

Commit

Permalink
v0.1.8-b
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamziee committed Mar 30, 2024
1 parent a69dce9 commit 62a74f1
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions commands/embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,16 @@ def rgb_to_discord_colour(rgb):
else:
# Default color if the color name is not found
embed_color = discord.Colour.blurple()

try:
if interaction.permissions.manage_guild is True:
embed = discord.Embed(
color=embed_color,
title=title,
description=description)
if interaction.user.id == config.OWNER_ID:
# admin version does not show slash command used
await interaction.response.send_message(content='Embed created, deleting in 5 seconds...', ephemeral=True, delete_after=5)
await interaction.channel.send(embed=embed)
else:
await interaction.response.send_message(embed=embed)
except Exception as e:
print(e)
await interaction.response.send_message(content='Error occured.')
await interaction.response.send_message(content='Embed created, deleting in 5 seconds...', ephemeral=True, delete_after=5)
await interaction.channel.send(embed=embed)
else:
await interaction.response.send_message(content='You need the `Manage Server` permission to make embeds.', ephemeral=True)


async def setup(client:commands.Bot) -> None:
await client.add_cog(embed(client))

0 comments on commit 62a74f1

Please sign in to comment.