Skip to content

Commit 70bb832

Browse files
committed
fix: fix minor type errors in interaction/command objects
1 parent 0cff998 commit 70bb832

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

packages/builders/src/interaction/option.luau

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ function Option.Prototype.build(self: Option): JSON
210210
assert(self.description, `Missing description for option: {self.name}`)
211211

212212
return {
213-
type = apiTypes.interaction.InteractionType[self.type],
213+
type = apiTypes.interaction.ApplicationCommandOptionType[self.type],
214214
channel_types = channelTypeArray,
215215
name = self.name,
216216
name_localizations = self.nameLocalizations,

packages/rest/src/commands.luau

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
local future = require("../luau_packages/future")
22
local apiTypes = require("../luau_packages/api_types")
3+
local stdPolyfills = require("../lune_packages/std_polyfills")
34

45
local request = require("./request")
56

@@ -61,7 +62,7 @@ function commands.createGlobalApplicationCommandAsync(
6162

6263
instance:setMethod("POST")
6364
instance:setUrl(string.format(apiTypes.rest.endpoints.CreateGlobalApplicationCommand, applicationId))
64-
instance:setBody(apiTypes.rest.endpoints.encode("json", jsonParams, true))
65+
instance:setBody(stdPolyfills.serde.encode("json", jsonParams, true))
6566

6667
local response = instance:executeAsync():await()
6768

@@ -117,7 +118,7 @@ function commands.editGlobalApplicationCommandAsync(
117118

118119
instance:setMethod("PATCH")
119120
instance:setUrl(string.format(apiTypes.rest.endpoints.EditGlobalApplicationCommand, applicationId, commandId))
120-
instance:setBody(apiTypes.rest.endpoints.encode("json", jsonParams, true))
121+
instance:setBody(stdPolyfills.serde.encode("json", jsonParams, true))
121122

122123
local response = instance:executeAsync():await()
123124

@@ -175,7 +176,7 @@ function commands.bulkOverwriteGlobalApplicationCommandsAsync(
175176
instance:setUrl(
176177
string.format(apiTypes.rest.endpoints.BulkOverwriteGlobalApplicationCommands, applicationId)
177178
)
178-
instance:setBody(apiTypes.rest.endpoints.encode("json", jsonParams, true))
179+
instance:setBody(stdPolyfills.serde.encode("json", jsonParams, true))
179180

180181
local response = instance:executeAsync():await()
181182

@@ -237,7 +238,7 @@ function commands.createGuildApplicationCommandAsync(
237238

238239
instance:setMethod("POST")
239240
instance:setUrl(string.format(apiTypes.rest.endpoints.CreateGuildApplicationCommand, applicationId, guildId))
240-
instance:setBody(apiTypes.rest.endpoints.encode("json", jsonParams, true))
241+
instance:setBody(stdPolyfills.serde.encode("json", jsonParams, true))
241242

242243
local response = instance:executeAsync():await()
243244

@@ -299,7 +300,7 @@ function commands.editGuildApplicationCommandAsync(
299300
instance:setUrl(
300301
string.format(apiTypes.rest.endpoints.EditGuildApplicationCommand, applicationId, guildId, commandId)
301302
)
302-
instance:setBody(apiTypes.rest.endpoints.encode("json", jsonParams, true))
303+
instance:setBody(stdPolyfills.serde.encode("json", jsonParams, true))
303304

304305
local response = instance:executeAsync():await()
305306

@@ -361,7 +362,7 @@ function commands.bulkOverwriteGuildApplicationCommandsAsync(
361362
instance:setUrl(
362363
string.format(apiTypes.rest.endpoints.BulkOverwriteGuildApplicationCommands, applicationId, guildId)
363364
)
364-
instance:setBody(apiTypes.rest.endpoints.encode("json", jsonParams, true))
365+
instance:setBody(stdPolyfills.serde.encode("json", jsonParams, true))
365366

366367
local response = instance:executeAsync():await()
367368

@@ -468,7 +469,7 @@ function commands.editApplicationCommandPermissionsAsync(
468469
commandId
469470
)
470471
)
471-
instance:setBody(apiTypes.rest.endpoints.encode("json", jsonParams, true))
472+
instance:setBody(stdPolyfills.serde.encode("json", jsonParams, true))
472473

473474
local response = instance:executeAsync():await()
474475

0 commit comments

Comments
 (0)