wouldyourather

package
v0.29.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2018 License: MIT Imports: 7 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.",
	RunFunc: func(data *dcmd.Data) (interface{}, error) {

		q1, q2, err := wouldYouRather()
		if err != nil {
			return "Failed fetching the questions :(\n" + err.Error(), err
		}

		content := fmt.Sprintf("**Would you rather** (*<http://either.io>*)\n🇦 %s\n **OR**\n🇧 %s", q1, q2)
		msg, err := common.BotSession.ChannelMessageSend(data.Msg.ChannelID, content)
		if err != nil {
			return "Seomthing went wrong", err
		}

		common.BotSession.MessageReactionAdd(data.Msg.ChannelID, msg.ID, "🇦")
		err = common.BotSession.MessageReactionAdd(data.Msg.ChannelID, msg.ID, "🇧")
		if err != nil {
			_, dError := common.DiscordError(err)
			return "Failed adding reaction\n" + dError, err
		}

		return "", 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