wouldyourather

package
v0.0.0-...-fb67095 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &commands.YAGCommand{
	CmdCategory: commands.CategoryFun,
	Name:        "WouldYouRather",
	Aliases:     []string{"wyr"},
	Description: "Get presented with 2 options.",
	ArgSwitches: []*dcmd.ArgDef{
		{Name: "raw", Help: "Raw output"},
	},
	RunFunc: func(data *dcmd.Data) (interface{}, error) {

		question := randomQuestion()

		wyrDescription := fmt.Sprintf("**EITHER...**\n🇦 %s\n\n **OR...**\n🇧 %s", question.OptionA, question.OptionB)

		if data.Switches["raw"].Value != nil && data.Switches["raw"].Value.(bool) {
			return wyrDescription, nil
		}

		embed := &discordgo.MessageEmbed{
			Description: wyrDescription,
			Author: &discordgo.MessageEmbedAuthor{
				Name: "Would you rather...",
			},
			Footer: &discordgo.MessageEmbedFooter{
				Text: fmt.Sprintf("Requested by: %s", data.Author.String()),
			},
			Color: rand.Intn(16777215),
		}

		msg, err := common.BotSession.ChannelMessageSendEmbed(data.ChannelID, embed)
		if err != nil {
			return nil, err
		}

		common.BotSession.MessageReactionAdd(data.ChannelID, msg.ID, "🇦")
		common.BotSession.MessageReactionAdd(data.ChannelID, msg.ID, "🇧")
		return dcmd.MarkManualResponse([]*discordgo.Message{msg}), nil
	},
}
View Source
var Questions = []WouldYouRather{}/* 367 elements not displayed */

Functions

This section is empty.

Types

type WouldYouRather

type WouldYouRather struct {
	OptionA string
	OptionB string
}

Jump to

Keyboard shortcuts

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