slash roleypoly yay

This commit is contained in:
41666 2025-03-26 16:36:00 -07:00
parent 02f5075d3b
commit 607d7e121c
22 changed files with 394 additions and 66 deletions

View file

@ -12,6 +12,18 @@ type Interaction struct {
Token string `json:"token"`
}
func (ix Interaction) GetName() string {
if ix.Member.Nick != "" {
return ix.Member.Nick
}
if ix.Member.User.GlobalName != "" {
return ix.Member.User.GlobalName
}
return ix.Member.User.Username
}
const (
TypePing uint64 = 1
TypeApplicationCommand uint64 = 2
@ -43,9 +55,59 @@ const (
)
type InteractionResponseData struct {
Content string
Embeds []Embed
Flags int
Content string `json:"content,omitempty"`
Components []ButtonComponent `json:"components,omitempty"`
Embeds []Embed `json:"embeds,omitempty"`
Flags int `json:"flags,omitempty"`
}
type Embed struct{}
type ButtonComponent struct {
Type int `json:"type,omitempty"`
Style int `json:"style,omitempty"`
Label string `json:"label,omitempty"`
Emoji types.Emoji `json:"emoji,omitempty"`
URL string `json:"url,omitempty"`
}
type InteractionCommand struct {
ID string `json:"id"`
Type int `json:"type"`
GuildID string `json:"guild_id,omitempty"`
Name string `json:"name"`
Description string `json:"description"`
Options InteractionCommandOption `json:"options"`
ChannelTypes []int `json:"channel_types,omitempty"`
}
type InteractionCommandOption struct {
Type int `json:"type"`
Name string `json:"name"`
Required bool `json:"required,omitempty"`
}
type Embed struct {
Author EmbedAuthor `json:"author"`
Color uint32 `json:"color"`
Description string `json:"description,omitempty"`
Fields []EmbedField `json:"fields"`
Footer EmbedFooter `json:"footer"`
Timestamp string `json:"timestamp,omitempty"`
Title string `json:"title"`
}
type EmbedField struct {
Name string `json:"name"`
Value string `json:"value"`
Inline bool `json:"inline,omitempty"`
}
type EmbedFooter struct {
Text string `json:"text"`
IconURL string `json:"icon_url,omitempty"`
ProxyIconURL string `json:"proxy_icon_url,omitempty"`
}
type EmbedAuthor struct {
Name string `json:"name"`
IconURL string `json:"icon_url"`
}