From 8b7e62f07045a4b8e4ee11f5ba664b2ec412727d Mon Sep 17 00:00:00 2001 From: fade Date: Sun, 4 Sep 2022 07:17:01 -0400 Subject: [PATCH] fix admin panel --- bot.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bot.go b/bot.go index 8d01c0e..4ebb806 100644 --- a/bot.go +++ b/bot.go @@ -116,17 +116,19 @@ func RunBot() { } else if notif.Status.Visibility == "direct" { // Admin commands for y := 0; y < len(Conf.Admins); y++ { if acct == Conf.Admins[y] { - recmd := regexp.MustCompile(`<.*?> `) + recmd := regexp.MustCompile(`<[^>]+>`) command := recmd.ReplaceAllString(content, "") args := strings.Split(command, " ") - mID := mastodon.ID((args[1])) + mID := mastodon.ID((args[2])) - if len(args) == 2 { - switch args[0] { + if len(args) == 3 { + switch args[1] { case "unboost": c.Unreblog(ctx, mID) + WarnLogger.Printf("%s was unrebloged", mID) case "delete": c.DeleteStatus(ctx, mID) + WarnLogger.Printf("%s was deleted", mID) } } } else {