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

@@ -65,6 +65,8 @@
- [ ] Add logs to channel - [ ] Add logs to channel
- [ ] make /codepreview into /github and it can parse any github url
- [ ] Add idevice livecontainer command - [ ] Add idevice livecontainer command
- [x] add [tts](https://developer.puter.com/tutorials/free-unlimited-text-to-speech-api/) command - [x] add [tts](https://developer.puter.com/tutorials/free-unlimited-text-to-speech-api/) command

View File

@@ -174,6 +174,15 @@ def codepreview_command():
url="GitHub URL to preview code from" url="GitHub URL to preview code from"
) )
async def codepreview(self, context, url: str = None): 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 not url or not url.strip():
if context.message and context.message.reference and context.message.reference.resolved: if context.message and context.message.reference and context.message.reference.resolved:
replied_message = context.message.reference.resolved replied_message = context.message.reference.resolved