|
1 | 1 | import asyncio |
| 2 | +from operator import truediv |
2 | 3 | import re |
3 | 4 | from datetime import datetime |
4 | 5 | from itertools import zip_longest |
@@ -835,6 +836,28 @@ async def freply(self, ctx, *, msg: str = ""): |
835 | 836 | async with ctx.typing(): |
836 | 837 | await ctx.thread.reply(ctx.message) |
837 | 838 |
|
| 839 | + @commands.command(aliases=["formatanonreply"]) |
| 840 | + @checks.has_permissions(PermissionLevel.SUPPORTER) |
| 841 | + @checks.thread_only() |
| 842 | + async def fareply(self, ctx, *, msg: str = ""): |
| 843 | + """ |
| 844 | + Anonymously reply to a Modmail thread with variables. |
| 845 | +
|
| 846 | + Works just like `{prefix}areply`, however with the addition of three variables: |
| 847 | + - `{{channel}}` - the `discord.TextChannel` object |
| 848 | + - `{{recipient}}` - the `discord.User` object of the recipient |
| 849 | + - `{{author}}` - the `discord.User` object of the author |
| 850 | +
|
| 851 | + Supports attachments and images as well as |
| 852 | + automatically embedding image URLs. |
| 853 | + """ |
| 854 | + msg = self.bot.formatter.format( |
| 855 | + msg, channel=ctx.channel, recipient=ctx.thread.recipient, author=ctx.message.author |
| 856 | + ) |
| 857 | + ctx.message.content = msg |
| 858 | + async with ctx.typing(): |
| 859 | + await ctx.thread.reply(ctx.message, anonymous=True) |
| 860 | + |
838 | 861 | @commands.command(aliases=["anonreply", "anonymousreply"]) |
839 | 862 | @checks.has_permissions(PermissionLevel.SUPPORTER) |
840 | 863 | @checks.thread_only() |
|
0 commit comments