From 751f719a8775333af78868bbd1afba29697664d3 Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Sun, 20 Mar 2022 12:17:42 +0000 Subject: [PATCH] fix: helper plugin errors --- plugins/helpers/src/channels.ts | 4 ++-- plugins/helpers/src/getMembersPaginated.ts | 6 +++--- plugins/helpers/src/sendPrivateInteractionResponse.ts | 6 +++--- plugins/helpers/src/suppressEmbeds.ts | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/helpers/src/channels.ts b/plugins/helpers/src/channels.ts index 5d55ea1fc..b6c5202db 100644 --- a/plugins/helpers/src/channels.ts +++ b/plugins/helpers/src/channels.ts @@ -1,9 +1,9 @@ -import { Bot, CreateGuildChannel, DiscordenoChannel, separateOverwrites } from "../deps.ts"; +import { Bot, CreateGuildChannel, Channel, separateOverwrites } from "../deps.ts"; /** Create a copy of a channel */ export async function cloneChannel( bot: Bot, - channel: DiscordenoChannel, + channel: Channel, reason?: string, ) { if (!channel.guildId) { diff --git a/plugins/helpers/src/getMembersPaginated.ts b/plugins/helpers/src/getMembersPaginated.ts index 09fe69422..f4590c7e6 100644 --- a/plugins/helpers/src/getMembersPaginated.ts +++ b/plugins/helpers/src/getMembersPaginated.ts @@ -1,4 +1,4 @@ -import { Bot, Collection, DiscordenoMember, GuildMemberWithUser, ListGuildMembers } from "../deps.ts"; +import { Bot, Collection, Member, DiscordMemberWithUser, ListGuildMembers } from "../deps.ts"; /** * Highly recommended to **NOT** use this function to get members instead use fetchMembers(). @@ -10,7 +10,7 @@ export async function getMembersPaginated( guildId: bigint, options: ListGuildMembers, ) { - const members = new Collection(); + const members = new Collection(); let membersLeft = options?.limit ?? 1000; let loops = 1; @@ -30,7 +30,7 @@ export async function getMembersPaginated( ); } - const result = await bot.rest.runMethod( + const result = await bot.rest.runMethod( bot.rest, "get", `${bot.constants.endpoints.GUILD_MEMBERS(guildId)}?limit=${membersLeft > 1000 ? 1000 : membersLeft}${ diff --git a/plugins/helpers/src/sendPrivateInteractionResponse.ts b/plugins/helpers/src/sendPrivateInteractionResponse.ts index 21aa52b5e..a34e2ae50 100644 --- a/plugins/helpers/src/sendPrivateInteractionResponse.ts +++ b/plugins/helpers/src/sendPrivateInteractionResponse.ts @@ -1,12 +1,12 @@ -import type { Bot, DiscordenoInteractionResponse, DiscordenoMessage } from "../deps.ts"; +import type { Bot, InteractionResponse, Message } from "../deps.ts"; /** sendInteractionResponse with ephemeral reply */ export function sendPrivateInteractionResponse( bot: Bot, id: bigint, token: string, - options: DiscordenoInteractionResponse, -): Promise { + options: InteractionResponse, +): Promise { if (options.data && !options.data?.flags) options.data.flags = 64; // private: true return bot.helpers.sendInteractionResponse(id, token, options); } diff --git a/plugins/helpers/src/suppressEmbeds.ts b/plugins/helpers/src/suppressEmbeds.ts index 607173ba0..972b9e8bd 100644 --- a/plugins/helpers/src/suppressEmbeds.ts +++ b/plugins/helpers/src/suppressEmbeds.ts @@ -1,4 +1,4 @@ -import { Bot, Message } from "../deps.ts"; +import { Bot, DiscordMessage } from "../deps.ts"; /** Suppress all the embeds in this message */ export async function suppressEmbeds( @@ -6,7 +6,7 @@ export async function suppressEmbeds( channelId: bigint, messageId: bigint, ) { - const result = await bot.rest.runMethod( + const result = await bot.rest.runMethod( bot.rest, "patch", bot.constants.endpoints.CHANNEL_MESSAGE(channelId, messageId),