()
| 15 | }) |
| 16 | |
| 17 | async 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 | |
| 47 | async function testPrivateStandaloneThread() { |
| 48 | let channel = await Discord.createStandaloneThread({ |
no test coverage detected