From 707b096360044bd3a5bc0477aee02f323f04d415 Mon Sep 17 00:00:00 2001 From: ITOH <72305210+itohatweb@users.noreply.github.com> Date: Tue, 6 Apr 2021 22:07:15 +0200 Subject: [PATCH] f --- src/helpers/channels/delete_channel.ts | 2 +- src/helpers/channels/delete_channel_overwrite.ts | 2 +- src/helpers/channels/edit_channel.ts | 5 +++-- src/helpers/channels/edit_channel_overwrite.ts | 2 +- src/helpers/channels/start_typing.ts | 2 +- src/helpers/channels/swap_channels.ts | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/helpers/channels/delete_channel.ts b/src/helpers/channels/delete_channel.ts index 764c73844..cd384bbfa 100644 --- a/src/helpers/channels/delete_channel.ts +++ b/src/helpers/channels/delete_channel.ts @@ -9,7 +9,7 @@ export async function deleteChannel( guildId: string, channelId: string, reason?: string, -) { +): Promise { await requireBotGuildPermissions(guildId, ["MANAGE_CHANNELS"]); const guild = await cacheHandlers.get("guilds", guildId); diff --git a/src/helpers/channels/delete_channel_overwrite.ts b/src/helpers/channels/delete_channel_overwrite.ts index 3b39301e7..da9f04a4f 100644 --- a/src/helpers/channels/delete_channel_overwrite.ts +++ b/src/helpers/channels/delete_channel_overwrite.ts @@ -7,7 +7,7 @@ export async function deleteChannelOverwrite( guildId: string, channelId: string, overwriteId: string, -) { +): Promise { await requireBotGuildPermissions(guildId, ["MANAGE_ROLES"]); const result = await rest.runMethod( diff --git a/src/helpers/channels/edit_channel.ts b/src/helpers/channels/edit_channel.ts index b6a7eb6a6..cd0ce83b1 100644 --- a/src/helpers/channels/edit_channel.ts +++ b/src/helpers/channels/edit_channel.ts @@ -1,4 +1,5 @@ import { rest } from "../../rest/rest.ts"; +import { ModifyChannel } from "../../types/channels/modify_channel.ts"; import { endpoints } from "../../util/constants.ts"; import { calculateBits, @@ -8,7 +9,7 @@ import { /** Update a channel's settings. Requires the `MANAGE_CHANNELS` permission for the guild. */ export async function editChannel( channelId: string, - options: ChannelEditOptions, + options: ModifyChannel, reason?: string, ) { await requireBotChannelPermissions(channelId, ["MANAGE_CHANNELS"]); @@ -47,7 +48,7 @@ export async function editChannel( // deno-lint-ignore camelcase user_limit: options.userLimit, // deno-lint-ignore camelcase - permission_overwrites: options.overwrites?.map((overwrite) => { + permission_overwrites: options.permissionOverwrites?.map((overwrite) => { return { ...overwrite, allow: calculateBits(overwrite.allow), diff --git a/src/helpers/channels/edit_channel_overwrite.ts b/src/helpers/channels/edit_channel_overwrite.ts index 451dd6f08..e6caad9b0 100644 --- a/src/helpers/channels/edit_channel_overwrite.ts +++ b/src/helpers/channels/edit_channel_overwrite.ts @@ -12,7 +12,7 @@ export async function editChannelOverwrite( channelId: string, overwriteId: string, options: Omit, -) { +): Promise { await requireBotGuildPermissions(guildId, ["MANAGE_ROLES"]); const result = await rest.runMethod( diff --git a/src/helpers/channels/start_typing.ts b/src/helpers/channels/start_typing.ts index ca181dcbe..c5cf0144b 100644 --- a/src/helpers/channels/start_typing.ts +++ b/src/helpers/channels/start_typing.ts @@ -10,7 +10,7 @@ import { botHasChannelPermissions } from "../../util/permissions.ts"; * However, if a bot is responding to a command and expects the computation to take a few seconds, * this endpoint may be called to let the user know that the bot is processing their message. */ -export async function startTyping(channelId: string) { +export async function startTyping(channelId: string): Promise { const channel = await cacheHandlers.get("channels", channelId); // If the channel is cached, we can do extra checks/safety if (channel) { diff --git a/src/helpers/channels/swap_channels.ts b/src/helpers/channels/swap_channels.ts index 8b3662278..9c6801c36 100644 --- a/src/helpers/channels/swap_channels.ts +++ b/src/helpers/channels/swap_channels.ts @@ -6,7 +6,7 @@ import { endpoints } from "../../util/constants.ts"; export async function swapChannels( guildId: string, channelPositions: ModifyGuildChannelPositions[], -) { +): Promise { if (channelPositions.length < 2) { throw "You must provide at least two channels to be swapped."; }