slash roleypoly yay
This commit is contained in:
parent
02f5075d3b
commit
607d7e121c
22 changed files with 394 additions and 66 deletions
52
interactions/cmd_roleypoly.go
Normal file
52
interactions/cmd_roleypoly.go
Normal file
|
@ -0,0 +1,52 @@
|
|||
package interactions
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
|
||||
"git.sapphic.engineer/roleypoly/v4/utils"
|
||||
)
|
||||
|
||||
func (i *Interactions) CmdRoleypoly(ix Interaction) (InteractionResponse, error) {
|
||||
mentions := i.CommandsMap()
|
||||
hostname := "roleypoly.com"
|
||||
publicURL, _ := url.Parse(i.PublicBaseURL)
|
||||
if publicURL != nil {
|
||||
hostname = publicURL.Host
|
||||
}
|
||||
|
||||
return InteractionResponse{
|
||||
Type: ResponseChannelMessage,
|
||||
Data: InteractionResponseData{
|
||||
Flags: FlagEphemeral,
|
||||
Embeds: []Embed{{
|
||||
Color: utils.EmbedColor,
|
||||
Title: fmt.Sprintf(":beginner: Hey there, %s", ix.GetName()),
|
||||
Description: "Try these slash commands, or pick roles from a browser!",
|
||||
Fields: []EmbedField{
|
||||
{
|
||||
Name: "See all the roles",
|
||||
Value: utils.Or(mentions["pickable-roles"], "/pickable-roles"),
|
||||
},
|
||||
{
|
||||
Name: "Pick a role",
|
||||
Value: utils.Or(mentions["pick-role"], "/pick-role"),
|
||||
},
|
||||
{
|
||||
Name: "Remove a role",
|
||||
Value: utils.Or(mentions["remove-role"], "/remove-role"),
|
||||
},
|
||||
},
|
||||
}},
|
||||
Components: []ButtonComponent{
|
||||
{
|
||||
Type: 2, // Button
|
||||
Style: 5, // Link
|
||||
Label: fmt.Sprintf("Pick roles on %s", hostname),
|
||||
Emoji: utils.GetRandomEmoji(),
|
||||
URL: fmt.Sprintf("%s/s/%s", i.PublicBaseURL, ix.GuildID),
|
||||
},
|
||||
},
|
||||
},
|
||||
}, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue