mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-08 14:57:54 +00:00
implement admin commands
This commit is contained in:
parent
5198f7d83b
commit
a268f75d32
15 changed files with 263 additions and 287 deletions
|
|
@ -58,16 +58,14 @@ public class ProxiedMessage
|
|||
_redisService = redisService;
|
||||
}
|
||||
|
||||
public async Task ReproxyMessage(Context ctx, ulong? messageId)
|
||||
public async Task ReproxyMessage(Context ctx, ulong? messageId, PKMember target)
|
||||
{
|
||||
var (msg, systemId) = await GetMessageToEdit(ctx, messageId, ReproxyTimeout, true);
|
||||
|
||||
if (ctx.System.Id != systemId)
|
||||
throw new PKError("Can't reproxy a message sent by a different system.");
|
||||
|
||||
// Get target member ID
|
||||
var target = await ctx.MatchMember(restrictToSystem: ctx.System.Id);
|
||||
if (target == null)
|
||||
if (target == null || target.System != ctx.System.Id)
|
||||
throw new PKError("Could not find a member to reproxy the message with.");
|
||||
|
||||
// Fetch members and get the ProxyMember for `target`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue