mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
refactor: rename *ID to *Id (#710)
* refactor: rename *ID to *Id * Update src/helpers/commands/delete_slash_command.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/helpers/commands/delete_slash_command.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/helpers/commands/delete_slash_response.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/helpers/commands/edit_slash_response.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/util/utils.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/util/utils.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/util/utils.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/util/utils.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/util/utils.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/helpers/commands/get_slash_command.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/helpers/commands/send_interaction_response.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/helpers/commands/upsert_slash_command.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/helpers/guilds/edit_widget.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/helpers/guilds/get_widget.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/helpers/guilds/get_widget.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/helpers/guilds/get_widget_image_url.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/helpers/guilds/get_widget_image_url.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/helpers/guilds/get_widget_settings.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update .gitignore Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update LICENSE Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/helpers/members/edit_bot_profile.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/helpers/members/edit_bot_profile.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/helpers/webhooks/create_webhook.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/helpers/webhooks/delete_webhook.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/util/constants.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/helpers/webhooks/edit_webhook.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/helpers/webhooks/execute_webhook.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/helpers/webhooks/get_webhook.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/rest/cache.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/rest/request.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/util/constants.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/helpers/commands/delete_slash_response.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/util/constants.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/util/constants.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/util/constants.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/util/constants.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/util/utils.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Update src/util/utils.ts Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> * Revert docs file Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>
This commit is contained in:
@@ -7,18 +7,18 @@ import {
|
||||
|
||||
/** Update a channel's settings. Requires the `MANAGE_CHANNELS` permission for the guild. */
|
||||
export async function editChannel(
|
||||
channelID: string,
|
||||
channelId: string,
|
||||
options: ChannelEditOptions,
|
||||
reason?: string,
|
||||
) {
|
||||
await requireBotChannelPermissions(channelID, ["MANAGE_CHANNELS"]);
|
||||
await requireBotChannelPermissions(channelId, ["MANAGE_CHANNELS"]);
|
||||
|
||||
if (options.name || options.topic) {
|
||||
const request = editChannelNameTopicQueue.get(channelID);
|
||||
const request = editChannelNameTopicQueue.get(channelId);
|
||||
if (!request) {
|
||||
// If this hasnt been done before simply add 1 for it
|
||||
editChannelNameTopicQueue.set(channelID, {
|
||||
channelID: channelID,
|
||||
editChannelNameTopicQueue.set(channelId, {
|
||||
channelId: channelId,
|
||||
amount: 1,
|
||||
// 10 minutes from now
|
||||
timestamp: Date.now() + 600000,
|
||||
@@ -30,7 +30,7 @@ export async function editChannel(
|
||||
request.timestamp = Date.now() + 600000;
|
||||
} else {
|
||||
// 2 have already been used add to queue
|
||||
request.items.push({ channelID, options });
|
||||
request.items.push({ channelId, options });
|
||||
if (editChannelProcessing) return;
|
||||
editChannelProcessing = true;
|
||||
processEditChannelQueue();
|
||||
@@ -43,7 +43,7 @@ export async function editChannel(
|
||||
// deno-lint-ignore camelcase
|
||||
rate_limit_per_user: options.rateLimitPerUser,
|
||||
// deno-lint-ignore camelcase
|
||||
parent_id: options.parentID,
|
||||
parent_id: options.parentId,
|
||||
// deno-lint-ignore camelcase
|
||||
user_limit: options.userLimit,
|
||||
// deno-lint-ignore camelcase
|
||||
@@ -56,7 +56,7 @@ export async function editChannel(
|
||||
}),
|
||||
};
|
||||
|
||||
const result = await RequestManager.patch(endpoints.CHANNEL_BASE(channelID), {
|
||||
const result = await RequestManager.patch(endpoints.CHANNEL_BASE(channelId), {
|
||||
...payload,
|
||||
reason,
|
||||
});
|
||||
@@ -75,7 +75,7 @@ function processEditChannelQueue() {
|
||||
if (now > request.timestamp) return;
|
||||
// 10 minutes have passed so we can reset this channel again
|
||||
if (!request.items.length) {
|
||||
return editChannelNameTopicQueue.delete(request.channelID);
|
||||
return editChannelNameTopicQueue.delete(request.channelId);
|
||||
}
|
||||
request.amount = 0;
|
||||
// There are items to process for this request
|
||||
@@ -83,11 +83,11 @@ function processEditChannelQueue() {
|
||||
|
||||
if (!details) return;
|
||||
|
||||
editChannel(details.channelID, details.options);
|
||||
editChannel(details.channelId, details.options);
|
||||
const secondDetails = request.items.shift();
|
||||
if (!secondDetails) return;
|
||||
|
||||
return editChannel(secondDetails.channelID, secondDetails.options);
|
||||
return editChannel(secondDetails.channelId, secondDetails.options);
|
||||
});
|
||||
|
||||
if (editChannelNameTopicQueue.size) {
|
||||
|
||||
Reference in New Issue
Block a user