Skip to content

Commit

Permalink
rename some fields in Application to match the api naming
Browse files Browse the repository at this point in the history
  • Loading branch information
mlnrDev committed Dec 8, 2022
1 parent 0b0013e commit 2b22c86
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions discord/application.go
Expand Up @@ -9,27 +9,27 @@ import (
)

type Application struct {
ID snowflake.ID `json:"id"`
Name string `json:"name"`
Icon *string `json:"icon,omitempty"`
Description string `json:"description"`
RPCOrigins []string `json:"rpc_origins"`
BotPublic bool `json:"bot_public"`
BotRequireCodeGrant bool `json:"bot_require_code_grant"`
TermsOfServiceURL *string `json:"terms_of_service_url,omitempty"`
PrivacyPolicyURL *string `json:"privacy_policy_url,omitempty"`
CustomInstallationURL *string `json:"custom_install_url,omitempty"`
InstallationParams *InstallationParams `json:"install_params"`
Tags []string `json:"tags"`
Owner *User `json:"owner,omitempty"`
Summary string `json:"summary"`
VerifyKey string `json:"verify_key"`
Team *Team `json:"team,omitempty"`
GuildID *snowflake.ID `json:"guild_id,omitempty"`
PrimarySkuID *snowflake.ID `json:"primary_sku_id,omitempty"`
Slug *string `json:"slug,omitempty"`
Cover *string `json:"cover_image,omitempty"`
Flags ApplicationFlags `json:"flags,omitempty"`
ID snowflake.ID `json:"id"`
Name string `json:"name"`
Icon *string `json:"icon,omitempty"`
Description string `json:"description"`
RPCOrigins []string `json:"rpc_origins"`
BotPublic bool `json:"bot_public"`
BotRequireCodeGrant bool `json:"bot_require_code_grant"`
TermsOfServiceURL *string `json:"terms_of_service_url,omitempty"`
PrivacyPolicyURL *string `json:"privacy_policy_url,omitempty"`
CustomInstallURL *string `json:"custom_install_url,omitempty"`
InstallParams *InstallParams `json:"install_params"`
Tags []string `json:"tags"`
Owner *User `json:"owner,omitempty"`
Summary string `json:"summary"`
VerifyKey string `json:"verify_key"`
Team *Team `json:"team,omitempty"`
GuildID *snowflake.ID `json:"guild_id,omitempty"`
PrimarySkuID *snowflake.ID `json:"primary_sku_id,omitempty"`
Slug *string `json:"slug,omitempty"`
CoverImage *string `json:"cover_image,omitempty"`
Flags ApplicationFlags `json:"flags,omitempty"`
}

func (a Application) IconURL(opts ...CDNOpt) *string {
Expand All @@ -40,11 +40,11 @@ func (a Application) IconURL(opts ...CDNOpt) *string {
return &url
}

func (a Application) CoverURL(opts ...CDNOpt) *string {
if a.Cover == nil {
func (a Application) CoverImageURL(opts ...CDNOpt) *string {
if a.CoverImage == nil {
return nil
}
url := formatAssetURL(ApplicationCover, opts, a.ID, *a.Cover)
url := formatAssetURL(ApplicationCover, opts, a.ID, *a.CoverImage)
return &url
}

Expand All @@ -64,7 +64,7 @@ type AuthorizationInformation struct {
User *User `json:"user"`
}

type InstallationParams struct {
type InstallParams struct {
Scopes []OAuth2Scope `json:"scopes"`
Permissions Permissions `json:"permissions"`
}
Expand Down

0 comments on commit 2b22c86

Please sign in to comment.