Skip to content

Commit

Permalink
use discord.ExtendedInvite for GetGuildInvites & GetChannelInvites
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Aug 12, 2024
1 parent 6326854 commit f24ca9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion discord/invite.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ type Invite struct {
Code string `json:"code"`
Guild *InviteGuild `json:"guild"`
Channel *InviteChannel `json:"channel"`
ChannelID snowflake.ID `json:"channel_id"`
Inviter *User `json:"inviter"`
TargetUser *User `json:"target_user"`
TargetType InviteTargetType `json:"target_user_type"`
Expand Down
8 changes: 4 additions & 4 deletions rest/invites.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ type Invites interface {
GetInvite(code string, opts ...RequestOpt) (*discord.Invite, error)
CreateInvite(channelID snowflake.ID, inviteCreate discord.InviteCreate, opts ...RequestOpt) (*discord.Invite, error)
DeleteInvite(code string, opts ...RequestOpt) (*discord.Invite, error)
GetGuildInvites(guildID snowflake.ID, opts ...RequestOpt) ([]discord.Invite, error)
GetChannelInvites(channelID snowflake.ID, opts ...RequestOpt) ([]discord.Invite, error)
GetGuildInvites(guildID snowflake.ID, opts ...RequestOpt) ([]discord.ExtendedInvite, error)
GetChannelInvites(channelID snowflake.ID, opts ...RequestOpt) ([]discord.ExtendedInvite, error)
}

type inviteImpl struct {
Expand All @@ -39,12 +39,12 @@ func (s *inviteImpl) DeleteInvite(code string, opts ...RequestOpt) (invite *disc
return
}

func (s *inviteImpl) GetGuildInvites(guildID snowflake.ID, opts ...RequestOpt) (invites []discord.Invite, err error) {
func (s *inviteImpl) GetGuildInvites(guildID snowflake.ID, opts ...RequestOpt) (invites []discord.ExtendedInvite, err error) {
err = s.client.Do(GetGuildInvites.Compile(nil, guildID), nil, &invites, opts...)
return
}

func (s *inviteImpl) GetChannelInvites(channelID snowflake.ID, opts ...RequestOpt) (invites []discord.Invite, err error) {
func (s *inviteImpl) GetChannelInvites(channelID snowflake.ID, opts ...RequestOpt) (invites []discord.ExtendedInvite, err error) {
err = s.client.Do(GetChannelInvites.Compile(nil, channelID), nil, &invites, opts...)
return
}

0 comments on commit f24ca9a

Please sign in to comment.