roast

package
v2.52.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
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,
	ArgSwitches: []*dcmd.ArgDef{
		{Name: "raw", Help: "Raw roast output, no embed"},
	},
	RunFunc: func(data *dcmd.Data) (interface{}, error) {
		roast := html.UnescapeString(randomRoast())

		if data.Switches["raw"].Value != nil && data.Switches["raw"].Value.(bool) {
			return roast, nil
		} else {
			embed := &discordgo.MessageEmbed{
				Title:  data.Author.Username + " roasted ",
				Footer: &discordgo.MessageEmbedFooter{Text: "Boom, roasted!"},
			}
			if arg0 := data.Args[0].Value; arg0 != nil {
				target := arg0.(*discordgo.User)
				embed.Title += target.Username
				embed.Description = fmt.Sprintf(`## Hey %s, %s`, target.Mention(), roast)
			} else {
				embed.Title += "a random person nearby"
				embed.Description = "## " + roast
			}

			return embed, nil
		}
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL