|
1 | 1 | /* eslint-disable jsdoc/check-param-names */ |
2 | 2 |
|
3 | 3 | import { makeURLSearchParams, type REST, type RawFile, type RequestData } from '@discordjs/rest'; |
4 | | -import { Routes } from 'discord-api-types/v10'; |
5 | | -import type { |
6 | | - RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, |
7 | | - RESTPatchAPIGuildVoiceStateCurrentMemberResult, |
8 | | - GuildMFALevel, |
9 | | - GuildWidgetStyle, |
10 | | - RESTGetAPIAuditLogQuery, |
11 | | - RESTGetAPIAuditLogResult, |
12 | | - RESTGetAPIAutoModerationRuleResult, |
13 | | - RESTGetAPIAutoModerationRulesResult, |
14 | | - RESTGetAPIGuildBanResult, |
15 | | - RESTGetAPIGuildBansQuery, |
16 | | - RESTGetAPIGuildBansResult, |
17 | | - RESTGetAPIGuildChannelsResult, |
18 | | - RESTGetAPIGuildEmojiResult, |
19 | | - RESTGetAPIGuildEmojisResult, |
20 | | - RESTGetAPIGuildIntegrationsResult, |
21 | | - RESTGetAPIGuildInvitesResult, |
22 | | - RESTGetAPIGuildMemberResult, |
23 | | - RESTGetAPIGuildMembersResult, |
24 | | - RESTGetAPIGuildMembersQuery, |
25 | | - RESTGetAPIGuildMembersSearchResult, |
26 | | - RESTGetAPIGuildPreviewResult, |
27 | | - RESTGetAPIGuildPruneCountResult, |
28 | | - RESTGetAPIGuildResult, |
29 | | - RESTGetAPIGuildRolesResult, |
30 | | - RESTGetAPIGuildScheduledEventQuery, |
31 | | - RESTGetAPIGuildScheduledEventResult, |
32 | | - RESTGetAPIGuildScheduledEventsQuery, |
33 | | - RESTGetAPIGuildScheduledEventsResult, |
34 | | - RESTGetAPIGuildScheduledEventUsersQuery, |
35 | | - RESTGetAPIGuildScheduledEventUsersResult, |
36 | | - RESTGetAPIGuildStickerResult, |
37 | | - RESTGetAPIGuildStickersResult, |
38 | | - RESTGetAPIGuildTemplatesResult, |
39 | | - RESTGetAPIGuildThreadsResult, |
40 | | - RESTGetAPIGuildVanityUrlResult, |
41 | | - RESTGetAPIGuildVoiceRegionsResult, |
42 | | - RESTGetAPIGuildPruneCountQuery, |
43 | | - RESTPostAPIGuildStickerFormDataBody, |
44 | | - RESTPostAPIGuildStickerResult, |
45 | | - RESTGetAPIGuildMembersSearchQuery, |
46 | | - RESTGetAPIGuildWebhooksResult, |
47 | | - RESTGetAPIGuildWelcomeScreenResult, |
48 | | - RESTGetAPIGuildWidgetImageResult, |
49 | | - RESTGetAPIGuildWidgetJSONResult, |
50 | | - RESTGetAPIGuildWidgetSettingsResult, |
51 | | - RESTGetAPITemplateResult, |
52 | | - RESTPatchAPIAutoModerationRuleJSONBody, |
53 | | - RESTPatchAPIAutoModerationRuleResult, |
54 | | - RESTPatchAPIGuildChannelPositionsJSONBody, |
55 | | - RESTPatchAPIGuildEmojiJSONBody, |
56 | | - RESTPatchAPIGuildEmojiResult, |
57 | | - RESTPatchAPIGuildJSONBody, |
58 | | - RESTPatchAPIGuildMemberJSONBody, |
59 | | - RESTPatchAPIGuildMemberResult, |
60 | | - RESTPatchAPIGuildResult, |
61 | | - RESTPatchAPIGuildRoleJSONBody, |
62 | | - RESTPatchAPIGuildRolePositionsJSONBody, |
63 | | - RESTPatchAPIGuildRolePositionsResult, |
64 | | - RESTPatchAPIGuildRoleResult, |
65 | | - RESTPatchAPIGuildScheduledEventJSONBody, |
66 | | - RESTPatchAPIGuildScheduledEventResult, |
67 | | - RESTPatchAPIGuildStickerJSONBody, |
68 | | - RESTPatchAPIGuildStickerResult, |
69 | | - RESTPatchAPIGuildTemplateJSONBody, |
70 | | - RESTPatchAPIGuildTemplateResult, |
71 | | - RESTPatchAPIGuildVoiceStateUserJSONBody, |
72 | | - RESTPatchAPIGuildWelcomeScreenJSONBody, |
73 | | - RESTPatchAPIGuildWelcomeScreenResult, |
74 | | - RESTPatchAPIGuildWidgetSettingsJSONBody, |
75 | | - RESTPatchAPIGuildWidgetSettingsResult, |
76 | | - RESTPostAPIAutoModerationRuleJSONBody, |
77 | | - RESTPostAPIAutoModerationRuleResult, |
78 | | - RESTPostAPIGuildChannelJSONBody, |
79 | | - RESTPostAPIGuildChannelResult, |
80 | | - RESTPostAPIGuildEmojiJSONBody, |
81 | | - RESTPostAPIGuildEmojiResult, |
82 | | - RESTPostAPIGuildPruneJSONBody, |
83 | | - RESTPostAPIGuildPruneResult, |
84 | | - RESTPostAPIGuildRoleJSONBody, |
85 | | - RESTPostAPIGuildRoleResult, |
86 | | - RESTPostAPIGuildScheduledEventJSONBody, |
87 | | - RESTPostAPIGuildScheduledEventResult, |
88 | | - RESTPostAPIGuildsJSONBody, |
89 | | - RESTPostAPIGuildsMFAResult, |
90 | | - RESTPostAPIGuildsResult, |
91 | | - RESTPostAPIGuildTemplatesJSONBody, |
92 | | - RESTPostAPIGuildTemplatesResult, |
93 | | - RESTPutAPIGuildBanJSONBody, |
94 | | - RESTPutAPIGuildTemplateSyncResult, |
95 | | - Snowflake, |
| 4 | +import { |
| 5 | + Routes, |
| 6 | + type GuildMFALevel, |
| 7 | + type GuildWidgetStyle, |
| 8 | + type RESTGetAPIAuditLogQuery, |
| 9 | + type RESTGetAPIAuditLogResult, |
| 10 | + type RESTGetAPIAutoModerationRuleResult, |
| 11 | + type RESTGetAPIAutoModerationRulesResult, |
| 12 | + type RESTGetAPIGuildBanResult, |
| 13 | + type RESTGetAPIGuildBansQuery, |
| 14 | + type RESTGetAPIGuildBansResult, |
| 15 | + type RESTGetAPIGuildChannelsResult, |
| 16 | + type RESTGetAPIGuildEmojiResult, |
| 17 | + type RESTGetAPIGuildEmojisResult, |
| 18 | + type RESTGetAPIGuildIntegrationsResult, |
| 19 | + type RESTGetAPIGuildInvitesResult, |
| 20 | + type RESTGetAPIGuildMemberResult, |
| 21 | + type RESTGetAPIGuildMembersQuery, |
| 22 | + type RESTGetAPIGuildMembersResult, |
| 23 | + type RESTGetAPIGuildMembersSearchQuery, |
| 24 | + type RESTGetAPIGuildMembersSearchResult, |
| 25 | + type RESTGetAPIGuildOnboardingResult, |
| 26 | + type RESTGetAPIGuildPreviewResult, |
| 27 | + type RESTGetAPIGuildPruneCountQuery, |
| 28 | + type RESTGetAPIGuildPruneCountResult, |
| 29 | + type RESTGetAPIGuildResult, |
| 30 | + type RESTGetAPIGuildRolesResult, |
| 31 | + type RESTGetAPIGuildScheduledEventQuery, |
| 32 | + type RESTGetAPIGuildScheduledEventResult, |
| 33 | + type RESTGetAPIGuildScheduledEventUsersQuery, |
| 34 | + type RESTGetAPIGuildScheduledEventUsersResult, |
| 35 | + type RESTGetAPIGuildScheduledEventsQuery, |
| 36 | + type RESTGetAPIGuildScheduledEventsResult, |
| 37 | + type RESTGetAPIGuildStickerResult, |
| 38 | + type RESTGetAPIGuildStickersResult, |
| 39 | + type RESTGetAPIGuildTemplatesResult, |
| 40 | + type RESTGetAPIGuildThreadsResult, |
| 41 | + type RESTGetAPIGuildVanityUrlResult, |
| 42 | + type RESTGetAPIGuildVoiceRegionsResult, |
| 43 | + type RESTGetAPIGuildWebhooksResult, |
| 44 | + type RESTGetAPIGuildWelcomeScreenResult, |
| 45 | + type RESTGetAPIGuildWidgetImageResult, |
| 46 | + type RESTGetAPIGuildWidgetJSONResult, |
| 47 | + type RESTGetAPIGuildWidgetSettingsResult, |
| 48 | + type RESTGetAPITemplateResult, |
| 49 | + type RESTPatchAPIAutoModerationRuleJSONBody, |
| 50 | + type RESTPatchAPIAutoModerationRuleResult, |
| 51 | + type RESTPatchAPIGuildChannelPositionsJSONBody, |
| 52 | + type RESTPatchAPIGuildEmojiJSONBody, |
| 53 | + type RESTPatchAPIGuildEmojiResult, |
| 54 | + type RESTPatchAPIGuildJSONBody, |
| 55 | + type RESTPatchAPIGuildMemberJSONBody, |
| 56 | + type RESTPatchAPIGuildMemberResult, |
| 57 | + type RESTPatchAPIGuildResult, |
| 58 | + type RESTPatchAPIGuildRoleJSONBody, |
| 59 | + type RESTPatchAPIGuildRolePositionsJSONBody, |
| 60 | + type RESTPatchAPIGuildRolePositionsResult, |
| 61 | + type RESTPatchAPIGuildRoleResult, |
| 62 | + type RESTPatchAPIGuildScheduledEventJSONBody, |
| 63 | + type RESTPatchAPIGuildScheduledEventResult, |
| 64 | + type RESTPatchAPIGuildStickerJSONBody, |
| 65 | + type RESTPatchAPIGuildStickerResult, |
| 66 | + type RESTPatchAPIGuildTemplateJSONBody, |
| 67 | + type RESTPatchAPIGuildTemplateResult, |
| 68 | + type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, |
| 69 | + type RESTPatchAPIGuildVoiceStateCurrentMemberResult, |
| 70 | + type RESTPatchAPIGuildVoiceStateUserJSONBody, |
| 71 | + type RESTPatchAPIGuildWelcomeScreenJSONBody, |
| 72 | + type RESTPatchAPIGuildWelcomeScreenResult, |
| 73 | + type RESTPatchAPIGuildWidgetSettingsJSONBody, |
| 74 | + type RESTPatchAPIGuildWidgetSettingsResult, |
| 75 | + type RESTPostAPIAutoModerationRuleJSONBody, |
| 76 | + type RESTPostAPIAutoModerationRuleResult, |
| 77 | + type RESTPostAPIGuildChannelJSONBody, |
| 78 | + type RESTPostAPIGuildChannelResult, |
| 79 | + type RESTPostAPIGuildEmojiJSONBody, |
| 80 | + type RESTPostAPIGuildEmojiResult, |
| 81 | + type RESTPostAPIGuildPruneJSONBody, |
| 82 | + type RESTPostAPIGuildPruneResult, |
| 83 | + type RESTPostAPIGuildRoleJSONBody, |
| 84 | + type RESTPostAPIGuildRoleResult, |
| 85 | + type RESTPostAPIGuildScheduledEventJSONBody, |
| 86 | + type RESTPostAPIGuildScheduledEventResult, |
| 87 | + type RESTPostAPIGuildStickerFormDataBody, |
| 88 | + type RESTPostAPIGuildStickerResult, |
| 89 | + type RESTPostAPIGuildTemplatesJSONBody, |
| 90 | + type RESTPostAPIGuildTemplatesResult, |
| 91 | + type RESTPostAPIGuildsJSONBody, |
| 92 | + type RESTPostAPIGuildsMFAResult, |
| 93 | + type RESTPostAPIGuildsResult, |
| 94 | + type RESTPutAPIGuildBanJSONBody, |
| 95 | + type RESTPutAPIGuildTemplateSyncResult, |
| 96 | + type Snowflake, |
96 | 97 | } from 'discord-api-types/v10'; |
97 | 98 |
|
98 | 99 | export class GuildsAPI { |
@@ -1229,4 +1230,15 @@ export class GuildsAPI { |
1229 | 1230 | body, |
1230 | 1231 | }) as Promise<RESTPatchAPIGuildVoiceStateCurrentMemberResult>; |
1231 | 1232 | } |
| 1233 | + |
| 1234 | + /** |
| 1235 | + * Fetches a guild onboarding |
| 1236 | + * |
| 1237 | + * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-onboarding} |
| 1238 | + * @param guildId - The id of the guild |
| 1239 | + * @param options - The options for fetching the guild onboarding |
| 1240 | + */ |
| 1241 | + public async getOnboarding(guildId: Snowflake, { signal }: Pick<RequestData, 'signal'> = {}) { |
| 1242 | + return this.rest.get(Routes.guildOnboarding(guildId), { signal }) as Promise<RESTGetAPIGuildOnboardingResult>; |
| 1243 | + } |
1232 | 1244 | } |
0 commit comments