Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 45 additions & 33 deletions disgo.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wrapper/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ linters:
- dupl
- forbidigo
- funlen
- goerr113
- err113
- gofumpt
- interfacebloat
- nilnil
Expand Down
10 changes: 6 additions & 4 deletions wrapper/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,21 +265,23 @@ func DefaultGateway() Gateway {
// Use the Gateway.IntentSet to check whether the intent is already enabled.
//
// DISCLAIMER. Bots that use `DefaultGateway()` or `DefaultConfig()` to
// initialize the Client have privileged intents = `true` in the IntentSet by default.
// initialize the Client have privileged intents = `true` in the IntentSet by default,
// which disables the privileged intent.
func (g *Gateway) EnableIntent(intent BitFlag) {
g.IntentSet[intent] = true
g.Intents |= intent
}

// EnableIntentPrivileged enables all privileged intents.
// EnableIntentsPrivileged enables all privileged intents.
// https://discord.com/developers/docs/topics/gateway#privileged-intents
//
// This function does NOT check whether the intent is already enabled.
// Use the Gateway.IntentSet to check whether the intent is already enabled.
//
// DISCLAIMER. Bots that use `DefaultGateway()` or `DefaultConfig()` to
// initialize the Client have privileged intents = `true` in the IntentSet by default.
func (g *Gateway) EnableIntentPrivileged(intent BitFlag) {
// initialize the Client have privileged intents = `true` in the IntentSet by default,
// which disables the privileged intent.
func (g *Gateway) EnableIntentsPrivileged() {
for privilegedIntent := range PrivilegedIntents {
g.EnableIntent(privilegedIntent)
}
Expand Down
34 changes: 17 additions & 17 deletions wrapper/dasgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -2101,7 +2101,7 @@ type GetChannelMessages struct {
Around *string `url:"around,omitempty"`
Before *string `url:"before,omitempty"`
After *string `url:"after,omitempty"`
Limit *Flag `url:"limit,omitempty"`
Limit *int `url:"limit,omitempty"`
}

// Get Channel Message
Expand All @@ -2124,7 +2124,7 @@ type CreateMessage struct {
AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"`
MessageReference *MessageReference `json:"message_reference,omitempty"`
Components []Component `json:"components,omitempty"`
StickerIDS []*string `json:"sticker_ids,omitempty"`
StickerIDS []string `json:"sticker_ids,omitempty"`
Files []*File `json:"-" dasgo:"files,omitempty"`
Attachments []*Attachment `json:"attachments,omitempty"`
Flags *BitFlag `json:"flags,omitempty"`
Expand Down Expand Up @@ -2223,8 +2223,8 @@ type DeleteMessage struct {
// POST /channels/{channel.id}/messages/bulk-delete
// https://discord.com/developers/docs/resources/channel#bulk-delete-messages
type BulkDeleteMessages struct {
ChannelID string `json:"-"`
Messages []*string `json:"messages"`
ChannelID string `json:"-"`
Messages []string `json:"messages"`
}

// Get Answer Voters
Expand Down Expand Up @@ -2452,7 +2452,7 @@ type ForumAndMediaThreadMessageParams struct {
Embeds []*Embed `json:"embeds,omitempty"`
AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"`
Components []Component `json:"components,omitempty"`
StickerIDS []*string `json:"sticker_ids,omitempty"`
StickerIDS []string `json:"sticker_ids,omitempty"`
Attachments []*Attachment `json:"attachments,omitempty"`
Flags *BitFlag `json:"flags,omitempty"`
}
Expand Down Expand Up @@ -2552,20 +2552,20 @@ type GetGuildEmoji struct {
// POST /guilds/{guild.id}/emojis
// https://discord.com/developers/docs/resources/emoji#create-guild-emoji
type CreateGuildEmoji struct {
GuildID string `json:"-"`
Name string `json:"name"`
Image string `json:"image"`
Roles []*string `json:"roles"`
GuildID string `json:"-"`
Name string `json:"name"`
Image string `json:"image"`
Roles []string `json:"roles"`
}

// Modify Guild Emoji
// PATCH /guilds/{guild.id}/emojis/{emoji.id}
// https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
type ModifyGuildEmoji struct {
GuildID string `json:"-"`
EmojiID string `json:"-"`
Name *string `json:"name,omitempty"`
Roles *[]*string `json:"roles,omitempty"`
GuildID string `json:"-"`
EmojiID string `json:"-"`
Name *string `json:"name,omitempty"`
Roles *[]string `json:"roles"`
}

// Delete Guild Emoji
Expand Down Expand Up @@ -4507,7 +4507,7 @@ type Message struct {
TTS bool `json:"tts"`
MentionEveryone bool `json:"mention_everyone"`
Mentions []*User `json:"mentions"`
MentionRoles []*string `json:"mention_roles"`
MentionRoles []string `json:"mention_roles"`
MentionChannels []*ChannelMention `json:"mention_channels,omitempty"`
Attachments []*Attachment `json:"attachments"`
Embeds []*Embed `json:"embeds"`
Expand Down Expand Up @@ -4878,8 +4878,8 @@ type ChannelMention struct {
// https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mentions-structure
type AllowedMentions struct {
Parse []*string `json:"parse"`
Roles []*string `json:"roles"`
Users []*string `json:"users"`
Roles []string `json:"roles"`
Users []string `json:"users"`
RepliedUser bool `json:"replied_user"`
}

Expand Down Expand Up @@ -5241,7 +5241,7 @@ type GuildMember struct {
Nick **string `json:"nick,omitempty"`
Avatar **string `json:"avatar,omitempty"`
Banner **string `json:"banner,omitempty"`
Roles []*string `json:"roles"`
Roles []string `json:"roles"`
JoinedAt time.Time `json:"joined_at"`
PremiumSince **time.Time `json:"premium_since,omitempty"`
Deaf bool `json:"deaf"`
Expand Down
Loading
Loading