mirror of
https://gitea.phreedom.club/localhost_frssoft/mastodon-group-bot
synced 2024-11-22 05:21:27 +00:00
fix admin panel
This commit is contained in:
parent
9485520c18
commit
8b7e62f070
10
bot.go
10
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 {
|
||||
|
|
Loading…
Reference in a new issue