【发布时间】:2020-03-11 01:36:21
【问题描述】:
我正在尝试制作一个读取最后一条消息的不和谐机器人,如果它包含custom fields:,然后回复一条消息。我想将整个消息记录到 txt 文件中。我该怎么做?
const Discord = require('discord.js');
const client = new Discord.Client();
const token = 'mytoken'; // Token goes here.
client.login(token); // login the bot with your token.
client.on('message', message => {
if(message.content.toLowerCase().includes('custom field:'))
message.channel.send("Custom field detected");
});
【问题讨论】:
标签: javascript node.js discord discord.js