@@ -23,6 +23,7 @@ import type {
23
23
RESTGetAPIGuildMembersResult ,
24
24
RESTGetAPIGuildMembersQuery ,
25
25
RESTGetAPIGuildMembersSearchResult ,
26
+ RESTGetAPIGuildOnboardingResult ,
26
27
RESTGetAPIGuildPreviewResult ,
27
28
RESTGetAPIGuildPruneCountResult ,
28
29
RESTGetAPIGuildResult ,
@@ -79,6 +80,8 @@ import type {
79
80
RESTPostAPIGuildChannelResult ,
80
81
RESTPostAPIGuildEmojiJSONBody ,
81
82
RESTPostAPIGuildEmojiResult ,
83
+ RESTPutAPIGuildOnboardingJSONBody ,
84
+ RESTPutAPIGuildOnboardingResult ,
82
85
RESTPostAPIGuildPruneJSONBody ,
83
86
RESTPostAPIGuildPruneResult ,
84
87
RESTPostAPIGuildRoleJSONBody ,
@@ -1229,4 +1232,37 @@ export class GuildsAPI {
1229
1232
body,
1230
1233
} ) as Promise < RESTPatchAPIGuildVoiceStateCurrentMemberResult > ;
1231
1234
}
1235
+
1236
+ /**
1237
+ * Fetches a guild onboarding
1238
+ *
1239
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-onboarding }
1240
+ * @param guildId - The id of the guild to fetch the onboarding from
1241
+ * @param options - The options for fetching the guild onboarding
1242
+ */
1243
+ public async getOnboarding ( guildId : Snowflake , { signal } : Pick < RequestData , 'signal' > = { } ) {
1244
+ return this . rest . get ( Routes . guildOnboarding ( guildId ) , {
1245
+ signal,
1246
+ } ) as Promise < RESTGetAPIGuildOnboardingResult > ;
1247
+ }
1248
+
1249
+ /**
1250
+ * Edits the widget settings for a guild
1251
+ *
1252
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-onboarding }
1253
+ * @param guildId - The id of the guild to edit the onboarding settings from
1254
+ * @param body - The new onboarding settings data
1255
+ * @param options - The options for editing the onboarding
1256
+ */
1257
+ public async editOnboarding (
1258
+ guildId : Snowflake ,
1259
+ body : RESTPutAPIGuildOnboardingJSONBody ,
1260
+ { reason, signal } : Pick < RequestData , 'reason' | 'signal' > = { } ,
1261
+ ) {
1262
+ return this . rest . patch ( Routes . guildWidgetSettings ( guildId ) , {
1263
+ reason,
1264
+ body,
1265
+ signal,
1266
+ } ) as Promise < RESTPutAPIGuildOnboardingResult > ;
1267
+ }
1232
1268
}
0 commit comments