New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Invite Create/Delete #1105
Add Invite Create/Delete #1105
Changes from 5 commits
a672374
b5fb836
0a7015c
484a2d6
7a69004
9a5e623
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,6 +128,32 @@ type Session struct { | |
wsMutex sync.Mutex | ||
} | ||
|
||
// Application stores values for a Discord Application | ||
type Application struct { | ||
ID string `json:"id,omitempty"` | ||
Name string `json:"name"` | ||
Icon string `json:"icon,omitempty"` | ||
Description string `json:"description,omitempty"` | ||
RPCOrigins []string `json:"rpc_origins,omitempty"` | ||
BotPublic bool `json:"bot_public,omitempty"` | ||
BotRequireCodeGrant bool `json:"bot_require_code_grant,omitempty"` | ||
TermsOfServiceURL string `json:"terms_of_service_url"` | ||
PrivacyProxyURL string `json:"privacy_policy_url"` | ||
Owner *User `json:"owner"` | ||
Summary string `json:"summary"` | ||
VerifyKey string `json:"verify_key"` | ||
Team *Team `json:"team"` | ||
GuildID string `json:"guild_id"` | ||
PrimarySKUID string `json:"primary_sku_id"` | ||
Slug string `json:"slug"` | ||
CoverImage string `json:"cover_image"` | ||
Flags int `json:"flags,omitempty"` | ||
|
||
// TODO: Remove this when compatibility is not required | ||
// Deprecated | ||
RedirectURIs *[]string `json:"-"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better to remove this field, since it doesn't have a purpose anymore. |
||
} | ||
|
||
// UserConnection is a Connection returned from the UserConnections endpoint | ||
type UserConnection struct { | ||
ID string `json:"id"` | ||
|
@@ -191,32 +217,45 @@ type ICEServer struct { | |
Credential string `json:"credential"` | ||
} | ||
|
||
// InviteTargetType indicates the type of target of an invite | ||
// https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types | ||
type InviteTargetType uint8 | ||
|
||
// Invite target types | ||
const ( | ||
InviteTargetStream InviteTargetType = 1 | ||
InviteTargetEmbeddedAppliction InviteTargetType = 2 | ||
) | ||
|
||
// A Invite stores all data related to a specific Discord Guild or Channel invite. | ||
type Invite struct { | ||
Guild *Guild `json:"guild"` | ||
Channel *Channel `json:"channel"` | ||
Inviter *User `json:"inviter"` | ||
Code string `json:"code"` | ||
CreatedAt time.Time `json:"created_at"` | ||
MaxAge int `json:"max_age"` | ||
Uses int `json:"uses"` | ||
MaxUses int `json:"max_uses"` | ||
Revoked bool `json:"revoked"` | ||
Temporary bool `json:"temporary"` | ||
Unique bool `json:"unique"` | ||
TargetUser *User `json:"target_user"` | ||
TargetUserType TargetUserType `json:"target_user_type"` | ||
FedorLap2006 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Guild *Guild `json:"guild"` | ||
Channel *Channel `json:"channel"` | ||
Inviter *User `json:"inviter"` | ||
Code string `json:"code"` | ||
CreatedAt time.Time `json:"created_at"` | ||
MaxAge int `json:"max_age"` | ||
Uses int `json:"uses"` | ||
MaxUses int `json:"max_uses"` | ||
Revoked bool `json:"revoked"` | ||
Temporary bool `json:"temporary"` | ||
Unique bool `json:"unique"` | ||
TargetUser *User `json:"target_user"` | ||
TargetType InviteTargetType `json:"target_type"` | ||
TargetApplication *Application `json:"target_application"` | ||
|
||
// will only be filled when using InviteWithCounts | ||
ApproximatePresenceCount int `json:"approximate_presence_count"` | ||
ApproximateMemberCount int `json:"approximate_member_count"` | ||
} | ||
|
||
// TargetUserType is the type of the target user | ||
// https://discord.com/developers/docs/resources/invite#invite-object-target-user-types | ||
// TODO: Remove this when compatibility is not required | ||
// Deprecated: see InviteTargetType | ||
type TargetUserType int | ||
|
||
// Block contains known TargetUserType values | ||
// Deprecated: see InviteTargetType | ||
const ( | ||
TargetUserTypeStream TargetUserType = 1 | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the type is meant to be renamed I think it would be fair to remove the old one. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this PR would be right place to add this comment