【发布时间】:2021-12-08 05:22:30
【问题描述】:
我目前正在将我的 discord 机器人从 js 重写为 ts。 要使用打字,我扩展了 discord.js 客户端,我无法获取频道并在那里发送消息。除了使用 type:any 之外,我该如何解决这个问题?
我的扩展客户:
export class DiscordClient extends Client {
commands
config
}
这不再适用于将Client 类型设置为DiscordClient 的情况。
如果我将它设置为任何,它就可以正常工作
client.channels.cache
.find((channel) => channel.id == client.config.ids.channelIDs.dev.botTestLobby)
.send({ embeds: [loginMessage] })
【问题讨论】:
标签: typescript discord.js typescript-typings