fix: correctly throw missing content error in pk;edit

This commit is contained in:
spiral 2022-01-07 14:06:37 -05:00
parent 5627fa9864
commit 91213faa50
No known key found for this signature in database
GPG Key ID: A6059F0CA0E1BD31

View File

@ -46,10 +46,11 @@ public class ProxiedMessage
public async Task EditMessage(Context ctx) public async Task EditMessage(Context ctx)
{ {
var msg = await GetMessageToEdit(ctx);
if (!ctx.HasNext()) if (!ctx.HasNext())
throw new PKSyntaxError("You need to include the message to edit in."); throw new PKSyntaxError("You need to include the message to edit in.");
var msg = await GetMessageToEdit(ctx);
if (ctx.System.Id != msg.System.Id) if (ctx.System.Id != msg.System.Id)
throw new PKError("Can't edit a message sent by a different system."); throw new PKError("Can't edit a message sent by a different system.");