diff options
author | Parker <contact@pkrm.dev> | 2025-01-25 23:53:39 -0600 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2025-01-25 23:53:39 -0600 |
commit | 5c4e55c502f7356938d31202343f6983d9526191 (patch) | |
tree | 6c6d1a8ec78b288e12d8ec7f5dee7876066ca5c1 /code | |
parent | c9bc0c9c4efea967077fc2728749a218c0420738 (diff) |
Bug Follow-up
Diffstat (limited to 'code')
-rw-r--r-- | code/cogs/owner/send.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/code/cogs/owner/send.py b/code/cogs/owner/send.py new file mode 100644 index 0000000..3f76323 --- /dev/null +++ b/code/cogs/owner/send.py @@ -0,0 +1,28 @@ +from discord.ext import commands + + +class Send(commands.Cog): + def __init__(self, bot): + self.bot = bot + + @commands.command() + @commands.dm_only() + @commands.is_owner() + async def potoken(self, ctx, user_id: int, message: str): + """Send a message to a user (follow-up on bug reports)""" + user = self.bot.get_user(user_id) + + if not user: + return await ctx.send("User not found.") + + elif not message: + return await ctx.send("No message for user.") + + try: + await user.send(message) + except Exception as e: + await ctx.send("Error sending message to user.") + + +async def setup(bot): + await bot.add_cog(Send(bot)) |