fix: helper plugin errors

This commit is contained in:
Skillz4Killz
2022-03-20 12:17:42 +00:00
committed by GitHub
parent 9afa1b84ef
commit 751f719a87
4 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -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) {
+3 -3
View File
@@ -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<bigint, DiscordenoMember>();
const members = new Collection<bigint, Member>();
let membersLeft = options?.limit ?? 1000;
let loops = 1;
@@ -30,7 +30,7 @@ export async function getMembersPaginated(
);
}
const result = await bot.rest.runMethod<GuildMemberWithUser[]>(
const result = await bot.rest.runMethod<DiscordMemberWithUser[]>(
bot.rest,
"get",
`${bot.constants.endpoints.GUILD_MEMBERS(guildId)}?limit=${membersLeft > 1000 ? 1000 : membersLeft}${
@@ -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<DiscordenoMessage | undefined> {
options: InteractionResponse,
): Promise<Message | undefined> {
if (options.data && !options.data?.flags) options.data.flags = 64; // private: true
return bot.helpers.sendInteractionResponse(id, token, options);
}
+2 -2
View File
@@ -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<Message>(
const result = await bot.rest.runMethod<DiscordMessage>(
bot.rest,
"patch",
bot.constants.endpoints.CHANNEL_MESSAGE(channelId, messageId),