forked from botlabs-gg/yagpdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setstatus.go
28 lines (26 loc) · 842 Bytes
/
setstatus.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
package setstatus
import (
"github.com/jonas747/dcmd"
"github.com/jonas747/yagpdb/bot"
"github.com/jonas747/yagpdb/commands"
"github.com/jonas747/yagpdb/stdcommands/util"
)
var Command = &commands.YAGCommand{
Cooldown: 2,
CmdCategory: commands.CategoryDebug,
HideFromCommandsPage: true,
Name: "setstatus",
Description: "Sets the bot's status and streaming url",
HideFromHelp: true,
Arguments: []*dcmd.ArgDef{
{Name: "status", Type: dcmd.String, Default: ""},
},
ArgSwitches: []*dcmd.ArgDef{
{Switch: "url", Name: "streaming url", Type: dcmd.String, Default: ""},
},
RunFunc: util.RequireBotAdmin(func(data *dcmd.Data) (interface{}, error) {
streamingURL := data.Switch("url").Str()
bot.SetStreaming(streamingURL, data.Args[0].Str())
return "Doneso", nil
}),
}