mirror of
https://git.phreedom.club/localhost_frssoft/mastodon-group-bot.git
synced 2024-12-27 03:29:48 +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
|
} else if notif.Status.Visibility == "direct" { // Admin commands
|
||||||
for y := 0; y < len(Conf.Admins); y++ {
|
for y := 0; y < len(Conf.Admins); y++ {
|
||||||
if acct == Conf.Admins[y] {
|
if acct == Conf.Admins[y] {
|
||||||
recmd := regexp.MustCompile(`<.*?> `)
|
recmd := regexp.MustCompile(`<[^>]+>`)
|
||||||
command := recmd.ReplaceAllString(content, "")
|
command := recmd.ReplaceAllString(content, "")
|
||||||
args := strings.Split(command, " ")
|
args := strings.Split(command, " ")
|
||||||
mID := mastodon.ID((args[1]))
|
mID := mastodon.ID((args[2]))
|
||||||
|
|
||||||
if len(args) == 2 {
|
if len(args) == 3 {
|
||||||
switch args[0] {
|
switch args[1] {
|
||||||
case "unboost":
|
case "unboost":
|
||||||
c.Unreblog(ctx, mID)
|
c.Unreblog(ctx, mID)
|
||||||
|
WarnLogger.Printf("%s was unrebloged", mID)
|
||||||
case "delete":
|
case "delete":
|
||||||
c.DeleteStatus(ctx, mID)
|
c.DeleteStatus(ctx, mID)
|
||||||
|
WarnLogger.Printf("%s was deleted", mID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user