diff --git a/TODO.md b/TODO.md index d7fb82a..27d97ee 100644 --- a/TODO.md +++ b/TODO.md @@ -65,6 +65,8 @@ - [ ] Add logs to channel +- [ ] make /codepreview into /github and it can parse any github url + - [ ] Add idevice livecontainer command - [x] add [tts](https://developer.puter.com/tutorials/free-unlimited-text-to-speech-api/) command diff --git a/cogs/utilities/codepreview.py b/cogs/utilities/codepreview.py index cc1636c..91b8057 100644 --- a/cogs/utilities/codepreview.py +++ b/cogs/utilities/codepreview.py @@ -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