MCPcopy Create free account
hub / github.com/Botloader/botloader / testPublicStandaloneThread

Function testPublicStandaloneThread

integration-tests/threads.ts:17–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15})
16
17async function testPublicStandaloneThread() {
18 let channel = await Discord.createStandaloneThread({
19 // invitable: true,
20 channelId: threadsTestChannelId,
21 kind: "PublicThread",
22 name: "int-test-public-thread",
23 autoArchiveDurationMinutes: 10080,
24 })
25
26 assertExpected("PublicThread", channel.kind)
27 assertExpected(10080, channel.threadMetadata.autoArchiveDurationMinutes)
28 assertExpected("int-test-public-thread", channel.name)
29
30 // check if it appears in the active threads list
31 const activeThreads = await Discord.getActiveThreads()
32 const found = activeThreads.threads.find(v => v.id === channel.id)
33 assertExpected(true, Boolean(found))
34
35 channel = await channel.archive()
36 assertExpected(true, channel.threadMetadata.archived)
37
38 // test list archived threads
39 const archivedThreads = await Discord.getPublicArchivedThreads({
40 channelId: threadsTestChannelId,
41 })
42
43 const archivedThread = archivedThreads.threads.some(v => v.id === channel.id)
44 assertExpected(true, archivedThread)
45}
46
47async function testPrivateStandaloneThread() {
48 let channel = await Discord.createStandaloneThread({

Callers 1

threads.tsFile · 0.85

Calls 2

assertExpectedFunction · 0.90

Tested by

no test coverage detected