discord: Add Invite.URL() methods

This commit is contained in:
twoscott 2022-07-22 02:31:49 +01:00 committed by diamondburned
parent fb2032d538
commit 2013da8255
1 changed files with 10 additions and 0 deletions

View File

@ -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