【发布时间】:2020-09-06 21:29:16
【问题描述】:
const channel = client.channels.cache.get('<channelid>');
const person1 = client.users.cache.get('<userid>');
const person = client.users.cache.get('<userid>');
client.on('message', message =>{
client.on('presenceUpdate', () =>{
if(person1.user.presence.status === 'dnd' || person1.user.presence.status === 'online'){
channelforstatus.send('person1 is now online');
}
else if(peron1.user.presence.status === 'offline' || person1.user.presence.status === 'idle'){
channel.send('person1 is offline');
}
client.on('message', message => {
client.on('presenceUpdate', () =>{
if(person.user.presence.status === 'dnd' || person.user.presence.status === 'online'){
channel.send('person is now on');
}
else if(person.user.presence.status === 'offline' || person.user.presence.status === 'idle'){
channel.send('person is now off');
}
});
});
});
});
这是我尝试过的,.send() 该功能不起作用。我到处寻找,没有发现任何可以帮助我解决这个问题的东西。我只需要它,因此它每次都会检查特定人员是否上线、下线等。并向特定频道发送消息。
【问题讨论】:
-
顺便欢迎来到 Stackoverflow!别忘了看看tour ????
标签: node.js discord.js