mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
fix: helper plugin errors
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user