refactor(codepreview): no dms

This commit is contained in:
neoarz
2025-10-18 00:19:04 -04:00
parent c286c2a070
commit cc01c60250
2 changed files with 11 additions and 0 deletions

View File

@@ -174,6 +174,15 @@ def codepreview_command():
url="GitHub URL to preview code from"
)
async def codepreview(self, context, url: str = None):
if not context.guild:
embed = discord.Embed(
title="Error",
description="Due to reasons ~~gatekeep~~, this command can only be used in servers. Please add this bot to your sever to use it, or use it in a server which has this bot added.",
color=0xE02B2B,
).set_author(name="Utility", icon_url="https://yes.nighty.works/raw/8VLDcg.webp")
await send_embed(context, embed, ephemeral=True)
return
if not url or not url.strip():
if context.message and context.message.reference and context.message.reference.resolved:
replied_message = context.message.reference.resolved