forked from botlabs-gg/yagpdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
banserver.go
32 lines (28 loc) · 866 Bytes
/
banserver.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package banserver
import (
"github.com/jonas747/dcmd"
"github.com/jonas747/yagpdb/commands"
"github.com/jonas747/yagpdb/common"
"github.com/jonas747/yagpdb/stdcommands/util"
"github.com/mediocregopher/radix.v3"
)
var Command = &commands.YAGCommand{
Cooldown: 2,
CmdCategory: commands.CategoryDebug,
HideFromCommandsPage: true,
Name: "banserver",
Description: ";))",
HideFromHelp: true,
RequiredArgs: 1,
Arguments: []*dcmd.ArgDef{
{Name: "server", Type: dcmd.Int},
},
RunFunc: util.RequireOwner(func(data *dcmd.Data) (interface{}, error) {
err := common.BotSession.GuildLeave(data.Args[0].Int64())
if err == nil {
common.RedisPool.Do(radix.FlatCmd(nil, "SADD", "banned_servers", data.Args[0].Int64()))
return "Banned " + data.Args[0].Str(), nil
}
return nil, err
}),
}