-
Notifications
You must be signed in to change notification settings - Fork 908
/
roast.go
32 lines (29 loc) · 854 Bytes
/
roast.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 roast
import (
"fmt"
"html"
"github.com/botlabs-gg/yagpdb/v2/commands"
"github.com/botlabs-gg/yagpdb/v2/lib/dcmd"
"github.com/botlabs-gg/yagpdb/v2/lib/discordgo"
)
var Command = &commands.YAGCommand{
CmdCategory: commands.CategoryFun,
Name: "Roast",
Aliases: []string{"insult"},
Description: "Sends a random roast",
Arguments: []*dcmd.ArgDef{
{Name: "Target", Type: dcmd.User},
},
DefaultEnabled: true,
SlashCommandEnabled: true,
RunFunc: func(data *dcmd.Data) (interface{}, error) {
target := "a random person nearby"
if data.Args[0].Value != nil {
target = data.Args[0].Value.(*discordgo.User).Username
}
embed := &discordgo.MessageEmbed{}
embed.Title = fmt.Sprintf(`%s roasted %s`, data.Author.Username, target)
embed.Description = html.UnescapeString(randomRoast())
return embed, nil
},
}