|
1 | 1 | local future = require("../luau_packages/future") |
2 | 2 | local apiTypes = require("../luau_packages/api_types") |
| 3 | +local stdPolyfills = require("../lune_packages/std_polyfills") |
3 | 4 |
|
4 | 5 | local request = require("./request") |
5 | 6 |
|
@@ -61,7 +62,7 @@ function commands.createGlobalApplicationCommandAsync( |
61 | 62 |
|
62 | 63 | instance:setMethod("POST") |
63 | 64 | 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)) |
65 | 66 |
|
66 | 67 | local response = instance:executeAsync():await() |
67 | 68 |
|
@@ -117,7 +118,7 @@ function commands.editGlobalApplicationCommandAsync( |
117 | 118 |
|
118 | 119 | instance:setMethod("PATCH") |
119 | 120 | 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)) |
121 | 122 |
|
122 | 123 | local response = instance:executeAsync():await() |
123 | 124 |
|
@@ -175,7 +176,7 @@ function commands.bulkOverwriteGlobalApplicationCommandsAsync( |
175 | 176 | instance:setUrl( |
176 | 177 | string.format(apiTypes.rest.endpoints.BulkOverwriteGlobalApplicationCommands, applicationId) |
177 | 178 | ) |
178 | | - instance:setBody(apiTypes.rest.endpoints.encode("json", jsonParams, true)) |
| 179 | + instance:setBody(stdPolyfills.serde.encode("json", jsonParams, true)) |
179 | 180 |
|
180 | 181 | local response = instance:executeAsync():await() |
181 | 182 |
|
@@ -237,7 +238,7 @@ function commands.createGuildApplicationCommandAsync( |
237 | 238 |
|
238 | 239 | instance:setMethod("POST") |
239 | 240 | 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)) |
241 | 242 |
|
242 | 243 | local response = instance:executeAsync():await() |
243 | 244 |
|
@@ -299,7 +300,7 @@ function commands.editGuildApplicationCommandAsync( |
299 | 300 | instance:setUrl( |
300 | 301 | string.format(apiTypes.rest.endpoints.EditGuildApplicationCommand, applicationId, guildId, commandId) |
301 | 302 | ) |
302 | | - instance:setBody(apiTypes.rest.endpoints.encode("json", jsonParams, true)) |
| 303 | + instance:setBody(stdPolyfills.serde.encode("json", jsonParams, true)) |
303 | 304 |
|
304 | 305 | local response = instance:executeAsync():await() |
305 | 306 |
|
@@ -361,7 +362,7 @@ function commands.bulkOverwriteGuildApplicationCommandsAsync( |
361 | 362 | instance:setUrl( |
362 | 363 | string.format(apiTypes.rest.endpoints.BulkOverwriteGuildApplicationCommands, applicationId, guildId) |
363 | 364 | ) |
364 | | - instance:setBody(apiTypes.rest.endpoints.encode("json", jsonParams, true)) |
| 365 | + instance:setBody(stdPolyfills.serde.encode("json", jsonParams, true)) |
365 | 366 |
|
366 | 367 | local response = instance:executeAsync():await() |
367 | 368 |
|
@@ -468,7 +469,7 @@ function commands.editApplicationCommandPermissionsAsync( |
468 | 469 | commandId |
469 | 470 | ) |
470 | 471 | ) |
471 | | - instance:setBody(apiTypes.rest.endpoints.encode("json", jsonParams, true)) |
| 472 | + instance:setBody(stdPolyfills.serde.encode("json", jsonParams, true)) |
472 | 473 |
|
473 | 474 | local response = instance:executeAsync():await() |
474 | 475 |
|
|
0 commit comments