mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-03-23 18:39:35 +00:00
Discord: optimize struct sizes; add missing fields
This commit is contained in:
parent
a616eae7f0
commit
fc5d10ced8
|
@ -26,7 +26,7 @@ type AuditLogEntry struct {
|
||||||
// ID is the id of the entry.
|
// ID is the id of the entry.
|
||||||
ID AuditLogEntryID `json:"id"`
|
ID AuditLogEntryID `json:"id"`
|
||||||
// TargetID is the id of the affected entity (webhook, user, role, etc.).
|
// TargetID is the id of the affected entity (webhook, user, role, etc.).
|
||||||
TargetID string `json:"target_id,omitempty"`
|
TargetID Snowflake `json:"target_id"`
|
||||||
// Changes are the changes made to the TargetID.
|
// Changes are the changes made to the TargetID.
|
||||||
Changes []AuditLogChange `json:"changes,omitempty"`
|
Changes []AuditLogChange `json:"changes,omitempty"`
|
||||||
// UserID is the id of the user who made the changes.
|
// UserID is the id of the user who made the changes.
|
||||||
|
|
|
@ -8,11 +8,14 @@ import (
|
||||||
// https://discord.com/developers/docs/resources/channel#channel-object
|
// https://discord.com/developers/docs/resources/channel#channel-object
|
||||||
type Channel struct {
|
type Channel struct {
|
||||||
// ID is the id of this channel.
|
// ID is the id of this channel.
|
||||||
ID ChannelID `json:"id,string"`
|
ID ChannelID `json:"id"`
|
||||||
|
// GuildID is the id of the guild.
|
||||||
|
GuildID GuildID `json:"guild_id,omitempty"`
|
||||||
|
|
||||||
// Type is the type of channel.
|
// Type is the type of channel.
|
||||||
Type ChannelType `json:"type,omitempty"`
|
Type ChannelType `json:"type,omitempty"`
|
||||||
// GuildID is the id of the guild.
|
// NSFW specifies whether the channel is nsfw.
|
||||||
GuildID GuildID `json:"guild_id,string,omitempty"`
|
NSFW bool `json:"nsfw,omitempty"`
|
||||||
|
|
||||||
// Position is the sorting position of the channel.
|
// Position is the sorting position of the channel.
|
||||||
Position int `json:"position,omitempty"`
|
Position int `json:"position,omitempty"`
|
||||||
|
@ -23,12 +26,10 @@ type Channel struct {
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
// Topic is the channel topic (0-1024 characters).
|
// Topic is the channel topic (0-1024 characters).
|
||||||
Topic string `json:"topic,omitempty"`
|
Topic string `json:"topic,omitempty"`
|
||||||
// NSFW specifies whether the channel is nsfw.
|
|
||||||
NSFW bool `json:"nsfw,omitempty"`
|
|
||||||
|
|
||||||
// LastMessageID is the id of the last message sent in this channel (may
|
// LastMessageID is the id of the last message sent in this channel (may
|
||||||
// not point to an existing or valid message).
|
// not point to an existing or valid message).
|
||||||
LastMessageID MessageID `json:"last_message_id,string,omitempty"`
|
LastMessageID MessageID `json:"last_message_id,omitempty"`
|
||||||
|
|
||||||
// VoiceBitrate is the bitrate (in bits) of the voice channel.
|
// VoiceBitrate is the bitrate (in bits) of the voice channel.
|
||||||
VoiceBitrate uint `json:"bitrate,omitempty"`
|
VoiceBitrate uint `json:"bitrate,omitempty"`
|
||||||
|
@ -45,15 +46,15 @@ type Channel struct {
|
||||||
// Icon is the icon hash.
|
// Icon is the icon hash.
|
||||||
Icon Hash `json:"icon,omitempty"`
|
Icon Hash `json:"icon,omitempty"`
|
||||||
// DMOwnerID is the id of the DM creator.
|
// DMOwnerID is the id of the DM creator.
|
||||||
DMOwnerID UserID `json:"owner_id,string,omitempty"`
|
DMOwnerID UserID `json:"owner_id,omitempty"`
|
||||||
|
|
||||||
// AppID is the application id of the group DM creator if it is
|
// AppID is the application id of the group DM creator if it is
|
||||||
// bot-created.
|
// bot-created.
|
||||||
AppID AppID `json:"application_id,string,omitempty"`
|
AppID AppID `json:"application_id,omitempty"`
|
||||||
|
|
||||||
// CategoryID is the id of the parent category for a channel (each parent
|
// CategoryID is the id of the parent category for a channel (each parent
|
||||||
// category can contain up to 50 channels).
|
// category can contain up to 50 channels).
|
||||||
CategoryID ChannelID `json:"parent_id,string,omitempty"`
|
CategoryID ChannelID `json:"parent_id,omitempty"`
|
||||||
// LastPinTime is when the last pinned message was pinned.
|
// LastPinTime is when the last pinned message was pinned.
|
||||||
LastPinTime Timestamp `json:"last_pin_timestamp,omitempty"`
|
LastPinTime Timestamp `json:"last_pin_timestamp,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
package discord
|
package discord
|
||||||
|
|
||||||
// HasFlag is returns true if has is in the flag. In other words, it checks if
|
// HasFlag is returns true if has is in the flag. In other words, it checks if
|
||||||
// has is OR'd into flag. This function could be used for different constants
|
// has is OR'ed into flag. This function could be used for different constants
|
||||||
// such as Permission.
|
// such as Permission.
|
||||||
func HasFlag(flag, has uint64) bool {
|
func HasFlag(flag, has uint64) bool {
|
||||||
return flag&has == has
|
return flag&has == has
|
||||||
|
|
|
@ -2,18 +2,40 @@ package discord
|
||||||
|
|
||||||
import "strings"
|
import "strings"
|
||||||
|
|
||||||
|
// https://discord.com/developers/docs/resources/emoji#emoji-object
|
||||||
type Emoji struct {
|
type Emoji struct {
|
||||||
ID EmojiID `json:"id,string"` // NullSnowflake for unicode emojis
|
// ID is the ID of the Emoji.
|
||||||
Name string `json:"name"`
|
// The ID will be NullSnowflake, if the Emoji is a Unicode emoji.
|
||||||
|
ID EmojiID `json:"id"`
|
||||||
// These fields are optional
|
// Name is the name of the emoji.
|
||||||
|
Name string `json:"name"`
|
||||||
|
|
||||||
|
// RoleIDs are the roles the emoji is whitelisted to.
|
||||||
|
//
|
||||||
|
// This field is only available for custom emojis.
|
||||||
RoleIDs []RoleID `json:"roles,omitempty"`
|
RoleIDs []RoleID `json:"roles,omitempty"`
|
||||||
User User `json:"user,omitempty"`
|
// User is the user that created the emoji.
|
||||||
|
//
|
||||||
|
// This field is only available for custom emojis.
|
||||||
|
User User `json:"user,omitempty"`
|
||||||
|
|
||||||
|
// RequireColons specifies whether the emoji must be wrapped in colons.
|
||||||
|
//
|
||||||
|
// This field is only available for custom emojis.
|
||||||
RequireColons bool `json:"require_colons,omitempty"`
|
RequireColons bool `json:"require_colons,omitempty"`
|
||||||
Managed bool `json:"managed,omitempty"`
|
// Managed specifies whether the emoji is managed.
|
||||||
Animated bool `json:"animated,omitempty"`
|
//
|
||||||
|
// This field is only available for custom emojis.
|
||||||
|
Managed bool `json:"managed,omitempty"`
|
||||||
|
// Animated specifies whether the emoji is animated.
|
||||||
|
//
|
||||||
|
// This field is only available for custom emojis.
|
||||||
|
Animated bool `json:"animated,omitempty"`
|
||||||
|
// Available specifies whether the emoji can be used.
|
||||||
|
// This may be false tue to loss of Server Boosts.
|
||||||
|
//
|
||||||
|
// This field is only available for custom emojis.
|
||||||
|
Available bool `json:"available,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EmojiURL returns the URL of the emoji and auto-detects a suitable type.
|
// EmojiURL returns the URL of the emoji and auto-detects a suitable type.
|
||||||
|
|
|
@ -3,7 +3,7 @@ package discord
|
||||||
// https://discord.com/developers/docs/resources/guild#guild-object
|
// https://discord.com/developers/docs/resources/guild#guild-object
|
||||||
type Guild struct {
|
type Guild struct {
|
||||||
// ID is the guild id.
|
// ID is the guild id.
|
||||||
ID GuildID `json:"id,string"`
|
ID GuildID `json:"id"`
|
||||||
// Name is the guild name (2-100 characters, excluding trailing and leading
|
// Name is the guild name (2-100 characters, excluding trailing and leading
|
||||||
// whitespace).
|
// whitespace).
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
@ -18,27 +18,42 @@ type Guild struct {
|
||||||
|
|
||||||
// Owner is true if the user is the owner of the guild.
|
// Owner is true if the user is the owner of the guild.
|
||||||
Owner bool `json:"owner,omitempty"`
|
Owner bool `json:"owner,omitempty"`
|
||||||
// OwnerID is the id of owner.
|
// Widget is true if the server widget is enabled.
|
||||||
OwnerID UserID `json:"owner_id,string"`
|
Widget bool `json:"widget_enabled,omitempty"`
|
||||||
|
|
||||||
// Permissions are the total permissions for the user in the guild
|
|
||||||
// (excludes overrides).
|
|
||||||
Permissions Permissions `json:"permissions,string,omitempty"`
|
|
||||||
|
|
||||||
// VoiceRegion is the voice region id for the guild.
|
|
||||||
VoiceRegion string `json:"region"`
|
|
||||||
|
|
||||||
// AFKChannelID is the id of the afk channel.
|
|
||||||
AFKChannelID ChannelID `json:"afk_channel_id,string,omitempty"`
|
|
||||||
// AFKTimeout is the afk timeout in seconds.
|
|
||||||
AFKTimeout Seconds `json:"afk_timeout"`
|
|
||||||
|
|
||||||
|
// SystemChannelFlags are the system channel flags.
|
||||||
|
SystemChannelFlags SystemChannelFlags `json:"system_channel_flags"`
|
||||||
// Verification is the verification level required for the guild.
|
// Verification is the verification level required for the guild.
|
||||||
Verification Verification `json:"verification_level"`
|
Verification Verification `json:"verification_level"`
|
||||||
// Notification is the default message notifications level.
|
// Notification is the default message notifications level.
|
||||||
Notification Notification `json:"default_message_notifications"`
|
Notification Notification `json:"default_message_notifications"`
|
||||||
// ExplicitFilter is the explicit content filter level.
|
// ExplicitFilter is the explicit content filter level.
|
||||||
ExplicitFilter ExplicitFilter `json:"explicit_content_filter"`
|
ExplicitFilter ExplicitFilter `json:"explicit_content_filter"`
|
||||||
|
// NitroBoost is the premium tier (Server Boost level).
|
||||||
|
NitroBoost NitroBoost `json:"premium_tier"`
|
||||||
|
// MFA is the required MFA level for the guild.
|
||||||
|
MFA MFALevel `json:"mfa"`
|
||||||
|
|
||||||
|
// OwnerID is the id of owner.
|
||||||
|
OwnerID UserID `json:"owner_id"`
|
||||||
|
// WidgetChannelID is the channel id that the widget will generate an
|
||||||
|
// invite to, or null if set to no invite.
|
||||||
|
WidgetChannelID ChannelID `json:"widget_channel_id,omitempty"`
|
||||||
|
// SystemChannelID is the the id of the channel where guild notices such as
|
||||||
|
// welcome messages and boost events are posted.
|
||||||
|
SystemChannelID ChannelID `json:"system_channel_id,omitempty"`
|
||||||
|
|
||||||
|
// Permissions are the total permissions for the user in the guild
|
||||||
|
// (excludes overrides).
|
||||||
|
Permissions Permissions `json:"permissions,omitempty"`
|
||||||
|
|
||||||
|
// VoiceRegion is the voice region id for the guild.
|
||||||
|
VoiceRegion string `json:"region"`
|
||||||
|
|
||||||
|
// AFKChannelID is the id of the afk channel.
|
||||||
|
AFKChannelID ChannelID `json:"afk_channel_id,omitempty"`
|
||||||
|
// AFKTimeout is the afk timeout in seconds.
|
||||||
|
AFKTimeout Seconds `json:"afk_timeout"`
|
||||||
|
|
||||||
// Roles are the roles in the guild.
|
// Roles are the roles in the guild.
|
||||||
Roles []Role `json:"roles"`
|
Roles []Role `json:"roles"`
|
||||||
|
@ -47,25 +62,10 @@ type Guild struct {
|
||||||
// Features are the enabled guild features.
|
// Features are the enabled guild features.
|
||||||
Features []GuildFeature `json:"guild_features"`
|
Features []GuildFeature `json:"guild_features"`
|
||||||
|
|
||||||
// MFA is the required MFA level for the guild.
|
|
||||||
MFA MFALevel `json:"mfa"`
|
|
||||||
|
|
||||||
// AppID is the application id of the guild creator if it is bot-created.
|
// AppID is the application id of the guild creator if it is bot-created.
|
||||||
//
|
//
|
||||||
// This field is nullable.
|
// This field is nullable.
|
||||||
AppID AppID `json:"application_id,string,omitempty"`
|
AppID AppID `json:"application_id,omitempty"`
|
||||||
|
|
||||||
// Widget is true if the server widget is enabled.
|
|
||||||
Widget bool `json:"widget_enabled,omitempty"`
|
|
||||||
// WidgetChannelID is the channel id that the widget will generate an
|
|
||||||
// invite to, or null if set to no invite.
|
|
||||||
WidgetChannelID ChannelID `json:"widget_channel_id,string,omitempty"`
|
|
||||||
|
|
||||||
// SystemChannelID is the the id of the channel where guild notices such as
|
|
||||||
// welcome messages and boost events are posted.
|
|
||||||
SystemChannelID ChannelID `json:"system_channel_id,string,omitempty"`
|
|
||||||
// SystemChannelFlags are the system channel flags.
|
|
||||||
SystemChannelFlags SystemChannelFlags `json:"system_channel_flags"`
|
|
||||||
|
|
||||||
// RulesChannelID is the id of the channel where guilds with the "PUBLIC"
|
// RulesChannelID is the id of the channel where guilds with the "PUBLIC"
|
||||||
// feature can display rules and/or guidelines.
|
// feature can display rules and/or guidelines.
|
||||||
|
@ -87,8 +87,6 @@ type Guild struct {
|
||||||
// Banner is the banner hash.
|
// Banner is the banner hash.
|
||||||
Banner Hash `json:"banner,omitempty"`
|
Banner Hash `json:"banner,omitempty"`
|
||||||
|
|
||||||
// NitroBoost is the premium tier (Server Boost level).
|
|
||||||
NitroBoost NitroBoost `json:"premium_tier"`
|
|
||||||
// NitroBoosters is the number of boosts this guild currently has.
|
// NitroBoosters is the number of boosts this guild currently has.
|
||||||
NitroBoosters uint64 `json:"premium_subscription_count,omitempty"`
|
NitroBoosters uint64 `json:"premium_subscription_count,omitempty"`
|
||||||
|
|
||||||
|
@ -276,20 +274,20 @@ func (g GuildPreview) DiscoverySplashURLWithType(t ImageType) string {
|
||||||
// https://discord.com/developers/docs/topics/permissions#role-object
|
// https://discord.com/developers/docs/topics/permissions#role-object
|
||||||
type Role struct {
|
type Role struct {
|
||||||
// ID is the role id.
|
// ID is the role id.
|
||||||
ID RoleID `json:"id,string"`
|
ID RoleID `json:"id"`
|
||||||
// Name is the role name.
|
// Name is the role name.
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
|
||||||
// Color is the integer representation of hexadecimal color code.
|
// Permissions is the permission bit set.
|
||||||
Color Color `json:"color"`
|
Permissions Permissions `json:"permissions"`
|
||||||
// Hoist specifies if this role is pinned in the user listing.
|
|
||||||
Hoist bool `json:"hoist"`
|
|
||||||
// Position is the position of this role.
|
// Position is the position of this role.
|
||||||
Position int `json:"position"`
|
Position int `json:"position"`
|
||||||
|
// Color is the integer representation of hexadecimal color code.
|
||||||
|
Color Color `json:"color"`
|
||||||
|
|
||||||
// Permissions is the permission bit set.
|
// Hoist specifies if this role is pinned in the user listing.
|
||||||
Permissions Permissions `json:"permissions,string"`
|
Hoist bool `json:"hoist"`
|
||||||
|
|
||||||
// Manages specifies whether this role is managed by an integration.
|
// Manages specifies whether this role is managed by an integration.
|
||||||
Managed bool `json:"managed"`
|
Managed bool `json:"managed"`
|
||||||
// Mentionable specifies whether this role is mentionable.
|
// Mentionable specifies whether this role is mentionable.
|
||||||
|
|
|
@ -11,13 +11,42 @@ import (
|
||||||
// https://discord.com/developers/docs/resources/channel#message-object
|
// https://discord.com/developers/docs/resources/channel#message-object
|
||||||
type Message struct {
|
type Message struct {
|
||||||
// ID is the id of the message.
|
// ID is the id of the message.
|
||||||
ID MessageID `json:"id,string"`
|
ID MessageID `json:"id"`
|
||||||
|
// ChannelID is the id of the channel the message was sent in.
|
||||||
|
ChannelID ChannelID `json:"channel_id"`
|
||||||
|
// GuildID is the id of the guild the message was sent in.
|
||||||
|
GuildID GuildID `json:"guild_id,omitempty"`
|
||||||
|
|
||||||
// Type is the type of message.
|
// Type is the type of message.
|
||||||
Type MessageType `json:"type"`
|
Type MessageType `json:"type"`
|
||||||
// ChannelID is the id of the channel the message was sent in.
|
|
||||||
ChannelID ChannelID `json:"channel_id,string"`
|
// Flags are the MessageFlags.
|
||||||
// GuildID is the id of the guild the message was sent in.
|
Flags MessageFlags `json:"flags"`
|
||||||
GuildID GuildID `json:"guild_id,string,omitempty"`
|
|
||||||
|
// TTS specifies whether the was a TTS message.
|
||||||
|
TTS bool `json:"tts"`
|
||||||
|
// Pinned specifies whether the message is pinned.
|
||||||
|
Pinned bool `json:"pinned"`
|
||||||
|
|
||||||
|
// MentionEveryone specifies whether the message mentions everyone.
|
||||||
|
MentionEveryone bool `json:"mention_everyone"`
|
||||||
|
// Mentions contains the users specifically mentioned in the message.
|
||||||
|
//
|
||||||
|
// The user objects in the mentions array will only have the partial
|
||||||
|
// member field present in MESSAGE_CREATE and MESSAGE_UPDATE events from
|
||||||
|
// text-based guild channels.
|
||||||
|
Mentions []GuildUser `json:"mentions"`
|
||||||
|
// MentionRoleIDs contains the ids of the roles specifically mentioned in
|
||||||
|
// the message.
|
||||||
|
MentionRoleIDs []RoleID `json:"mention_roles"`
|
||||||
|
// MentionChannels are the channels specifically mentioned in the message.
|
||||||
|
//
|
||||||
|
// Not all channel mentions in a message will appear in mention_channels.
|
||||||
|
// Only textual channels that are visible to everyone in a lurkable guild
|
||||||
|
// will ever be included. Only crossposted messages (via Channel Following)
|
||||||
|
// currently include mention_channels at all. If no mentions in the message
|
||||||
|
// meet these requirements, the slice will be empty.
|
||||||
|
MentionChannels []ChannelMention `json:"mention_channels,omitempty"`
|
||||||
|
|
||||||
// Author is the author of the message.
|
// Author is the author of the message.
|
||||||
//
|
//
|
||||||
|
@ -39,32 +68,6 @@ type Message struct {
|
||||||
// IsValid() will return false, if the messages hasn't been edited.
|
// IsValid() will return false, if the messages hasn't been edited.
|
||||||
EditedTimestamp Timestamp `json:"edited_timestamp,omitempty"`
|
EditedTimestamp Timestamp `json:"edited_timestamp,omitempty"`
|
||||||
|
|
||||||
// TTS specifies whether the was a TTS message.
|
|
||||||
TTS bool `json:"tts"`
|
|
||||||
// Pinned specifies whether the message is pinned.
|
|
||||||
Pinned bool `json:"pinned"`
|
|
||||||
|
|
||||||
// Mentions contains the users specifically mentioned in the message.
|
|
||||||
//
|
|
||||||
// The user objects in the mentions array will only have the partial
|
|
||||||
// member field present in MESSAGE_CREATE and MESSAGE_UPDATE events from
|
|
||||||
// text-based guild channels.
|
|
||||||
Mentions []GuildUser `json:"mentions"`
|
|
||||||
// MentionEveryone specifies whether the message mentions everyone.
|
|
||||||
MentionEveryone bool `json:"mention_everyone"`
|
|
||||||
|
|
||||||
// MentionRoleIDs contains the ids of the roles specifically mentioned in
|
|
||||||
// the message.
|
|
||||||
MentionRoleIDs []RoleID `json:"mention_roles"`
|
|
||||||
// MentionChannels are the channels specifically mentioned in the message.
|
|
||||||
//
|
|
||||||
// Not all channel mentions in a message will appear in mention_channels.
|
|
||||||
// Only textual channels that are visible to everyone in a lurkable guild
|
|
||||||
// will ever be included. Only crossposted messages (via Channel Following)
|
|
||||||
// currently include mention_channels at all. If no mentions in the message
|
|
||||||
// meet these requirements, the slice will be empty.
|
|
||||||
MentionChannels []ChannelMention `json:"mention_channels,omitempty"`
|
|
||||||
|
|
||||||
// Attachments contains any attached files.
|
// Attachments contains any attached files.
|
||||||
Attachments []Attachment `json:"attachments"`
|
Attachments []Attachment `json:"attachments"`
|
||||||
// Embeds contains any embedded content.
|
// Embeds contains any embedded content.
|
||||||
|
@ -77,7 +80,7 @@ type Message struct {
|
||||||
|
|
||||||
// WebhookID contains the ID of the webhook, if the message was generated
|
// WebhookID contains the ID of the webhook, if the message was generated
|
||||||
// by a webhook.
|
// by a webhook.
|
||||||
WebhookID WebhookID `json:"webhook_id,string,omitempty"`
|
WebhookID WebhookID `json:"webhook_id,omitempty"`
|
||||||
|
|
||||||
// Activity is sent with Rich Presence-related chat embeds.
|
// Activity is sent with Rich Presence-related chat embeds.
|
||||||
Activity *MessageActivity `json:"activity,omitempty"`
|
Activity *MessageActivity `json:"activity,omitempty"`
|
||||||
|
@ -93,8 +96,6 @@ type Message struct {
|
||||||
// non-null, it is a message object
|
// non-null, it is a message object
|
||||||
ReferencedMessage *Message `json:"referenced_message,omitempty"`
|
ReferencedMessage *Message `json:"referenced_message,omitempty"`
|
||||||
|
|
||||||
// Flags are the MessageFlags.
|
|
||||||
Flags MessageFlags `json:"flags"`
|
|
||||||
// Stickers contains the sticker sent with the message.
|
// Stickers contains the sticker sent with the message.
|
||||||
Stickers []Sticker `json:"stickers,omitempty"`
|
Stickers []Sticker `json:"stickers,omitempty"`
|
||||||
}
|
}
|
||||||
|
@ -321,7 +322,7 @@ type MessageReference struct {
|
||||||
// https://discord.com/developers/docs/resources/channel#attachment-object
|
// https://discord.com/developers/docs/resources/channel#attachment-object
|
||||||
type Attachment struct {
|
type Attachment struct {
|
||||||
// ID is the attachment id.
|
// ID is the attachment id.
|
||||||
ID AttachmentID `json:"id,string"`
|
ID AttachmentID `json:"id"`
|
||||||
// Filename is the name of file attached.
|
// Filename is the name of file attached.
|
||||||
Filename string `json:"filename"`
|
Filename string `json:"filename"`
|
||||||
// Size is the size of file in bytes.
|
// Size is the size of file in bytes.
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type User struct {
|
type User struct {
|
||||||
ID UserID `json:"id,string"`
|
ID UserID `json:"id"`
|
||||||
Username string `json:"username"`
|
Username string `json:"username"`
|
||||||
Discriminator string `json:"discriminator"`
|
Discriminator string `json:"discriminator"`
|
||||||
Avatar Hash `json:"avatar"`
|
Avatar Hash `json:"avatar"`
|
||||||
|
@ -15,15 +15,15 @@ type User struct {
|
||||||
Bot bool `json:"bot,omitempty"`
|
Bot bool `json:"bot,omitempty"`
|
||||||
MFA bool `json:"mfa_enabled,omitempty"`
|
MFA bool `json:"mfa_enabled,omitempty"`
|
||||||
|
|
||||||
|
Nitro UserNitro `json:"premium_type,omitempty"`
|
||||||
|
Flags UserFlags `json:"flags,omitempty"`
|
||||||
|
PublicFlags UserFlags `json:"public_flags,omitempty"`
|
||||||
|
|
||||||
DiscordSystem bool `json:"system,omitempty"`
|
DiscordSystem bool `json:"system,omitempty"`
|
||||||
EmailVerified bool `json:"verified,omitempty"`
|
EmailVerified bool `json:"verified,omitempty"`
|
||||||
|
|
||||||
Locale string `json:"locale,omitempty"`
|
Locale string `json:"locale,omitempty"`
|
||||||
Email string `json:"email,omitempty"`
|
Email string `json:"email,omitempty"`
|
||||||
|
|
||||||
Flags UserFlags `json:"flags,omitempty"`
|
|
||||||
PublicFlags UserFlags `json:"public_flags,omitempty"`
|
|
||||||
Nitro UserNitro `json:"premium_type,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u User) Mention() string {
|
func (u User) Mention() string {
|
||||||
|
@ -127,12 +127,16 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Activity struct {
|
type Activity struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
URL URL `json:"url,omitempty"`
|
||||||
|
|
||||||
Type ActivityType `json:"type"`
|
Type ActivityType `json:"type"`
|
||||||
URL URL `json:"url,omitempty"`
|
|
||||||
|
|
||||||
// User only
|
// User only
|
||||||
|
|
||||||
|
Instance bool `json:"instance,omitempty"`
|
||||||
|
Flags ActivityFlags `json:"flags,omitempty"`
|
||||||
|
|
||||||
CreatedAt UnixTimestamp `json:"created_at,omitempty"`
|
CreatedAt UnixTimestamp `json:"created_at,omitempty"`
|
||||||
Timestamps *ActivityTimestamp `json:"timestamps,omitempty"`
|
Timestamps *ActivityTimestamp `json:"timestamps,omitempty"`
|
||||||
|
|
||||||
|
@ -145,9 +149,6 @@ type Activity struct {
|
||||||
Assets *ActivityAssets `json:"assets,omitempty"`
|
Assets *ActivityAssets `json:"assets,omitempty"`
|
||||||
Secrets *ActivitySecrets `json:"secrets,omitempty"`
|
Secrets *ActivitySecrets `json:"secrets,omitempty"`
|
||||||
|
|
||||||
Instance bool `json:"instance,omitempty"`
|
|
||||||
Flags ActivityFlags `json:"flags,omitempty"`
|
|
||||||
|
|
||||||
// Undocumented fields
|
// Undocumented fields
|
||||||
SyncID string `json:"sync_id,omitempty"`
|
SyncID string `json:"sync_id,omitempty"`
|
||||||
SessionID string `json:"session_id,omitempty"`
|
SessionID string `json:"session_id,omitempty"`
|
||||||
|
|
|
@ -2,10 +2,10 @@ package discord
|
||||||
|
|
||||||
type VoiceState struct {
|
type VoiceState struct {
|
||||||
// GuildID isn't available from the Guild struct.
|
// GuildID isn't available from the Guild struct.
|
||||||
GuildID GuildID `json:"guild_id,string"`
|
GuildID GuildID `json:"guild_id"`
|
||||||
|
|
||||||
ChannelID ChannelID `json:"channel_id,string"`
|
ChannelID ChannelID `json:"channel_id"`
|
||||||
UserID UserID `json:"user_id,string"`
|
UserID UserID `json:"user_id"`
|
||||||
Member *Member `json:"member,omitempty"`
|
Member *Member `json:"member,omitempty"`
|
||||||
SessionID string `json:"session_id"`
|
SessionID string `json:"session_id"`
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue