From 6bec03fa19056a1849c5960741626bcb2708b7c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20=C3=98en=20Fylling?= Date: Sat, 23 Jan 2021 13:49:29 +0100 Subject: [PATCH] go generate --- iface_copier_gen.go | 874 ++++++++++++++++++++-------------------- iface_deepcopier_gen.go | 206 +++++----- iface_reseter_gen.go | 264 ++++++------ 3 files changed, 672 insertions(+), 672 deletions(-) diff --git a/iface_copier_gen.go b/iface_copier_gen.go index 4726964a..cf181883 100644 --- a/iface_copier_gen.go +++ b/iface_copier_gen.go @@ -2,70 +2,90 @@ package disgord -func (v *VoiceRegion) copyOverTo(other interface{}) error { - var dest *VoiceRegion +func (r *Reaction) copyOverTo(other interface{}) error { + var dest *Reaction var valid bool - if dest, valid = other.(*VoiceRegion); !valid { - return newErrorUnsupportedType("argument given is not a *VoiceRegion type") + if dest, valid = other.(*Reaction); !valid { + return newErrorUnsupportedType("argument given is not a *Reaction type") } - dest.ID = v.ID - dest.Name = v.Name - dest.SampleHostname = v.SampleHostname - dest.SamplePort = v.SamplePort - dest.VIP = v.VIP - dest.Optimal = v.Optimal - dest.Deprecated = v.Deprecated - dest.Custom = v.Custom + dest.Count = r.Count + dest.Me = r.Me + dest.Emoji = r.Emoji return nil } -func (e *EmbedProvider) copyOverTo(other interface{}) error { - var dest *EmbedProvider +func (u *UserConnection) copyOverTo(other interface{}) error { + var dest *UserConnection var valid bool - if dest, valid = other.(*EmbedProvider); !valid { - return newErrorUnsupportedType("argument given is not a *EmbedProvider type") + if dest, valid = other.(*UserConnection); !valid { + return newErrorUnsupportedType("argument given is not a *UserConnection type") } - dest.Name = e.Name - dest.URL = e.URL - - return nil -} - -func (e *EmbedVideo) copyOverTo(other interface{}) error { - var dest *EmbedVideo - var valid bool - if dest, valid = other.(*EmbedVideo); !valid { - return newErrorUnsupportedType("argument given is not a *EmbedVideo type") + dest.ID = u.ID + dest.Name = u.Name + dest.Type = u.Type + dest.Revoked = u.Revoked + dest.Integrations = make([]*IntegrationAccount, len(u.Integrations)) + for i := 0; i < len(u.Integrations); i++ { + dest.Integrations[i] = DeepCopy(u.Integrations[i]).(*IntegrationAccount) } - dest.URL = e.URL - dest.Height = e.Height - dest.Width = e.Width return nil } -func (e *Embed) copyOverTo(other interface{}) error { - var dest *Embed +func (g *Guild) copyOverTo(other interface{}) error { + var dest *Guild var valid bool - if dest, valid = other.(*Embed); !valid { - return newErrorUnsupportedType("argument given is not a *Embed type") + if dest, valid = other.(*Guild); !valid { + return newErrorUnsupportedType("argument given is not a *Guild type") } - dest.Title = e.Title - dest.Type = e.Type - dest.Description = e.Description - dest.URL = e.URL - dest.Timestamp = e.Timestamp - dest.Color = e.Color - dest.Footer = e.Footer - dest.Image = e.Image - dest.Thumbnail = e.Thumbnail - dest.Video = e.Video - dest.Provider = e.Provider - dest.Author = e.Author - dest.Fields = make([]*EmbedField, len(e.Fields)) - for i := 0; i < len(e.Fields); i++ { - dest.Fields[i] = DeepCopy(e.Fields[i]).(*EmbedField) + dest.ID = g.ID + dest.ApplicationID = g.ApplicationID + dest.Name = g.Name + dest.Icon = g.Icon + dest.Splash = g.Splash + dest.Owner = g.Owner + dest.OwnerID = g.OwnerID + dest.Permissions = g.Permissions + dest.Region = g.Region + dest.AfkChannelID = g.AfkChannelID + dest.AfkTimeout = g.AfkTimeout + dest.VerificationLevel = g.VerificationLevel + dest.DefaultMessageNotifications = g.DefaultMessageNotifications + dest.ExplicitContentFilter = g.ExplicitContentFilter + dest.Roles = make([]*Role, len(g.Roles)) + for i := 0; i < len(g.Roles); i++ { + dest.Roles[i] = DeepCopy(g.Roles[i]).(*Role) + } + dest.Emojis = make([]*Emoji, len(g.Emojis)) + for i := 0; i < len(g.Emojis); i++ { + dest.Emojis[i] = DeepCopy(g.Emojis[i]).(*Emoji) + } + dest.Features = make([]string, len(g.Features)) + copy(dest.Features, g.Features) + dest.MFALevel = g.MFALevel + dest.WidgetEnabled = g.WidgetEnabled + dest.WidgetChannelID = g.WidgetChannelID + dest.SystemChannelID = g.SystemChannelID + dest.JoinedAt = g.JoinedAt + dest.Large = g.Large + dest.Unavailable = g.Unavailable + dest.MemberCount = g.MemberCount + dest.VoiceStates = make([]*VoiceState, len(g.VoiceStates)) + for i := 0; i < len(g.VoiceStates); i++ { + dest.VoiceStates[i] = DeepCopy(g.VoiceStates[i]).(*VoiceState) + } + dest.Members = make([]*Member, len(g.Members)) + for i := 0; i < len(g.Members); i++ { + dest.Members[i] = DeepCopy(g.Members[i]).(*Member) + } + dest.Channels = make([]*Channel, len(g.Channels)) + for i := 0; i < len(g.Channels); i++ { + dest.Channels[i] = DeepCopy(g.Channels[i]).(*Channel) + } + dest.Presences = make([]*UserPresence, len(g.Presences)) + for i := 0; i < len(g.Presences); i++ { + dest.Presences[i] = DeepCopy(g.Presences[i]).(*UserPresence) } return nil @@ -91,87 +111,94 @@ func (i *Integration) copyOverTo(other interface{}) error { return nil } -func (b *Ban) copyOverTo(other interface{}) error { - var dest *Ban +func (g *GuildEmbed) copyOverTo(other interface{}) error { + var dest *GuildEmbed var valid bool - if dest, valid = other.(*Ban); !valid { - return newErrorUnsupportedType("argument given is not a *Ban type") + if dest, valid = other.(*GuildEmbed); !valid { + return newErrorUnsupportedType("argument given is not a *GuildEmbed type") } - dest.Reason = b.Reason - dest.User = b.User + dest.Enabled = g.Enabled + dest.ChannelID = g.ChannelID return nil } -func (c *Channel) copyOverTo(other interface{}) error { - var dest *Channel +func (m *Member) copyOverTo(other interface{}) error { + var dest *Member var valid bool - if dest, valid = other.(*Channel); !valid { - return newErrorUnsupportedType("argument given is not a *Channel type") + if dest, valid = other.(*Member); !valid { + return newErrorUnsupportedType("argument given is not a *Member type") } - dest.ID = c.ID - dest.Type = c.Type - dest.GuildID = c.GuildID - dest.Position = c.Position - dest.PermissionOverwrites = make([]PermissionOverwrite, len(c.PermissionOverwrites)) - copy(dest.PermissionOverwrites, c.PermissionOverwrites) - dest.Name = c.Name - dest.Topic = c.Topic - dest.NSFW = c.NSFW - dest.LastMessageID = c.LastMessageID - dest.Bitrate = c.Bitrate - dest.UserLimit = c.UserLimit - dest.RateLimitPerUser = c.RateLimitPerUser - dest.Recipients = make([]*User, len(c.Recipients)) - for i := 0; i < len(c.Recipients); i++ { - dest.Recipients[i] = DeepCopy(c.Recipients[i]).(*User) + dest.GuildID = m.GuildID + dest.User = m.User + dest.Nick = m.Nick + dest.Roles = make([]Snowflake, len(m.Roles)) + copy(dest.Roles, m.Roles) + dest.JoinedAt = m.JoinedAt + dest.PremiumSince = m.PremiumSince + dest.Deaf = m.Deaf + dest.Mute = m.Mute + dest.Pending = m.Pending + dest.UserID = m.UserID + + return nil +} + +func (e *EmbedProvider) copyOverTo(other interface{}) error { + var dest *EmbedProvider + var valid bool + if dest, valid = other.(*EmbedProvider); !valid { + return newErrorUnsupportedType("argument given is not a *EmbedProvider type") } - dest.Icon = c.Icon - dest.OwnerID = c.OwnerID - dest.ApplicationID = c.ApplicationID - dest.ParentID = c.ParentID - dest.LastPinTimestamp = c.LastPinTimestamp + dest.Name = e.Name + dest.URL = e.URL return nil } -func (a *AuditLogOption) copyOverTo(other interface{}) error { - var dest *AuditLogOption +func (a *AuditLogEntry) copyOverTo(other interface{}) error { + var dest *AuditLogEntry var valid bool - if dest, valid = other.(*AuditLogOption); !valid { - return newErrorUnsupportedType("argument given is not a *AuditLogOption type") + if dest, valid = other.(*AuditLogEntry); !valid { + return newErrorUnsupportedType("argument given is not a *AuditLogEntry type") } - dest.DeleteMemberDays = a.DeleteMemberDays - dest.MembersRemoved = a.MembersRemoved - dest.ChannelID = a.ChannelID - dest.Count = a.Count + dest.TargetID = a.TargetID + dest.Changes = make([]*AuditLogChanges, len(a.Changes)) + for i := 0; i < len(a.Changes); i++ { + dest.Changes[i] = DeepCopy(a.Changes[i]).(*AuditLogChanges) + } + dest.UserID = a.UserID dest.ID = a.ID - dest.Type = a.Type - dest.RoleName = a.RoleName + dest.Event = a.Event + dest.Options = a.Options + dest.Reason = a.Reason return nil } -func (a *Activity) copyOverTo(other interface{}) error { - var dest *Activity +func (a *ActivityParty) copyOverTo(other interface{}) error { + var dest *ActivityParty var valid bool - if dest, valid = other.(*Activity); !valid { - return newErrorUnsupportedType("argument given is not a *Activity type") + if dest, valid = other.(*ActivityParty); !valid { + return newErrorUnsupportedType("argument given is not a *ActivityParty type") } - dest.Name = a.Name - dest.Type = a.Type - dest.URL = a.URL - dest.CreatedAt = a.CreatedAt - dest.Timestamps = a.Timestamps - dest.ApplicationID = a.ApplicationID - dest.Details = a.Details - dest.State = a.State - dest.Emoji = a.Emoji - dest.Party = a.Party - dest.Assets = a.Assets - dest.Secrets = a.Secrets - dest.Instance = a.Instance - dest.Flags = a.Flags + dest.ID = a.ID + dest.Size = make([]int, len(a.Size)) + copy(dest.Size, a.Size) + + return nil +} + +func (a *ActivityAssets) copyOverTo(other interface{}) error { + var dest *ActivityAssets + var valid bool + if dest, valid = other.(*ActivityAssets); !valid { + return newErrorUnsupportedType("argument given is not a *ActivityAssets type") + } + dest.LargeImage = a.LargeImage + dest.LargeText = a.LargeText + dest.SmallImage = a.SmallImage + dest.SmallText = a.SmallText return nil } @@ -234,309 +261,258 @@ func (m *Message) copyOverTo(other interface{}) error { return nil } -func (g *Guild) copyOverTo(other interface{}) error { - var dest *Guild +func (a *AuditLog) copyOverTo(other interface{}) error { + var dest *AuditLog var valid bool - if dest, valid = other.(*Guild); !valid { - return newErrorUnsupportedType("argument given is not a *Guild type") + if dest, valid = other.(*AuditLog); !valid { + return newErrorUnsupportedType("argument given is not a *AuditLog type") } - dest.ID = g.ID - dest.ApplicationID = g.ApplicationID - dest.Name = g.Name - dest.Icon = g.Icon - dest.Splash = g.Splash - dest.Owner = g.Owner - dest.OwnerID = g.OwnerID - dest.Permissions = g.Permissions - dest.Region = g.Region - dest.AfkChannelID = g.AfkChannelID - dest.AfkTimeout = g.AfkTimeout - dest.VerificationLevel = g.VerificationLevel - dest.DefaultMessageNotifications = g.DefaultMessageNotifications - dest.ExplicitContentFilter = g.ExplicitContentFilter - dest.Roles = make([]*Role, len(g.Roles)) - for i := 0; i < len(g.Roles); i++ { - dest.Roles[i] = DeepCopy(g.Roles[i]).(*Role) - } - dest.Emojis = make([]*Emoji, len(g.Emojis)) - for i := 0; i < len(g.Emojis); i++ { - dest.Emojis[i] = DeepCopy(g.Emojis[i]).(*Emoji) - } - dest.Features = make([]string, len(g.Features)) - copy(dest.Features, g.Features) - dest.MFALevel = g.MFALevel - dest.WidgetEnabled = g.WidgetEnabled - dest.WidgetChannelID = g.WidgetChannelID - dest.SystemChannelID = g.SystemChannelID - dest.JoinedAt = g.JoinedAt - dest.Large = g.Large - dest.Unavailable = g.Unavailable - dest.MemberCount = g.MemberCount - dest.VoiceStates = make([]*VoiceState, len(g.VoiceStates)) - for i := 0; i < len(g.VoiceStates); i++ { - dest.VoiceStates[i] = DeepCopy(g.VoiceStates[i]).(*VoiceState) - } - dest.Members = make([]*Member, len(g.Members)) - for i := 0; i < len(g.Members); i++ { - dest.Members[i] = DeepCopy(g.Members[i]).(*Member) - } - dest.Channels = make([]*Channel, len(g.Channels)) - for i := 0; i < len(g.Channels); i++ { - dest.Channels[i] = DeepCopy(g.Channels[i]).(*Channel) + dest.Webhooks = make([]*Webhook, len(a.Webhooks)) + for i := 0; i < len(a.Webhooks); i++ { + dest.Webhooks[i] = DeepCopy(a.Webhooks[i]).(*Webhook) } - dest.Presences = make([]*UserPresence, len(g.Presences)) - for i := 0; i < len(g.Presences); i++ { - dest.Presences[i] = DeepCopy(g.Presences[i]).(*UserPresence) + dest.Users = make([]*User, len(a.Users)) + for i := 0; i < len(a.Users); i++ { + dest.Users[i] = DeepCopy(a.Users[i]).(*User) } - - return nil -} - -func (e *EmbedImage) copyOverTo(other interface{}) error { - var dest *EmbedImage - var valid bool - if dest, valid = other.(*EmbedImage); !valid { - return newErrorUnsupportedType("argument given is not a *EmbedImage type") + dest.AuditLogEntries = make([]*AuditLogEntry, len(a.AuditLogEntries)) + for i := 0; i < len(a.AuditLogEntries); i++ { + dest.AuditLogEntries[i] = DeepCopy(a.AuditLogEntries[i]).(*AuditLogEntry) } - dest.URL = e.URL - dest.ProxyURL = e.ProxyURL - dest.Height = e.Height - dest.Width = e.Width return nil } -func (r *Reaction) copyOverTo(other interface{}) error { - var dest *Reaction +func (i *Invite) copyOverTo(other interface{}) error { + var dest *Invite var valid bool - if dest, valid = other.(*Reaction); !valid { - return newErrorUnsupportedType("argument given is not a *Reaction type") + if dest, valid = other.(*Invite); !valid { + return newErrorUnsupportedType("argument given is not a *Invite type") } - dest.Count = r.Count - dest.Me = r.Me - dest.Emoji = r.Emoji + dest.Code = i.Code + dest.Guild = i.Guild + dest.Channel = i.Channel + dest.Inviter = i.Inviter + dest.CreatedAt = i.CreatedAt + dest.MaxAge = i.MaxAge + dest.MaxUses = i.MaxUses + dest.Temporary = i.Temporary + dest.Uses = i.Uses + dest.Revoked = i.Revoked + dest.Unique = i.Unique + dest.ApproximatePresenceCount = i.ApproximatePresenceCount + dest.ApproximateMemberCount = i.ApproximateMemberCount return nil } -func (a *ActivityAssets) copyOverTo(other interface{}) error { - var dest *ActivityAssets +func (v *VoiceRegion) copyOverTo(other interface{}) error { + var dest *VoiceRegion var valid bool - if dest, valid = other.(*ActivityAssets); !valid { - return newErrorUnsupportedType("argument given is not a *ActivityAssets type") + if dest, valid = other.(*VoiceRegion); !valid { + return newErrorUnsupportedType("argument given is not a *VoiceRegion type") } - dest.LargeImage = a.LargeImage - dest.LargeText = a.LargeText - dest.SmallImage = a.SmallImage - dest.SmallText = a.SmallText + dest.ID = v.ID + dest.Name = v.Name + dest.SampleHostname = v.SampleHostname + dest.SamplePort = v.SamplePort + dest.VIP = v.VIP + dest.Optimal = v.Optimal + dest.Deprecated = v.Deprecated + dest.Custom = v.Custom return nil } -func (i *IntegrationAccount) copyOverTo(other interface{}) error { - var dest *IntegrationAccount +func (e *EmbedImage) copyOverTo(other interface{}) error { + var dest *EmbedImage var valid bool - if dest, valid = other.(*IntegrationAccount); !valid { - return newErrorUnsupportedType("argument given is not a *IntegrationAccount type") + if dest, valid = other.(*EmbedImage); !valid { + return newErrorUnsupportedType("argument given is not a *EmbedImage type") } - dest.ID = i.ID - dest.Name = i.Name + dest.URL = e.URL + dest.ProxyURL = e.ProxyURL + dest.Height = e.Height + dest.Width = e.Width return nil } -func (r *Role) copyOverTo(other interface{}) error { - var dest *Role +func (e *EmbedField) copyOverTo(other interface{}) error { + var dest *EmbedField var valid bool - if dest, valid = other.(*Role); !valid { - return newErrorUnsupportedType("argument given is not a *Role type") + if dest, valid = other.(*EmbedField); !valid { + return newErrorUnsupportedType("argument given is not a *EmbedField type") } - dest.ID = r.ID - dest.Name = r.Name - dest.Color = r.Color - dest.Hoist = r.Hoist - dest.Position = r.Position - dest.Permissions = r.Permissions - dest.Managed = r.Managed - dest.Mentionable = r.Mentionable - dest.guildID = r.guildID + dest.Name = e.Name + dest.Value = e.Value + dest.Inline = e.Inline return nil } -func (i *InviteMetadata) copyOverTo(other interface{}) error { - var dest *InviteMetadata +func (e *EmbedThumbnail) copyOverTo(other interface{}) error { + var dest *EmbedThumbnail var valid bool - if dest, valid = other.(*InviteMetadata); !valid { - return newErrorUnsupportedType("argument given is not a *InviteMetadata type") + if dest, valid = other.(*EmbedThumbnail); !valid { + return newErrorUnsupportedType("argument given is not a *EmbedThumbnail type") } - dest.Inviter = i.Inviter - dest.Uses = i.Uses - dest.MaxUses = i.MaxUses - dest.MaxAge = i.MaxAge - dest.Temporary = i.Temporary - dest.CreatedAt = i.CreatedAt - dest.Revoked = i.Revoked + dest.URL = e.URL + dest.ProxyURL = e.ProxyURL + dest.Height = e.Height + dest.Width = e.Width return nil } -func (e *Emoji) copyOverTo(other interface{}) error { - var dest *Emoji +func (a *ActivityEmoji) copyOverTo(other interface{}) error { + var dest *ActivityEmoji var valid bool - if dest, valid = other.(*Emoji); !valid { - return newErrorUnsupportedType("argument given is not a *Emoji type") + if dest, valid = other.(*ActivityEmoji); !valid { + return newErrorUnsupportedType("argument given is not a *ActivityEmoji type") } - dest.ID = e.ID - dest.Name = e.Name - dest.Roles = make([]Snowflake, len(e.Roles)) - copy(dest.Roles, e.Roles) - dest.User = e.User - dest.RequireColons = e.RequireColons - dest.Managed = e.Managed - dest.Animated = e.Animated + dest.Name = a.Name + dest.ID = a.ID + dest.Animated = a.Animated return nil } -func (e *EmbedThumbnail) copyOverTo(other interface{}) error { - var dest *EmbedThumbnail +func (w *Webhook) copyOverTo(other interface{}) error { + var dest *Webhook var valid bool - if dest, valid = other.(*EmbedThumbnail); !valid { - return newErrorUnsupportedType("argument given is not a *EmbedThumbnail type") + if dest, valid = other.(*Webhook); !valid { + return newErrorUnsupportedType("argument given is not a *Webhook type") } - dest.URL = e.URL - dest.ProxyURL = e.ProxyURL - dest.Height = e.Height - dest.Width = e.Width + dest.ID = w.ID + dest.GuildID = w.GuildID + dest.ChannelID = w.ChannelID + dest.User = w.User + dest.Name = w.Name + dest.Avatar = w.Avatar + dest.Token = w.Token return nil } -func (e *EmbedAuthor) copyOverTo(other interface{}) error { - var dest *EmbedAuthor +func (u *User) copyOverTo(other interface{}) error { + var dest *User var valid bool - if dest, valid = other.(*EmbedAuthor); !valid { - return newErrorUnsupportedType("argument given is not a *EmbedAuthor type") + if dest, valid = other.(*User); !valid { + return newErrorUnsupportedType("argument given is not a *User type") } - dest.Name = e.Name - dest.URL = e.URL - dest.IconURL = e.IconURL - dest.ProxyIconURL = e.ProxyIconURL + dest.ID = u.ID + dest.Username = u.Username + dest.Discriminator = u.Discriminator + dest.Avatar = u.Avatar + dest.Bot = u.Bot + dest.System = u.System + dest.MFAEnabled = u.MFAEnabled + dest.Locale = u.Locale + dest.Verified = u.Verified + dest.Email = u.Email + dest.Flags = u.Flags + dest.PremiumType = u.PremiumType + dest.PublicFlags = u.PublicFlags + dest.PartialMember = u.PartialMember return nil } -func (u *UserConnection) copyOverTo(other interface{}) error { - var dest *UserConnection +func (a *Attachment) copyOverTo(other interface{}) error { + var dest *Attachment var valid bool - if dest, valid = other.(*UserConnection); !valid { - return newErrorUnsupportedType("argument given is not a *UserConnection type") - } - dest.ID = u.ID - dest.Name = u.Name - dest.Type = u.Type - dest.Revoked = u.Revoked - dest.Integrations = make([]*IntegrationAccount, len(u.Integrations)) - for i := 0; i < len(u.Integrations); i++ { - dest.Integrations[i] = DeepCopy(u.Integrations[i]).(*IntegrationAccount) + if dest, valid = other.(*Attachment); !valid { + return newErrorUnsupportedType("argument given is not a *Attachment type") } + dest.ID = a.ID + dest.Filename = a.Filename + dest.Size = a.Size + dest.URL = a.URL + dest.ProxyURL = a.ProxyURL + dest.Height = a.Height + dest.Width = a.Width + dest.SpoilerTag = a.SpoilerTag return nil } -func (a *AuditLog) copyOverTo(other interface{}) error { - var dest *AuditLog +func (i *IntegrationAccount) copyOverTo(other interface{}) error { + var dest *IntegrationAccount var valid bool - if dest, valid = other.(*AuditLog); !valid { - return newErrorUnsupportedType("argument given is not a *AuditLog type") - } - dest.Webhooks = make([]*Webhook, len(a.Webhooks)) - for i := 0; i < len(a.Webhooks); i++ { - dest.Webhooks[i] = DeepCopy(a.Webhooks[i]).(*Webhook) - } - dest.Users = make([]*User, len(a.Users)) - for i := 0; i < len(a.Users); i++ { - dest.Users[i] = DeepCopy(a.Users[i]).(*User) - } - dest.AuditLogEntries = make([]*AuditLogEntry, len(a.AuditLogEntries)) - for i := 0; i < len(a.AuditLogEntries); i++ { - dest.AuditLogEntries[i] = DeepCopy(a.AuditLogEntries[i]).(*AuditLogEntry) + if dest, valid = other.(*IntegrationAccount); !valid { + return newErrorUnsupportedType("argument given is not a *IntegrationAccount type") } + dest.ID = i.ID + dest.Name = i.Name return nil } -func (i *Invite) copyOverTo(other interface{}) error { - var dest *Invite +func (a *Activity) copyOverTo(other interface{}) error { + var dest *Activity var valid bool - if dest, valid = other.(*Invite); !valid { - return newErrorUnsupportedType("argument given is not a *Invite type") + if dest, valid = other.(*Activity); !valid { + return newErrorUnsupportedType("argument given is not a *Activity type") } - dest.Code = i.Code - dest.Guild = i.Guild - dest.Channel = i.Channel - dest.Inviter = i.Inviter - dest.CreatedAt = i.CreatedAt - dest.MaxAge = i.MaxAge - dest.MaxUses = i.MaxUses - dest.Temporary = i.Temporary - dest.Uses = i.Uses - dest.Revoked = i.Revoked - dest.Unique = i.Unique - dest.ApproximatePresenceCount = i.ApproximatePresenceCount - dest.ApproximateMemberCount = i.ApproximateMemberCount + dest.Name = a.Name + dest.Type = a.Type + dest.URL = a.URL + dest.CreatedAt = a.CreatedAt + dest.Timestamps = a.Timestamps + dest.ApplicationID = a.ApplicationID + dest.Details = a.Details + dest.State = a.State + dest.Emoji = a.Emoji + dest.Party = a.Party + dest.Assets = a.Assets + dest.Secrets = a.Secrets + dest.Instance = a.Instance + dest.Flags = a.Flags return nil } -func (a *ActivitySecrets) copyOverTo(other interface{}) error { - var dest *ActivitySecrets +func (a *AuditLogOption) copyOverTo(other interface{}) error { + var dest *AuditLogOption var valid bool - if dest, valid = other.(*ActivitySecrets); !valid { - return newErrorUnsupportedType("argument given is not a *ActivitySecrets type") + if dest, valid = other.(*AuditLogOption); !valid { + return newErrorUnsupportedType("argument given is not a *AuditLogOption type") } - dest.Join = a.Join - dest.Spectate = a.Spectate - dest.Match = a.Match + dest.DeleteMemberDays = a.DeleteMemberDays + dest.MembersRemoved = a.MembersRemoved + dest.ChannelID = a.ChannelID + dest.Count = a.Count + dest.ID = a.ID + dest.Type = a.Type + dest.RoleName = a.RoleName return nil } -func (a *Attachment) copyOverTo(other interface{}) error { - var dest *Attachment +func (e *EmbedAuthor) copyOverTo(other interface{}) error { + var dest *EmbedAuthor var valid bool - if dest, valid = other.(*Attachment); !valid { - return newErrorUnsupportedType("argument given is not a *Attachment type") + if dest, valid = other.(*EmbedAuthor); !valid { + return newErrorUnsupportedType("argument given is not a *EmbedAuthor type") } - dest.ID = a.ID - dest.Filename = a.Filename - dest.Size = a.Size - dest.URL = a.URL - dest.ProxyURL = a.ProxyURL - dest.Height = a.Height - dest.Width = a.Width - dest.SpoilerTag = a.SpoilerTag + dest.Name = e.Name + dest.URL = e.URL + dest.IconURL = e.IconURL + dest.ProxyIconURL = e.ProxyIconURL return nil } -func (v *VoiceState) copyOverTo(other interface{}) error { - var dest *VoiceState +func (a *AuditLogChanges) copyOverTo(other interface{}) error { + var dest *AuditLogChanges var valid bool - if dest, valid = other.(*VoiceState); !valid { - return newErrorUnsupportedType("argument given is not a *VoiceState type") + if dest, valid = other.(*AuditLogChanges); !valid { + return newErrorUnsupportedType("argument given is not a *AuditLogChanges type") } - dest.GuildID = v.GuildID - dest.ChannelID = v.ChannelID - dest.UserID = v.UserID - dest.Member = v.Member - dest.SessionID = v.SessionID - dest.Deaf = v.Deaf - dest.Mute = v.Mute - dest.SelfDeaf = v.SelfDeaf - dest.SelfMute = v.SelfMute - dest.Suppress = v.Suppress + dest.NewValue = a.NewValue + dest.OldValue = a.OldValue + dest.Key = a.Key return nil } @@ -559,74 +535,90 @@ func (m *MessageSticker) copyOverTo(other interface{}) error { return nil } -func (e *EmbedField) copyOverTo(other interface{}) error { - var dest *EmbedField +func (b *Ban) copyOverTo(other interface{}) error { + var dest *Ban var valid bool - if dest, valid = other.(*EmbedField); !valid { - return newErrorUnsupportedType("argument given is not a *EmbedField type") + if dest, valid = other.(*Ban); !valid { + return newErrorUnsupportedType("argument given is not a *Ban type") } - dest.Name = e.Name - dest.Value = e.Value - dest.Inline = e.Inline + dest.Reason = b.Reason + dest.User = b.User return nil } -func (u *UserPresence) copyOverTo(other interface{}) error { - var dest *UserPresence +func (v *VoiceState) copyOverTo(other interface{}) error { + var dest *VoiceState var valid bool - if dest, valid = other.(*UserPresence); !valid { - return newErrorUnsupportedType("argument given is not a *UserPresence type") + if dest, valid = other.(*VoiceState); !valid { + return newErrorUnsupportedType("argument given is not a *VoiceState type") } - dest.User = u.User - dest.Roles = make([]Snowflake, len(u.Roles)) - copy(dest.Roles, u.Roles) - dest.Game = u.Game - dest.GuildID = u.GuildID - dest.Nick = u.Nick - dest.Status = u.Status + dest.GuildID = v.GuildID + dest.ChannelID = v.ChannelID + dest.UserID = v.UserID + dest.Member = v.Member + dest.SessionID = v.SessionID + dest.Deaf = v.Deaf + dest.Mute = v.Mute + dest.SelfDeaf = v.SelfDeaf + dest.SelfMute = v.SelfMute + dest.Suppress = v.Suppress return nil } -func (w *Webhook) copyOverTo(other interface{}) error { - var dest *Webhook +func (e *EmbedVideo) copyOverTo(other interface{}) error { + var dest *EmbedVideo var valid bool - if dest, valid = other.(*Webhook); !valid { - return newErrorUnsupportedType("argument given is not a *Webhook type") + if dest, valid = other.(*EmbedVideo); !valid { + return newErrorUnsupportedType("argument given is not a *EmbedVideo type") } - dest.ID = w.ID - dest.GuildID = w.GuildID - dest.ChannelID = w.ChannelID - dest.User = w.User - dest.Name = w.Name - dest.Avatar = w.Avatar - dest.Token = w.Token + dest.URL = e.URL + dest.Height = e.Height + dest.Width = e.Width return nil } -func (g *GuildEmbed) copyOverTo(other interface{}) error { - var dest *GuildEmbed +func (i *InviteMetadata) copyOverTo(other interface{}) error { + var dest *InviteMetadata var valid bool - if dest, valid = other.(*GuildEmbed); !valid { - return newErrorUnsupportedType("argument given is not a *GuildEmbed type") + if dest, valid = other.(*InviteMetadata); !valid { + return newErrorUnsupportedType("argument given is not a *InviteMetadata type") } - dest.Enabled = g.Enabled - dest.ChannelID = g.ChannelID + dest.Inviter = i.Inviter + dest.Uses = i.Uses + dest.MaxUses = i.MaxUses + dest.MaxAge = i.MaxAge + dest.Temporary = i.Temporary + dest.CreatedAt = i.CreatedAt + dest.Revoked = i.Revoked return nil } -func (a *ActivityParty) copyOverTo(other interface{}) error { - var dest *ActivityParty +func (a *ActivitySecrets) copyOverTo(other interface{}) error { + var dest *ActivitySecrets var valid bool - if dest, valid = other.(*ActivityParty); !valid { - return newErrorUnsupportedType("argument given is not a *ActivityParty type") + if dest, valid = other.(*ActivitySecrets); !valid { + return newErrorUnsupportedType("argument given is not a *ActivitySecrets type") } - dest.ID = a.ID - dest.Size = make([]int, len(a.Size)) - copy(dest.Size, a.Size) + dest.Join = a.Join + dest.Spectate = a.Spectate + dest.Match = a.Match + + return nil +} + +func (e *EmbedFooter) copyOverTo(other interface{}) error { + var dest *EmbedFooter + var valid bool + if dest, valid = other.(*EmbedFooter); !valid { + return newErrorUnsupportedType("argument given is not a *EmbedFooter type") + } + dest.Text = e.Text + dest.IconURL = e.IconURL + dest.ProxyIconURL = e.ProxyIconURL return nil } @@ -643,47 +635,51 @@ func (a *ActivityTimestamp) copyOverTo(other interface{}) error { return nil } -func (u *User) copyOverTo(other interface{}) error { - var dest *User +func (c *Channel) copyOverTo(other interface{}) error { + var dest *Channel var valid bool - if dest, valid = other.(*User); !valid { - return newErrorUnsupportedType("argument given is not a *User type") + if dest, valid = other.(*Channel); !valid { + return newErrorUnsupportedType("argument given is not a *Channel type") } - dest.ID = u.ID - dest.Username = u.Username - dest.Discriminator = u.Discriminator - dest.Avatar = u.Avatar - dest.Bot = u.Bot - dest.System = u.System - dest.MFAEnabled = u.MFAEnabled - dest.Locale = u.Locale - dest.Verified = u.Verified - dest.Email = u.Email - dest.Flags = u.Flags - dest.PremiumType = u.PremiumType - dest.PublicFlags = u.PublicFlags - dest.PartialMember = u.PartialMember + dest.ID = c.ID + dest.Type = c.Type + dest.GuildID = c.GuildID + dest.Position = c.Position + dest.PermissionOverwrites = make([]PermissionOverwrite, len(c.PermissionOverwrites)) + copy(dest.PermissionOverwrites, c.PermissionOverwrites) + dest.Name = c.Name + dest.Topic = c.Topic + dest.NSFW = c.NSFW + dest.LastMessageID = c.LastMessageID + dest.Bitrate = c.Bitrate + dest.UserLimit = c.UserLimit + dest.RateLimitPerUser = c.RateLimitPerUser + dest.Recipients = make([]*User, len(c.Recipients)) + for i := 0; i < len(c.Recipients); i++ { + dest.Recipients[i] = DeepCopy(c.Recipients[i]).(*User) + } + dest.Icon = c.Icon + dest.OwnerID = c.OwnerID + dest.ApplicationID = c.ApplicationID + dest.ParentID = c.ParentID + dest.LastPinTimestamp = c.LastPinTimestamp return nil } -func (m *Member) copyOverTo(other interface{}) error { - var dest *Member +func (u *UserPresence) copyOverTo(other interface{}) error { + var dest *UserPresence var valid bool - if dest, valid = other.(*Member); !valid { - return newErrorUnsupportedType("argument given is not a *Member type") + if dest, valid = other.(*UserPresence); !valid { + return newErrorUnsupportedType("argument given is not a *UserPresence type") } - dest.GuildID = m.GuildID - dest.User = m.User - dest.Nick = m.Nick - dest.Roles = make([]Snowflake, len(m.Roles)) - copy(dest.Roles, m.Roles) - dest.JoinedAt = m.JoinedAt - dest.PremiumSince = m.PremiumSince - dest.Deaf = m.Deaf - dest.Mute = m.Mute - dest.Pending = m.Pending - dest.UserID = m.UserID + dest.User = u.User + dest.Roles = make([]Snowflake, len(u.Roles)) + copy(dest.Roles, u.Roles) + dest.Game = u.Game + dest.GuildID = u.GuildID + dest.Nick = u.Nick + dest.Status = u.Status return nil } @@ -702,61 +698,65 @@ func (m *MentionChannel) copyOverTo(other interface{}) error { return nil } -func (a *AuditLogEntry) copyOverTo(other interface{}) error { - var dest *AuditLogEntry +func (e *Emoji) copyOverTo(other interface{}) error { + var dest *Emoji var valid bool - if dest, valid = other.(*AuditLogEntry); !valid { - return newErrorUnsupportedType("argument given is not a *AuditLogEntry type") - } - dest.TargetID = a.TargetID - dest.Changes = make([]*AuditLogChanges, len(a.Changes)) - for i := 0; i < len(a.Changes); i++ { - dest.Changes[i] = DeepCopy(a.Changes[i]).(*AuditLogChanges) + if dest, valid = other.(*Emoji); !valid { + return newErrorUnsupportedType("argument given is not a *Emoji type") } - dest.UserID = a.UserID - dest.ID = a.ID - dest.Event = a.Event - dest.Options = a.Options - dest.Reason = a.Reason + dest.ID = e.ID + dest.Name = e.Name + dest.Roles = make([]Snowflake, len(e.Roles)) + copy(dest.Roles, e.Roles) + dest.User = e.User + dest.RequireColons = e.RequireColons + dest.Managed = e.Managed + dest.Animated = e.Animated return nil } -func (a *AuditLogChanges) copyOverTo(other interface{}) error { - var dest *AuditLogChanges +func (r *Role) copyOverTo(other interface{}) error { + var dest *Role var valid bool - if dest, valid = other.(*AuditLogChanges); !valid { - return newErrorUnsupportedType("argument given is not a *AuditLogChanges type") + if dest, valid = other.(*Role); !valid { + return newErrorUnsupportedType("argument given is not a *Role type") } - dest.NewValue = a.NewValue - dest.OldValue = a.OldValue - dest.Key = a.Key + dest.ID = r.ID + dest.Name = r.Name + dest.Color = r.Color + dest.Hoist = r.Hoist + dest.Position = r.Position + dest.Permissions = r.Permissions + dest.Managed = r.Managed + dest.Mentionable = r.Mentionable + dest.guildID = r.guildID return nil } -func (a *ActivityEmoji) copyOverTo(other interface{}) error { - var dest *ActivityEmoji +func (e *Embed) copyOverTo(other interface{}) error { + var dest *Embed var valid bool - if dest, valid = other.(*ActivityEmoji); !valid { - return newErrorUnsupportedType("argument given is not a *ActivityEmoji type") + if dest, valid = other.(*Embed); !valid { + return newErrorUnsupportedType("argument given is not a *Embed type") } - dest.Name = a.Name - dest.ID = a.ID - dest.Animated = a.Animated - - return nil -} - -func (e *EmbedFooter) copyOverTo(other interface{}) error { - var dest *EmbedFooter - var valid bool - if dest, valid = other.(*EmbedFooter); !valid { - return newErrorUnsupportedType("argument given is not a *EmbedFooter type") + dest.Title = e.Title + dest.Type = e.Type + dest.Description = e.Description + dest.URL = e.URL + dest.Timestamp = e.Timestamp + dest.Color = e.Color + dest.Footer = e.Footer + dest.Image = e.Image + dest.Thumbnail = e.Thumbnail + dest.Video = e.Video + dest.Provider = e.Provider + dest.Author = e.Author + dest.Fields = make([]*EmbedField, len(e.Fields)) + for i := 0; i < len(e.Fields); i++ { + dest.Fields[i] = DeepCopy(e.Fields[i]).(*EmbedField) } - dest.Text = e.Text - dest.IconURL = e.IconURL - dest.ProxyIconURL = e.ProxyIconURL return nil } diff --git a/iface_deepcopier_gen.go b/iface_deepcopier_gen.go index 7d6fa22f..927fd4fe 100644 --- a/iface_deepcopier_gen.go +++ b/iface_deepcopier_gen.go @@ -2,27 +2,21 @@ package disgord -func (v *VoiceRegion) deepCopy() interface{} { - cp := &VoiceRegion{} - _ = DeepCopyOver(cp, v) - return cp -} - -func (e *EmbedProvider) deepCopy() interface{} { - cp := &EmbedProvider{} - _ = DeepCopyOver(cp, e) +func (r *Reaction) deepCopy() interface{} { + cp := &Reaction{} + _ = DeepCopyOver(cp, r) return cp } -func (e *EmbedVideo) deepCopy() interface{} { - cp := &EmbedVideo{} - _ = DeepCopyOver(cp, e) +func (u *UserConnection) deepCopy() interface{} { + cp := &UserConnection{} + _ = DeepCopyOver(cp, u) return cp } -func (e *Embed) deepCopy() interface{} { - cp := &Embed{} - _ = DeepCopyOver(cp, e) +func (g *Guild) deepCopy() interface{} { + cp := &Guild{} + _ = DeepCopyOver(cp, g) return cp } @@ -32,80 +26,74 @@ func (i *Integration) deepCopy() interface{} { return cp } -func (b *Ban) deepCopy() interface{} { - cp := &Ban{} - _ = DeepCopyOver(cp, b) +func (g *GuildEmbed) deepCopy() interface{} { + cp := &GuildEmbed{} + _ = DeepCopyOver(cp, g) return cp } -func (c *Channel) deepCopy() interface{} { - cp := &Channel{} - _ = DeepCopyOver(cp, c) +func (m *Member) deepCopy() interface{} { + cp := &Member{} + _ = DeepCopyOver(cp, m) return cp } -func (a *AuditLogOption) deepCopy() interface{} { - cp := &AuditLogOption{} - _ = DeepCopyOver(cp, a) +func (e *EmbedProvider) deepCopy() interface{} { + cp := &EmbedProvider{} + _ = DeepCopyOver(cp, e) return cp } -func (a *Activity) deepCopy() interface{} { - cp := &Activity{} +func (a *AuditLogEntry) deepCopy() interface{} { + cp := &AuditLogEntry{} _ = DeepCopyOver(cp, a) return cp } -func (m *Message) deepCopy() interface{} { - cp := &Message{} - _ = DeepCopyOver(cp, m) - return cp -} - -func (g *Guild) deepCopy() interface{} { - cp := &Guild{} - _ = DeepCopyOver(cp, g) +func (a *ActivityParty) deepCopy() interface{} { + cp := &ActivityParty{} + _ = DeepCopyOver(cp, a) return cp } -func (e *EmbedImage) deepCopy() interface{} { - cp := &EmbedImage{} - _ = DeepCopyOver(cp, e) +func (a *ActivityAssets) deepCopy() interface{} { + cp := &ActivityAssets{} + _ = DeepCopyOver(cp, a) return cp } -func (r *Reaction) deepCopy() interface{} { - cp := &Reaction{} - _ = DeepCopyOver(cp, r) +func (m *Message) deepCopy() interface{} { + cp := &Message{} + _ = DeepCopyOver(cp, m) return cp } -func (a *ActivityAssets) deepCopy() interface{} { - cp := &ActivityAssets{} +func (a *AuditLog) deepCopy() interface{} { + cp := &AuditLog{} _ = DeepCopyOver(cp, a) return cp } -func (i *IntegrationAccount) deepCopy() interface{} { - cp := &IntegrationAccount{} +func (i *Invite) deepCopy() interface{} { + cp := &Invite{} _ = DeepCopyOver(cp, i) return cp } -func (r *Role) deepCopy() interface{} { - cp := &Role{} - _ = DeepCopyOver(cp, r) +func (v *VoiceRegion) deepCopy() interface{} { + cp := &VoiceRegion{} + _ = DeepCopyOver(cp, v) return cp } -func (i *InviteMetadata) deepCopy() interface{} { - cp := &InviteMetadata{} - _ = DeepCopyOver(cp, i) +func (e *EmbedImage) deepCopy() interface{} { + cp := &EmbedImage{} + _ = DeepCopyOver(cp, e) return cp } -func (e *Emoji) deepCopy() interface{} { - cp := &Emoji{} +func (e *EmbedField) deepCopy() interface{} { + cp := &EmbedField{} _ = DeepCopyOver(cp, e) return cp } @@ -116,45 +104,57 @@ func (e *EmbedThumbnail) deepCopy() interface{} { return cp } -func (e *EmbedAuthor) deepCopy() interface{} { - cp := &EmbedAuthor{} - _ = DeepCopyOver(cp, e) +func (a *ActivityEmoji) deepCopy() interface{} { + cp := &ActivityEmoji{} + _ = DeepCopyOver(cp, a) return cp } -func (u *UserConnection) deepCopy() interface{} { - cp := &UserConnection{} +func (w *Webhook) deepCopy() interface{} { + cp := &Webhook{} + _ = DeepCopyOver(cp, w) + return cp +} + +func (u *User) deepCopy() interface{} { + cp := &User{} _ = DeepCopyOver(cp, u) return cp } -func (a *AuditLog) deepCopy() interface{} { - cp := &AuditLog{} +func (a *Attachment) deepCopy() interface{} { + cp := &Attachment{} _ = DeepCopyOver(cp, a) return cp } -func (i *Invite) deepCopy() interface{} { - cp := &Invite{} +func (i *IntegrationAccount) deepCopy() interface{} { + cp := &IntegrationAccount{} _ = DeepCopyOver(cp, i) return cp } -func (a *ActivitySecrets) deepCopy() interface{} { - cp := &ActivitySecrets{} +func (a *Activity) deepCopy() interface{} { + cp := &Activity{} _ = DeepCopyOver(cp, a) return cp } -func (a *Attachment) deepCopy() interface{} { - cp := &Attachment{} +func (a *AuditLogOption) deepCopy() interface{} { + cp := &AuditLogOption{} _ = DeepCopyOver(cp, a) return cp } -func (v *VoiceState) deepCopy() interface{} { - cp := &VoiceState{} - _ = DeepCopyOver(cp, v) +func (e *EmbedAuthor) deepCopy() interface{} { + cp := &EmbedAuthor{} + _ = DeepCopyOver(cp, e) + return cp +} + +func (a *AuditLogChanges) deepCopy() interface{} { + cp := &AuditLogChanges{} + _ = DeepCopyOver(cp, a) return cp } @@ -164,51 +164,57 @@ func (m *MessageSticker) deepCopy() interface{} { return cp } -func (e *EmbedField) deepCopy() interface{} { - cp := &EmbedField{} - _ = DeepCopyOver(cp, e) +func (b *Ban) deepCopy() interface{} { + cp := &Ban{} + _ = DeepCopyOver(cp, b) return cp } -func (u *UserPresence) deepCopy() interface{} { - cp := &UserPresence{} - _ = DeepCopyOver(cp, u) +func (v *VoiceState) deepCopy() interface{} { + cp := &VoiceState{} + _ = DeepCopyOver(cp, v) return cp } -func (w *Webhook) deepCopy() interface{} { - cp := &Webhook{} - _ = DeepCopyOver(cp, w) +func (e *EmbedVideo) deepCopy() interface{} { + cp := &EmbedVideo{} + _ = DeepCopyOver(cp, e) return cp } -func (g *GuildEmbed) deepCopy() interface{} { - cp := &GuildEmbed{} - _ = DeepCopyOver(cp, g) +func (i *InviteMetadata) deepCopy() interface{} { + cp := &InviteMetadata{} + _ = DeepCopyOver(cp, i) return cp } -func (a *ActivityParty) deepCopy() interface{} { - cp := &ActivityParty{} +func (a *ActivitySecrets) deepCopy() interface{} { + cp := &ActivitySecrets{} _ = DeepCopyOver(cp, a) return cp } +func (e *EmbedFooter) deepCopy() interface{} { + cp := &EmbedFooter{} + _ = DeepCopyOver(cp, e) + return cp +} + func (a *ActivityTimestamp) deepCopy() interface{} { cp := &ActivityTimestamp{} _ = DeepCopyOver(cp, a) return cp } -func (u *User) deepCopy() interface{} { - cp := &User{} - _ = DeepCopyOver(cp, u) +func (c *Channel) deepCopy() interface{} { + cp := &Channel{} + _ = DeepCopyOver(cp, c) return cp } -func (m *Member) deepCopy() interface{} { - cp := &Member{} - _ = DeepCopyOver(cp, m) +func (u *UserPresence) deepCopy() interface{} { + cp := &UserPresence{} + _ = DeepCopyOver(cp, u) return cp } @@ -218,26 +224,20 @@ func (m *MentionChannel) deepCopy() interface{} { return cp } -func (a *AuditLogEntry) deepCopy() interface{} { - cp := &AuditLogEntry{} - _ = DeepCopyOver(cp, a) - return cp -} - -func (a *AuditLogChanges) deepCopy() interface{} { - cp := &AuditLogChanges{} - _ = DeepCopyOver(cp, a) +func (e *Emoji) deepCopy() interface{} { + cp := &Emoji{} + _ = DeepCopyOver(cp, e) return cp } -func (a *ActivityEmoji) deepCopy() interface{} { - cp := &ActivityEmoji{} - _ = DeepCopyOver(cp, a) +func (r *Role) deepCopy() interface{} { + cp := &Role{} + _ = DeepCopyOver(cp, r) return cp } -func (e *EmbedFooter) deepCopy() interface{} { - cp := &EmbedFooter{} +func (e *Embed) deepCopy() interface{} { + cp := &Embed{} _ = DeepCopyOver(cp, e) return cp } diff --git a/iface_reseter_gen.go b/iface_reseter_gen.go index d804b6ea..28943986 100644 --- a/iface_reseter_gen.go +++ b/iface_reseter_gen.go @@ -2,53 +2,59 @@ package disgord -func (v *VoiceRegion) reset() { - v.ID = "" - v.Name = "" - v.SampleHostname = "" - v.SamplePort = 0 - v.VIP = false - v.Optimal = false - v.Deprecated = false - v.Custom = false +func (r *Reaction) reset() { + r.Count = 0 + r.Me = false + if r.Emoji != nil { + Reset(r.Emoji) + } } -func (c *Channel) reset() { - c.ID = 0 - c.Type = 0 - c.GuildID = 0 - c.Position = 0 - c.PermissionOverwrites = nil - c.Name = "" - c.Topic = "" - c.NSFW = false - c.LastMessageID = 0 - c.Bitrate = 0 - c.UserLimit = 0 - c.RateLimitPerUser = 0 - c.Recipients = nil - c.Icon = "" - c.OwnerID = 0 - c.ApplicationID = 0 - c.ParentID = 0 - c.LastPinTimestamp = Time{} +func (g *Guild) reset() { + g.ID = 0 + g.ApplicationID = 0 + g.Name = "" + g.Icon = "" + g.Splash = "" + g.Owner = false + g.OwnerID = 0 + g.Permissions = 0 + g.Region = "" + g.AfkChannelID = 0 + g.AfkTimeout = 0 + g.VerificationLevel = 0 + g.DefaultMessageNotifications = 0 + g.ExplicitContentFilter = 0 + g.Roles = nil + g.Emojis = nil + g.Features = nil + g.MFALevel = 0 + g.WidgetEnabled = false + g.WidgetChannelID = 0 + g.SystemChannelID = 0 + g.JoinedAt = nil + g.Large = false + g.Unavailable = false + g.MemberCount = 0 + g.VoiceStates = nil + g.Members = nil + g.Channels = nil + g.Presences = nil } -func (a *Activity) reset() { - a.Name = "" - a.Type = 0 - a.URL = "" - a.CreatedAt = 0 - a.Timestamps = nil - a.ApplicationID = 0 - a.Details = "" - a.State = "" - a.Emoji = nil - a.Party = nil - a.Assets = nil - a.Secrets = nil - a.Instance = false - a.Flags = 0 +func (m *Member) reset() { + m.GuildID = 0 + if m.User != nil { + Reset(m.User) + } + m.Nick = "" + m.Roles = nil + m.JoinedAt = Time{} + m.PremiumSince = Time{} + m.Deaf = false + m.Mute = false + m.Pending = false + m.UserID = 0 } func (m *Message) reset() { @@ -89,83 +95,15 @@ func (m *Message) reset() { m.HasSpoilerImage = false } -func (g *Guild) reset() { - g.ID = 0 - g.ApplicationID = 0 - g.Name = "" - g.Icon = "" - g.Splash = "" - g.Owner = false - g.OwnerID = 0 - g.Permissions = 0 - g.Region = "" - g.AfkChannelID = 0 - g.AfkTimeout = 0 - g.VerificationLevel = 0 - g.DefaultMessageNotifications = 0 - g.ExplicitContentFilter = 0 - g.Roles = nil - g.Emojis = nil - g.Features = nil - g.MFALevel = 0 - g.WidgetEnabled = false - g.WidgetChannelID = 0 - g.SystemChannelID = 0 - g.JoinedAt = nil - g.Large = false - g.Unavailable = false - g.MemberCount = 0 - g.VoiceStates = nil - g.Members = nil - g.Channels = nil - g.Presences = nil -} - -func (r *Reaction) reset() { - r.Count = 0 - r.Me = false - if r.Emoji != nil { - Reset(r.Emoji) - } -} - -func (r *Role) reset() { - r.ID = 0 - r.Name = "" - r.Color = 0 - r.Hoist = false - r.Position = 0 - r.Permissions = 0 - r.Managed = false - r.Mentionable = false - r.guildID = 0 -} - -func (e *Emoji) reset() { - e.ID = 0 - e.Name = "" - e.Roles = nil - if e.User != nil { - Reset(e.User) - } - e.RequireColons = false - e.Managed = false - e.Animated = false -} - -func (v *VoiceState) reset() { - v.GuildID = 0 - v.ChannelID = 0 - v.UserID = 0 - if v.Member != nil { - Reset(v.Member) - } - v.SessionID = "" - v.Deaf = false - v.Mute = false - v.SelfDeaf = false - v.SelfMute = false - v.Suppress = false +func (v *VoiceRegion) reset() { + v.ID = "" + v.Name = "" + v.SampleHostname = "" + v.SamplePort = 0 + v.VIP = false + v.Optimal = false + v.Deprecated = false + v.Custom = false } func (u *User) reset() { @@ -187,19 +125,36 @@ func (u *User) reset() { } } -func (m *Member) reset() { - m.GuildID = 0 - if m.User != nil { - Reset(m.User) +func (a *Activity) reset() { + a.Name = "" + a.Type = 0 + a.URL = "" + a.CreatedAt = 0 + a.Timestamps = nil + a.ApplicationID = 0 + a.Details = "" + a.State = "" + a.Emoji = nil + a.Party = nil + a.Assets = nil + a.Secrets = nil + a.Instance = false + a.Flags = 0 +} + +func (v *VoiceState) reset() { + v.GuildID = 0 + v.ChannelID = 0 + v.UserID = 0 + if v.Member != nil { + Reset(v.Member) } - m.Nick = "" - m.Roles = nil - m.JoinedAt = Time{} - m.PremiumSince = Time{} - m.Deaf = false - m.Mute = false - m.Pending = false - m.UserID = 0 + v.SessionID = "" + v.Deaf = false + v.Mute = false + v.SelfDeaf = false + v.SelfMute = false + v.Suppress = false } func (m *MessageCreate) reset() { @@ -208,3 +163,48 @@ func (m *MessageCreate) reset() { } m.ShardID = 0 } + +func (c *Channel) reset() { + c.ID = 0 + c.Type = 0 + c.GuildID = 0 + c.Position = 0 + c.PermissionOverwrites = nil + c.Name = "" + c.Topic = "" + c.NSFW = false + c.LastMessageID = 0 + c.Bitrate = 0 + c.UserLimit = 0 + c.RateLimitPerUser = 0 + c.Recipients = nil + c.Icon = "" + c.OwnerID = 0 + c.ApplicationID = 0 + c.ParentID = 0 + c.LastPinTimestamp = Time{} +} + +func (e *Emoji) reset() { + e.ID = 0 + e.Name = "" + e.Roles = nil + if e.User != nil { + Reset(e.User) + } + e.RequireColons = false + e.Managed = false + e.Animated = false +} + +func (r *Role) reset() { + r.ID = 0 + r.Name = "" + r.Color = 0 + r.Hoist = false + r.Position = 0 + r.Permissions = 0 + r.Managed = false + r.Mentionable = false + r.guildID = 0 +}