mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
@@ -0,0 +1,18 @@
|
||||
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;
|
||||
}
|
||||
|
||||
await bot.helpers.pinMessage(channelId, messageId);
|
||||
|
||||
assertEquals(true, pinned);
|
||||
|
||||
await bot.helpers.unpinMessage(channelId, messageId);
|
||||
|
||||
assertEquals(false, pinned);
|
||||
}
|
||||
Reference in New Issue
Block a user