首頁  >  問答  >  主體

從 Discord.js 14 執行緒啟動訊息中檢索綜合論壇數據

我對discord.js 與node 相對較新。我正在嘗試從線程中讀取第一條訊息,我不知道,作為數組並稍後保存。因為我想稍後透過 API 傳遞資料。

我在這裡打破了我的王冠。

我已經嘗試過:

const { ChannelType } = require('discord.js');

client.on('threadCreate', async (thread) => {
    if (thread.type == ChannelType.GuildPublicThread) {
        // When a new forum post is created
        console.log(thread.parentId) // The forum channel ID
        console.log(thread.id) // The forum post ID
        console.log(thread.name) // The name of the forum post
    }
})

但我找不到獲取 wohl 線程資料的方法。也許有人可以幫我解決這個問題?

P粉337385922P粉337385922204 天前283

全部回覆(1)我來回復

  • P粉794851975

    P粉7948519752024-03-30 10:48:33

    雷雷

    回覆
    0
  • 取消回覆