mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
perf(plugins/helpers,rest,site,template)!: uppercase rest methods (#2252)
* perf(plugins/helpers,rest,site,template)!: uppercase rest methods There is no need for us to pass the methods in lower case and then use the `toUpperCase()` method everywhere. Therefore this PR changes every lowercase method to be uppercase (eg. `"get"` => `"GET"`). * template is old version
This commit is contained in:
@@ -91,7 +91,7 @@ const rest = createRestManager({
|
||||
});
|
||||
|
||||
// CALL THE REST PROCESS TO GET GATEWAY DATA
|
||||
const result = await rest.runMethod(rest, "get", endpoints.GATEWAY_BOT).then((res) => ({
|
||||
const result = await rest.runMethod(rest, "GET", endpoints.GATEWAY_BOT).then((res) => ({
|
||||
url: res.url,
|
||||
shards: res.shards,
|
||||
sessionStartLimit: {
|
||||
@@ -302,7 +302,7 @@ async function handleInteractionQueueing(gateway: GatewayManager, data: GatewayP
|
||||
if ([InteractionTypes.ModalSubmit, InteractionTypes.ApplicationCommandAutocomplete].includes(interaction.type)) {
|
||||
return await rest.runMethod(
|
||||
rest,
|
||||
"post",
|
||||
"POST",
|
||||
endpoints.INTERACTION_ID_TOKEN(BigInt(interaction.id), interaction.token),
|
||||
{
|
||||
type: InteractionResponseTypes.ChannelMessageWithSource,
|
||||
@@ -314,7 +314,7 @@ async function handleInteractionQueueing(gateway: GatewayManager, data: GatewayP
|
||||
);
|
||||
}
|
||||
|
||||
await rest.runMethod(rest, "post", endpoints.INTERACTION_ID_TOKEN(BigInt(interaction.id), interaction.token), {
|
||||
await rest.runMethod(rest, "POST", endpoints.INTERACTION_ID_TOKEN(BigInt(interaction.id), interaction.token), {
|
||||
// MESSAGE COMPONENTS NEED SPECIAL DEFER
|
||||
type: InteractionTypes.MessageComponent === interaction.type
|
||||
? InteractionResponseTypes.DeferredUpdateMessage
|
||||
@@ -474,7 +474,7 @@ async function handleInteractionQueueing(gateway: GatewayManager, data: GatewayP
|
||||
if ([InteractionTypes.ModalSubmit, InteractionTypes.ApplicationCommandAutocomplete].includes(interaction.type)) {
|
||||
return await rest.runMethod(
|
||||
rest,
|
||||
"post",
|
||||
"POST",
|
||||
endpoints.INTERACTION_ID_TOKEN(BigInt(interaction.id), interaction.token),
|
||||
{
|
||||
type: InteractionResponseTypes.ChannelMessageWithSource,
|
||||
@@ -486,7 +486,7 @@ async function handleInteractionQueueing(gateway: GatewayManager, data: GatewayP
|
||||
);
|
||||
}
|
||||
|
||||
await rest.runMethod(rest, "post", endpoints.INTERACTION_ID_TOKEN(BigInt(interaction.id), interaction.token), {
|
||||
await rest.runMethod(rest, "POST", endpoints.INTERACTION_ID_TOKEN(BigInt(interaction.id), interaction.token), {
|
||||
// MESSAGE COMPONENTS NEED SPECIAL DEFER
|
||||
type: InteractionTypes.MessageComponent === interaction.type
|
||||
? InteractionResponseTypes.DeferredUpdateMessage
|
||||
|
||||
Reference in New Issue
Block a user