简体   繁体   English

Discord.js审核日志

[英]Discord.js Audit logs

been owning a discord bot for quite a while and I decided it's time to make a lot of logging options (everything can be toggled via a database etc) 拥有Discord机器人已有一段时间了,我决定是时候进行很多日志记录选项了(可以通过数据库等进行所有切换)

I have been looking at the discord development page but can't quite figure out how those events work, as I tried for example to use the "CHANNEL_CREATE" event and make it console.log something, though it doesn't even after creating a channel. 我一直在查看不一致的开发页面,但无法完全弄清楚这些事件的工作原理,例如,我尝试使用“ CHANNEL_CREATE”事件并将其设置为console.log,尽管创建了一个渠道。

client.on('CHANNEL_CREATE', async () => {
console.log('New channel created')
});

Those aren't the events you looking for. 这些不是您想要的事件。
You need to look at the events on Discord.JS documentation: Documentation . 您需要查看Discord.JS文档中的事件: Documentation
And you're looking for the event channelCreate : 并且您正在寻找事件channelCreate

client.on('channelCreate', channel => {
    console.log("Channel with ID: " + channel.id + " was just created");
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM