forked from botlabs-gg/yagpdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unbanserver.go
36 lines (31 loc) · 885 Bytes
/
unbanserver.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
33
34
35
36
package unbanserver
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: "unbanserver",
Description: ";))",
HideFromHelp: true,
RequiredArgs: 1,
Arguments: []*dcmd.ArgDef{
{Name: "server", Type: dcmd.String},
},
RunFunc: util.RequireOwner(func(data *dcmd.Data) (interface{}, error) {
var unbanned bool
err := common.RedisPool.Do(radix.Cmd(&unbanned, "SREM", "banned_servers", data.Args[0].Str()))
if err != nil {
return nil, err
}
if !unbanned {
return "Server wasnt banned", nil
}
return "Unbanned server", nil
}),
}