Merge branch 'fp-attempt-9001' of https://github.com/Skillz4Killz/discordeno into fp-attempt-9001

This commit is contained in:
Skillz4Killz
2021-11-05 17:22:02 +00:00
committed by GitHub
4 changed files with 15 additions and 13 deletions

View File

@@ -171,7 +171,7 @@ export function createExecute(cache: Cache): CacheExecutor {
return function (type, options) {
switch (type) {
case "FILTER_CATEGORY_CHILDREN_CHANNELS":
return cache.channels.filter(c => c.parentId === options.parentChannelId);
return cache.channels.filter((c) => c.parentId === options.parentChannelId);
case "DELETE_MESSAGES_FROM_CHANNEL":
cache.messages.forEach((message) => {
if (message.channelId === options.channelId) {

View File

@@ -5,9 +5,5 @@ import type { Bot } from "../../bot.ts";
export async function getIntegrations(bot: Bot, guildId: bigint) {
await bot.utils.requireBotGuildPermissions(bot, guildId, ["MANAGE_GUILD"]);
return await bot.rest.runMethod<Integration>(
bot.rest,
"get",
bot.constants.endpoints.GUILD_INTEGRATIONS(guildId)
);
return await bot.rest.runMethod<Integration>(bot.rest, "get", bot.constants.endpoints.GUILD_INTEGRATIONS(guildId));
}

View File

@@ -3,7 +3,13 @@ import { DiscordenoChannel } from "../../../src/transformers/channel.ts";
import { assertExists, assertEquals } from "../../deps.ts";
import { delayUntil } from "../../utils.ts";
export async function cloneChannelTests(bot: Bot, guildId: bigint, channel: DiscordenoChannel, options: {reason?: string}, t: Deno.TestContext) {
export async function cloneChannelTests(
bot: Bot,
guildId: bigint,
channel: DiscordenoChannel,
options: { reason?: string },
t: Deno.TestContext
) {
const cloned = await bot.helpers.cloneChannel(channel.id, options.reason);
//Assertations

View File

@@ -1,7 +1,7 @@
import { memoryBenchmarks } from "../benchmarks/index.ts";
import { TOKEN } from "../configs.ts";
import {
channelOverwriteHasPermission,
channelOverwriteHasPermission,
createBot,
createEventHandlers,
DiscordChannelTypes,
@@ -557,19 +557,19 @@ Deno.test({
name: "[channel] edit a channel permission overwrite",
async fn() {
await channelOverwriteHasPermissionTest(bot, guild.id, t);
}
},
}),
t.step({
name: "[channel] clone a channel w/o a reason",
async fn() {
await cloneChannelTests(bot, guild.id, channel, {}, t);
}
},
}),
t.step({
name: "[channel] clone a channel w/ a reason",
async fn() {
await cloneChannelTests(bot, guild.id, channel, { reason: "Blame wolf"}, t);
}
await cloneChannelTests(bot, guild.id, channel, { reason: "Blame wolf" }, t);
},
}),
t.step({
name: "[channel] delete a channel overwrite",
@@ -587,7 +587,7 @@ Deno.test({
name: "[channel] edit a channel w/ a reason",
async fn() {
await editChannelTests(bot, guild.id, { reason: "Blame wolf"}, t);
}
},
}),
]);