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:
neoarz
2025-10-03 18:30:27 -04:00
parent 9fafc3ca4f
commit 73535e283d

View File

@@ -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 = 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") embed.set_author(name="Owner", icon_url="https://yes.nighty.works/raw/zReOib.webp")
try: await self.send_embed(context, embed, ephemeral=False)
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)
async def cog_command_error(self, context: Context, error) -> None: async def cog_command_error(self, context: Context, error) -> None:
if isinstance(error, commands.NotOwner): if isinstance(error, commands.NotOwner):