내 서버의 봇용 파일에 모든 메시지를 기록하려고합니다. 그러나 내 봇을 실행하고 누군가 메시지를 보낼 때마다 다음 오류가 발생합니다.
UnhandledPromiseRejectionWarning : TypeError [ERR_INVALID_CALLBACK] : 콜백은 함수 여야합니다. 정의되지 않은 수신
내 코드는 다음과 같습니다.
if (message.channel.type !== 'dm')
{
var log = `[SERVER MESSAGE] ${message.member.user.tag}: "${message.content}" in #${message.channel.name}`;
console.log(log);
fs.writeFile("C:/Users/dubwi/Desktop/Discord_Bot/chatlog.json", `${log}`)
}
else{
message.reply("I don't accept DMs at the moment");
var log = `[DM MESSAGE] ${message.author.tag}: "${message.content}"`;
console.log(log);
fs.writeFile("C:/Users/dubwi/Desktop/Discord_Bot/chatlog.json", `${log}`)
}
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다