mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-07 06:17:55 +00:00
Add shorthand 'pk;x' for 'pk;edit -regex'
This commit is contained in:
parent
19fdae6ce9
commit
8f7f4ab6f4
3 changed files with 9 additions and 5 deletions
|
|
@ -91,7 +91,7 @@ public class ProxiedMessage
|
|||
}
|
||||
}
|
||||
|
||||
public async Task EditMessage(Context ctx)
|
||||
public async Task EditMessage(Context ctx, bool useRegex)
|
||||
{
|
||||
var (msg, systemId) = await GetMessageToEdit(ctx, EditTimeout, false);
|
||||
|
||||
|
|
@ -103,7 +103,7 @@ public class ProxiedMessage
|
|||
throw new PKError("Could not edit message.");
|
||||
|
||||
// Regex flag
|
||||
var useRegex = ctx.MatchFlag("regex", "x");
|
||||
useRegex = useRegex || ctx.MatchFlag("regex", "x");
|
||||
|
||||
// Check if we should append or prepend
|
||||
var mutateSpace = ctx.MatchFlag("nospace", "ns") ? "" : " ";
|
||||
|
|
@ -433,4 +433,4 @@ public class ProxiedMessage
|
|||
else
|
||||
await ctx.Rest.CreateReaction(ctx.Message.ChannelId, ctx.Message.Id, new Emoji { Name = Emojis.Success });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue