Skip to content

Commit 4324fea

Browse files
committed
fix: Update links to relevant Discord Docs entries to support new format, solves #60
1 parent 6649ac2 commit 4324fea

13 files changed

Lines changed: 105 additions & 105 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ It was created as a better alternative to [discord-interactions-go](https://gith
6262
- [x] Components (buttons, string selects, sections, etc.)
6363
- [x] Modals
6464
- [x] Bitfields (flags, permissions, etc.)
65-
- [x] [Message Components v2](https://discord.com/developers/docs/components/overview)
65+
- [x] [Message Components v2](https://docs.discord.com/developers/components/overview)
6666
- [x] Exposed Rest client and all API structs which allows to easily extend library capabilities if needed
6767
- [x] **__Basic__** support for Discord Monetization API *(enough to get started)*
6868

client.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ func (client *BaseClient) FetchMember(guildID Snowflake, memberID Snowflake) (Me
276276
//
277277
// By default it will attempt to return all, existing entitlements - provide query filter to control this behavior.
278278
//
279-
// https://discord.com/developers/docs/resources/entitlement#list-entitlements
279+
// https://docs.discord.com/developers/resources/entitlement#list-entitlements
280280
func (client *BaseClient) FetchEntitlementsPage(queryFilter string) ([]Entitlement, error) {
281281
if queryFilter[0] != '?' {
282282
queryFilter = "?" + queryFilter
@@ -297,7 +297,7 @@ func (client *BaseClient) FetchEntitlementsPage(queryFilter string) ([]Entitleme
297297
return res, nil
298298
}
299299

300-
// https://discord.com/developers/docs/resources/entitlement#get-entitlement
300+
// https://docs.discord.com/developers/resources/entitlement#get-entitlement
301301
func (client *BaseClient) FetchEntitlement(entitlementID Snowflake) (Entitlement, error) {
302302
raw, err := client.Rest.Request(http.MethodGet, "/applications/"+client.ApplicationID.String()+"/entitlements/"+entitlementID.String(), nil)
303303
if err != nil {
@@ -317,7 +317,7 @@ func (client *BaseClient) FetchEntitlement(entitlementID Snowflake) (Entitlement
317317
// For One-Time Purchase consumable SKUs, marks a given entitlement for the user as consumed.
318318
// The entitlement will have consumed: true when using Client.FetchEntitlements.
319319
//
320-
// https://discord.com/developers/docs/resources/entitlement#consume-an-entitlement
320+
// https://docs.discord.com/developers/resources/entitlement#consume-an-entitlement
321321
func (client *BaseClient) ConsumeEntitlement(entitlementID Snowflake) error {
322322
_, err := client.Rest.Request(http.MethodPost, "/applications/"+client.ApplicationID.String()+"/entitlements/"+entitlementID.String()+"/consume", nil)
323323
if err != nil {
@@ -326,7 +326,7 @@ func (client *BaseClient) ConsumeEntitlement(entitlementID Snowflake) error {
326326
return err
327327
}
328328

329-
// https://discord.com/developers/docs/resources/entitlement#create-test-entitlement
329+
// https://docs.discord.com/developers/resources/entitlement#create-test-entitlement
330330
func (client *BaseClient) CreateTestEntitlement(payload TestEntitlementPayload) error {
331331
_, err := client.Rest.Request(http.MethodPost, "/applications/"+client.ApplicationID.String()+"/entitlements", payload)
332332
if err != nil {
@@ -335,7 +335,7 @@ func (client *BaseClient) CreateTestEntitlement(payload TestEntitlementPayload)
335335
return err
336336
}
337337

338-
// https://discord.com/developers/docs/resources/entitlement#delete-test-entitlement
338+
// https://docs.discord.com/developers/resources/entitlement#delete-test-entitlement
339339
func (client *BaseClient) DeleteTestEntitlement(entitlementID Snowflake) error {
340340
_, err := client.Rest.Request(http.MethodDelete, "/applications/"+client.ApplicationID.String()+"/entitlements/"+entitlementID.String(), nil)
341341
if err != nil {

command.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package tempest
22

3-
// https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types
3+
// https://docs.discord.com/developers/interactions/application-commands#application-command-object-application-command-types
44
type CommandType uint8
55

66
const (
@@ -10,12 +10,12 @@ const (
1010
PRIMARY_ENTRY_POINT_COMMAND_TYPE // An UI-based command that represents the primary way to invoke an app's Activity
1111
)
1212

13-
// https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type
13+
// https://docs.discord.com/developers/interactions/application-commands#application-command-object-application-command-option-type
1414
type OptionType uint8
1515

1616
const (
1717
SUB_COMMAND_OPTION_TYPE OptionType = iota + 1
18-
SUB_COMMAND_GROUP_OPTION_TYPE // NOT SUPPORTED BY LIBRARY
18+
SUB_COMMAND_GROUP_OPTION_TYPE // NOT OFFICIALLY SUPPORTED BY LIBRARY
1919
STRING_OPTION_TYPE
2020
INTEGER_OPTION_TYPE
2121
BOOLEAN_OPTION_TYPE
@@ -27,23 +27,23 @@ const (
2727
ATTACHMENT_OPTION_TYPE
2828
)
2929

30-
// https://discord.com/developers/docs/resources/application#application-object-application-integration-types
30+
// https://docs.discord.com/developers/resources/application#application-object-application-integration-types
3131
type ApplicationIntegrationType uint8
3232

3333
const (
3434
GUILD_INSTALL ApplicationIntegrationType = iota
3535
USER_INSTALL
3636
)
3737

38-
// https://discord.com/developers/docs/interactions/application-commands#application-command-object-entry-point-command-handler-types
38+
// https://docs.discord.com/developers/interactions/application-commands#application-command-object-entry-point-command-handler-types
3939
type CommandHandlerType uint8
4040

4141
const (
4242
APP_COMMAND_HANDLER CommandHandlerType = iota + 1
4343
DISCORD_LAUNCH_ACTIVITY_COMMAND_HANDLER
4444
)
4545

46-
// https://discord.com/developers/docs/reference#locales
46+
// https://docs.discord.com/developers/reference#locales
4747
type Language string
4848

4949
const (
@@ -79,7 +79,7 @@ const (
7979
KOREAN_LANGUAGE Language = "ko"
8080
)
8181

82-
// https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure
82+
// https://docs.discord.com/developers/interactions/application-commands#application-command-object-application-command-structure
8383
type Command struct {
8484
ID Snowflake `json:"-"` // It's not needed on app side to work.
8585
Type CommandType `json:"type,omitempty"`
@@ -93,15 +93,15 @@ type Command struct {
9393
RequiredPermissions PermissionFlags `json:"default_member_permissions,string,omitempty"` // Set of permissions represented as a bit set that are required from user/member to use command. Set it to 0 to make command unavailable for regular members (guild administrators still can use it).
9494
IntegrationTypes []ApplicationIntegrationType `json:"integration_types,omitzero"`
9595
Contexts []InteractionContextType `json:"contexts,omitzero"` // Interaction context(s) where the command can be used, only for globally-scoped commands. By default, all interaction context types included for new commands.
96-
NSFW bool `json:"nsfw"` // https://discord.com/developers/docs/interactions/application-commands#agerestricted-commands
96+
NSFW bool `json:"nsfw"` // https://docs.discord.com/developers/interactions/application-commands#agerestricted-commands
9797
Version Snowflake `json:"version,omitempty"` // Autoincrementing version identifier updated during substantial record changes.
9898
Handler CommandHandlerType `json:"handler,omitempty"`
9999

100100
AutoCompleteHandler func(itx CommandInteraction) []CommandOptionChoice `json:"-"` // Custom handler for auto complete interactions. It's a Tempest specific field.
101101
SlashCommandHandler func(itx *CommandInteraction) `json:"-"` // Custom handler for slash command interactions. It's a Tempest specific field. It receives pointer to CommandInteraction as it's being used with pre & post client hooks.
102102
}
103103

104-
// https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
104+
// https://docs.discord.com/developers/interactions/application-commands#application-command-object-application-command-option-structure
105105
type CommandOption struct {
106106
Type OptionType `json:"type"`
107107
Name string `json:"name"`

component-union.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type AnyComponent interface {
1919
// A list of all valid types can be found on [Discord's website],
2020
// though this interface intentionally excludes certain components that cannot appear by themselves (such as [SelectComponent]s).
2121
//
22-
// [Discord's website]: https://discord.com/developers/docs/components/reference#component-object-component-types
22+
// [Discord's website]: https://docs.discord.com/developers/components/reference#component-object-component-types
2323
type MessageComponent interface {
2424
AnyComponent
2525
_messagecmp()
@@ -31,7 +31,7 @@ type MessageComponent interface {
3131
// A list of all valid types can be found on [Discord's website],
3232
// though this interface intentionally excludes certain components that cannot appear by themselves (such as [SelectComponent]s).
3333
//
34-
// [Discord's website]: https://discord.com/developers/docs/components/reference#component-object-component-types
34+
// [Discord's website]: https://docs.discord.com/developers/components/reference#component-object-component-types
3535
type ModalComponent interface {
3636
AnyComponent
3737
_modalcmp()

entitlement.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package tempest
22

33
import "time"
44

5-
// https://discord.com/developers/docs/resources/entitlement#entitlement-object-entitlement-types
5+
// https://docs.discord.com/developers/resources/entitlement#entitlement-object-entitlement-types
66
type EntitlementType uint8
77

88
const (
@@ -20,7 +20,7 @@ const (
2020
//
2121
// Refer to the Monetization Overview for more information on how to use Entitlements in your app.
2222
//
23-
// https://discord.com/developers/docs/resources/entitlement#entitlement-object
23+
// https://docs.discord.com/developers/resources/entitlement#entitlement-object
2424
type Entitlement struct {
2525
ID Snowflake `json:"id"`
2626
SkuID Snowflake `json:"sku_id"`
@@ -34,7 +34,7 @@ type Entitlement struct {
3434
Consumed bool `json:"consumed"` // Whether entitlement was already used
3535
}
3636

37-
// https://discord.com/developers/docs/resources/entitlement#create-test-entitlement-json-params
37+
// https://docs.discord.com/developers/resources/entitlement#create-test-entitlement-json-params
3838
type TestEntitlementPayload struct {
3939
SkuID Snowflake `json:"sku_id"`
4040
OwnerID Snowflake `json:"owner_id"`

event.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,32 @@ const (
2121

2222
// In modern discord docs - otherwise known as generic gateway event.
2323
//
24-
// https://discord.com/developers/docs/events/gateway#gateway-events
24+
// https://docs.discord.com/developers/events/gateway#gateway-events
2525
type EventPacket struct {
2626
Opcode Opcode `json:"op"`
2727
Sequence uint32 `json:"s,omitempty"`
2828
Event EventName `json:"t,omitempty"`
2929
Data json.RawMessage `json:"d"`
3030
}
3131

32-
// https://discord.com/developers/docs/events/gateway-events#hello
32+
// https://docs.discord.com/developers/events/gateway-events#hello
3333
type HelloEventData struct {
3434
HeartbeatInterval uint32 `json:"heartbeat_interval"`
3535
}
3636

37-
// https://discord.com/developers/docs/events/gateway-events#heartbeat
37+
// https://docs.discord.com/developers/events/gateway-events#heartbeat
3838
type HeartbeatEvent struct {
3939
Opcode Opcode `json:"op"`
4040
Sequence uint32 `json:"d"`
4141
}
4242

43-
// https://discord.com/developers/docs/events/gateway-events#identify
43+
// https://docs.discord.com/developers/events/gateway-events#identify
4444
type IdentifyEvent struct {
4545
Opcode Opcode `json:"op"`
4646
Data IdentifyPayloadData `json:"d"`
4747
}
4848

49-
// https://discord.com/developers/docs/events/gateway-events#identify-identify-structure
49+
// https://docs.discord.com/developers/events/gateway-events#identify-identify-structure
5050
type IdentifyPayloadData struct {
5151
Token string `json:"token"`
5252
Intents uint32 `json:"intents"`
@@ -55,14 +55,14 @@ type IdentifyPayloadData struct {
5555
Properties IdentifyPayloadDataProperties `json:"properties"`
5656
}
5757

58-
// https://discord.com/developers/docs/events/gateway-events#identify-identify-connection-properties
58+
// https://docs.discord.com/developers/events/gateway-events#identify-identify-connection-properties
5959
type IdentifyPayloadDataProperties struct {
6060
OS string `json:"os"`
6161
Browser string `json:"browser"`
6262
Device string `json:"device"`
6363
}
6464

65-
// https://discord.com/developers/docs/events/gateway-events#ready
65+
// https://docs.discord.com/developers/events/gateway-events#ready
6666
type ReadyEventData struct {
6767
User User `json:"user"`
6868
Version uint8 `json:"v"` // Version of Discord API version
@@ -73,27 +73,27 @@ type ReadyEventData struct {
7373
// + partial application object (docs)
7474
}
7575

76-
// https://discord.com/developers/docs/events/gateway-events#resume
76+
// https://docs.discord.com/developers/events/gateway-events#resume
7777
type ResumeEvent struct {
7878
Opcode Opcode `json:"op"`
7979
Data ResumeEventData `json:"d"`
8080
}
8181

82-
// https://discord.com/developers/docs/events/gateway-events#resume-resume-structure
82+
// https://docs.discord.com/developers/events/gateway-events#resume-resume-structure
8383
type ResumeEventData struct {
8484
Token string `json:"token"`
8585
SessionID string `json:"session_id"`
8686
Sequence uint32 `json:"seq"` // Last sequence number received
8787
}
8888

89-
// https://discord.com/developers/docs/events/gateway#get-gateway-bot
89+
// https://docs.discord.com/developers/events/gateway#get-gateway-bot
9090
type GatewayBot struct {
9191
URL string `json:"url"`
9292
ShardCount uint16 `json:"shards"`
9393
SessionStartLimit SessionStartLimit `json:"session_start_limit"`
9494
}
9595

96-
// https://discord.com/developers/docs/events/gateway#session-start-limit-object
96+
// https://docs.discord.com/developers/events/gateway#session-start-limit-object
9797
type SessionStartLimit struct {
9898
ResetAfter uint32 `json:"reset_after"`
9999
Total uint16 `json:"total"` // max 1000
@@ -111,7 +111,7 @@ const (
111111
OFFLINE_STATUS StatusType = "offline"
112112
)
113113

114-
// https://discord.com/developers/docs/events/gateway-events#activity-object-activity-types
114+
// https://docs.discord.com/developers/events/gateway-events#activity-object-activity-types
115115
type ActivityType uint8
116116

117117
const (
@@ -123,7 +123,7 @@ const (
123123
COMPETING_ACTIVITY_TYPE ActivityType = 5
124124
)
125125

126-
// https://discord.com/developers/docs/events/gateway-events#activity-object
126+
// https://docs.discord.com/developers/events/gateway-events#activity-object
127127
//
128128
// Activity only in context of Discord Bot Presence via Gateway.
129129
type Activity struct {
@@ -132,13 +132,13 @@ type Activity struct {
132132
URL string `json:"url,omitempty"` // Stream URL, only for Streaming type
133133
}
134134

135-
// https://discord.com/developers/docs/events/gateway-events#update-presence
135+
// https://docs.discord.com/developers/events/gateway-events#update-presence
136136
type UpdatePresenceEvent struct {
137137
Opcode Opcode `json:"op"`
138138
Data UpdatePresenceEventData `json:"d"`
139139
}
140140

141-
// https://discord.com/developers/docs/events/gateway-events#update-presence-gateway-presence-update-structure
141+
// https://docs.discord.com/developers/events/gateway-events#update-presence-gateway-presence-update-structure
142142
type UpdatePresenceEventData struct {
143143
Since *int64 `json:"since"` // Unix time (in milliseconds) of when the client went idle, or null if the client is not idle
144144
Activities []Activity `json:"activities"`
@@ -149,7 +149,7 @@ type UpdatePresenceEventData struct {
149149
// Represents the payload for the GUILD_CREATE gateway event.
150150
// It embeds the base Guild object and adds fields unique to this event.
151151
//
152-
// https://discord.com/developers/docs/events/gateway-events#guild-create
152+
// https://docs.discord.com/developers/events/gateway-events#guild-create
153153
type CreateGuildEventData struct {
154154
*Guild
155155

guild.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ package tempest
22

33
import "strings"
44

5-
// https://discord.com/developers/docs/resources/guild#unavailable-guild-object
5+
// https://docs.discord.com/developers/resources/guild#unavailable-guild-object
66
type UnavailableGuild struct {
77
ID Snowflake `json:"id"`
88
Unavailable bool `json:"unavailable"`
99
}
1010

11-
// https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
11+
// https://docs.discord.com/developers/resources/guild#guild-object-default-message-notification-level
1212
type MessageNotificationLevel uint8
1313

1414
const (
1515
ALL_MESSAGES_NOTIFICATION_LEVEL MessageNotificationLevel = iota
1616
ONLY_MENTIONS_NOTIFICATION_LEVEL
1717
)
1818

19-
// https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
19+
// https://docs.discord.com/developers/resources/guild#guild-object-explicit-content-filter-level
2020
type ExplicitContentFilter uint8
2121

2222
const (
@@ -25,15 +25,15 @@ const (
2525
ALL_MEMBERS_CONTENT_FILTER
2626
)
2727

28-
// https://discord.com/developers/docs/resources/guild#guild-object-mfa-level
28+
// https://docs.discord.com/developers/resources/guild#guild-object-mfa-level
2929
type MFALevel uint8
3030

3131
const (
3232
NONE_MFA_LEVEL MFALevel = iota
3333
ELEVATED_MFA_LEVEL
3434
)
3535

36-
// https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
36+
// https://docs.discord.com/developers/resources/guild#guild-object-system-channel-flags
3737
type SystemChannelFlags BitSet
3838

3939
const (
@@ -45,7 +45,7 @@ const (
4545
SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATION_REPLIES_SYSTEM_FLAG
4646
)
4747

48-
// https://discord.com/developers/docs/resources/guild#guild-object-premium-tier
48+
// https://docs.discord.com/developers/resources/guild#guild-object-premium-tier
4949
type PremiumTier uint8
5050

5151
const (
@@ -55,7 +55,7 @@ const (
5555
BOOST_3_PREMIUM_TIER
5656
)
5757

58-
// https://discord.com/developers/docs/resources/guild#guild-object-guild-structure
58+
// https://docs.discord.com/developers/resources/guild#guild-object-guild-structure
5959
type Guild struct {
6060
ID Snowflake `json:"id"`
6161
Name string `json:"name"`
@@ -71,7 +71,7 @@ type Guild struct {
7171
ExplicitContentFilter ExplicitContentFilter `json:"explicit_content_filter"`
7272
Roles []Role `json:"roles,omitzero"`
7373
Emojis []Emoji `json:"emojis,omitzero"`
74-
Features []string `json:"features,omitzero"` // // https://discord.com/developers/docs/resources/guild#guild-object-guild-features
74+
Features []string `json:"features,omitzero"` // // https://docs.discord.com/developers/resources/guild#guild-object-guild-features
7575
MFALevel MFALevel `json:"mfa_level"`
7676
ApplicationID Snowflake `json:"application_id,omitempty"` // Application id of the guild creator if it is bot-created (never seen it in use).
7777
SystemChannelID Snowflake `json:"system_channel_id,omitempty"`

0 commit comments

Comments
 (0)