Skip to content

Commit

Permalink
discord: Add Invite.URL() methods
Browse files Browse the repository at this point in the history
  • Loading branch information
twoscott authored and diamondburned committed Jul 22, 2022
1 parent fb2032d commit 2013da8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions discord/invite.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ type Invite struct {
InviteMetadata
}

// URL returns a Discord invite URL linking to the invite.
func (i Invite) URL() string {
return "https://discord.gg/" + i.Code
}

// LongURL returns a long-form Discord invite URL linking to the invite.
func (i Invite) LongURL() string {
return "https://discord.com/invite/" + i.Code
}

// https://discord.com/developers/docs/resources/invite#invite-object-target-user-types
type InviteUserType uint8

Expand Down

0 comments on commit 2013da8

Please sign in to comment.