如何设置我的机器人将所有日志发送到指定频道?
how do I set my bot sending all the logs to a named channel?
let logschannel = message.guild.channels.cache.find(channel =\> channel.name === 'logs');
我想让我的机器人在特定命名的频道中发送从加入和离开到删除消息的日志。有人可以帮忙吗?
您给定的代码中有一个错误的代码,即 =\>
要执行此操作,您需要先找到频道,是的,您做对了。您只需要将 =\>
更改为 =>
.
现在,当您完成更改后,您需要做的就是调用 logschannel
let logschannel = message.guild.channels.cache.find(channel => channel.name === 'logs');
loschannel.send({content: "your content"})
也可以使用嵌入。
let logschannel = message.guild.channels.cache.find(channel => channel.name === 'logs');
logschannel.send({embeds: [your_embed_name]});
请将=/>
改为=>
然后,检查一下:
https://discord.js.org/#/docs/discord.js/stable/typedef/WSEventType
您可能希望 运行 您的代码包含上述文档中的每个公会活动 link。
let logschannel = message.guild.channels.cache.find(channel =\> channel.name === 'logs');
我想让我的机器人在特定命名的频道中发送从加入和离开到删除消息的日志。有人可以帮忙吗?
您给定的代码中有一个错误的代码,即 =\>
要执行此操作,您需要先找到频道,是的,您做对了。您只需要将 =\>
更改为 =>
.
现在,当您完成更改后,您需要做的就是调用 logschannel
let logschannel = message.guild.channels.cache.find(channel => channel.name === 'logs');
loschannel.send({content: "your content"})
也可以使用嵌入。
let logschannel = message.guild.channels.cache.find(channel => channel.name === 'logs');
logschannel.send({embeds: [your_embed_name]});
请将=/>
改为=>
然后,检查一下:
https://discord.js.org/#/docs/discord.js/stable/typedef/WSEventType
您可能希望 运行 您的代码包含上述文档中的每个公会活动 link。