mirror of
https://github.com/neoarz/Syntrel.git
synced 2025-12-25 03:40:11 +01:00
refactor(invite): command message handling
Refactored the invite command to always send the invite embed in the current context instead of attempting to DM the user first. This removes the try/except logic and ensures consistent behavior.
This commit is contained in:
@@ -40,11 +40,7 @@ class Invite(commands.Cog, name="invite"):
|
||||
embed = discord.Embed(title="Install", description=f"Install me by clicking [here]({invite_link}).", color=0x7289DA)
|
||||
embed.set_author(name="Owner", icon_url="https://yes.nighty.works/raw/zReOib.webp")
|
||||
|
||||
try:
|
||||
await context.author.send(embed=embed)
|
||||
await self.send_embed(context, discord.Embed(description="I sent you a private message!", color=0x7289DA), ephemeral=True)
|
||||
except discord.Forbidden:
|
||||
await self.send_embed(context, embed, ephemeral=True)
|
||||
await self.send_embed(context, embed, ephemeral=False)
|
||||
|
||||
async def cog_command_error(self, context: Context, error) -> None:
|
||||
if isinstance(error, commands.NotOwner):
|
||||
|
||||
Reference in New Issue
Block a user