Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IconURL for GuildPreview and GuildWithCounts #885

Merged
merged 27 commits into from Mar 31, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions interactions.go
Expand Up @@ -74,10 +74,24 @@ type Interaction struct {
GuildID string `json:"guild_id"`
ChannelID string `json:"channel_id"`
Member *Member `json:"member"`
User *User `json:"user"`
Token string `json:"token"`
Version int `json:"version"`
}

// IsInGuild is a utility function for checking if the interaction is sent in a guild or in a direct message
func (i Interaction) IsInGuild() bool {
Jleagle marked this conversation as resolved.
Show resolved Hide resolved
return i.Member != nil
}

// GetUser is a utility function for getting the User struct
Jleagle marked this conversation as resolved.
Show resolved Hide resolved
func (i Interaction) GetUser() *User {
if i.Member != nil {
return i.Member.User
}
Jleagle marked this conversation as resolved.
Show resolved Hide resolved
return i.User
}

// ApplicationCommandInteractionData contains data received in an interaction event.
type ApplicationCommandInteractionData struct {
ID string `json:"id"`
Expand Down