You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

请求验证:修改频道类型为GUILD_TEXT是否修复channel.isText错误

验证Discord机器人频道创建参数修改是否修复TypeError错误

开发Discord机器人时出现TypeError: channel.isText is not a function错误,此前创建频道时type参数使用的是'text',现已将其修改为'GUILD_TEXT',相关代码如下:

interaction.guild.channels.create(`${interaction.values}-${interaction.user.username}`, { //ticket_name
  parent: config.ticketparent,
  topic: interaction.user.id,
  permissionOverwrites: [{
      id: interaction.user.id,
      allow: ['VIEW_CHANNEL','SEND_MESSAGES'],
    },
    {
      id: config.ticketrole,
      allow: ['SEND_MESSAGES', 'VIEW_CHANNEL'],
    },
    {
      id: interaction.guild.roles.everyone,
      deny: ['VIEW_CHANNEL'],
    },
  ],
  type: 'GUILD_TEXT', //i think the error is from here in past i have here text but not i have GUILD_TEXT
})

请验证此修改是否已修复该错误。错误截图如下:

TypeError错误截图

若截图无法加载,请告知重新提供。

内容的提问来源于stack exchange,提问作者Mpamphs Karudas

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.25 23:33:16