|
|
@ -1,6 +1,9 @@
|
|
|
|
package commands
|
|
|
|
package commands
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
|
|
|
|
"PermissionGacha/modules/config"
|
|
|
|
"PermissionGacha/modules/config"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/bwmarrin/discordgo"
|
|
|
|
"github.com/bwmarrin/discordgo"
|
|
|
@ -31,6 +34,28 @@ func handleAdminCommand(s *discordgo.Session, args []string, m *discordgo.Messag
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
s.ChannelMessageSend(args[4], msg.Content)
|
|
|
|
s.ChannelMessageSend(args[4], msg.Content)
|
|
|
|
|
|
|
|
case "kick":
|
|
|
|
|
|
|
|
separator := -1
|
|
|
|
|
|
|
|
for k, v := range args {
|
|
|
|
|
|
|
|
if v == "|" {
|
|
|
|
|
|
|
|
separator = k
|
|
|
|
|
|
|
|
break
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if separator == -1 {
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
kickReason := strings.Join(args[2:separator], " ")
|
|
|
|
|
|
|
|
for i := separator + 1; i < len(args); i++ {
|
|
|
|
|
|
|
|
channel, err := s.UserChannelCreate(args[i])
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
s.ChannelMessageSend(
|
|
|
|
|
|
|
|
channel.ID,
|
|
|
|
|
|
|
|
fmt.Sprintf("**SYSTEM MESSAGE >** You've been kicked for the following reason: \n%s", kickReason),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
s.GuildMemberDeleteWithReason(config.GuildID, args[i], kickReason)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|