mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
Merge branch 'fp-attempt-9001' of https://github.com/discordeno/discordeno into fp-attempt-9001
This commit is contained in:
@@ -2,17 +2,17 @@ import { Bot } from "../../../src/bot.ts";
|
||||
import { assertEquals } from "../../deps.ts";
|
||||
|
||||
export async function pinMessageTests(bot: Bot, channelId: bigint, messageId: bigint, t: Deno.TestContext) {
|
||||
let pinned = false;
|
||||
|
||||
bot.events.channelPinsUpdate = function (bot, payload) {
|
||||
if (payload.channelId === channelId) pinned = !pinned;
|
||||
}
|
||||
let pinned = false;
|
||||
|
||||
await bot.helpers.pinMessage(channelId, messageId);
|
||||
bot.events.channelPinsUpdate = function (bot, payload) {
|
||||
if (payload.channelId === channelId) pinned = !pinned;
|
||||
};
|
||||
|
||||
assertEquals(true, pinned);
|
||||
await bot.helpers.pinMessage(channelId, messageId);
|
||||
|
||||
await bot.helpers.unpinMessage(channelId, messageId);
|
||||
assertEquals(true, pinned);
|
||||
|
||||
assertEquals(false, pinned);
|
||||
}
|
||||
await bot.helpers.unpinMessage(channelId, messageId);
|
||||
|
||||
assertEquals(false, pinned);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user