Files
acecore/cmd_ask.go

31 lines
842 B
Go

package main
import (
"github.com/disgoorg/disgo/discord"
"github.com/disgoorg/disgo/events"
"github.com/sirupsen/logrus"
)
var cmd_ask = Command{
Definition: discord.SlashCommandCreate{
Name: "ask",
Description: "Ask anything and get a gif as response!",
Options: []discord.ApplicationCommandOption{
&discord.ApplicationCommandOptionString{
Name: "question",
Description: "The question you want to ask",
Required: true,
},
},
},
Interact: func(e *events.ApplicationCommandInteractionCreate) {
err := e.CreateMessage(discord.NewMessageCreateBuilder().
AddEmbeds(discord.NewEmbedBuilder().SetImage(simpleGetFromAPI("image", "https://yesno.wtf/api").(string)).SetColor(hexToDecimal(color["primary"])).Build()).
Build())
if err != nil {
logrus.Error(err)
}
},
AllowDM: true,
}