mirror of
https://github.com/LBRYFoundation/lbry-wunderbot.git
synced 2025-08-23 17:47:27 +00:00
check if user is online
This commit is contained in:
parent
3b4e23bb26
commit
effc17ad12
1 changed files with 9 additions and 0 deletions
|
@ -61,6 +61,15 @@ bot.on('disconnected', function() {
|
||||||
function checkMessageForCommand(msg, isEdit) {
|
function checkMessageForCommand(msg, isEdit) {
|
||||||
//check if message is a command
|
//check if message is a command
|
||||||
if (msg.author.id != bot.user.id && msg.content.startsWith(config.prefix)) {
|
if (msg.author.id != bot.user.id && msg.content.startsWith(config.prefix)) {
|
||||||
|
//check if user is Online
|
||||||
|
if (
|
||||||
|
!msg.author.presence.status ||
|
||||||
|
msg.author.presence.status == 'offline' ||
|
||||||
|
msg.author.presence.status == 'invisible'
|
||||||
|
) {
|
||||||
|
msg.channel.send('Please set your Discord Presence to Online to talk to the Bot!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
console.log('treating ' + msg.content + ' from UserID:' + msg.author + ' || UserName: ' + msg.author.username + ' as command');
|
console.log('treating ' + msg.content + ' from UserID:' + msg.author + ' || UserName: ' + msg.author.username + ' as command');
|
||||||
var cmdTxt = msg.content.split(' ')[0].substring(config.prefix.length);
|
var cmdTxt = msg.content.split(' ')[0].substring(config.prefix.length);
|
||||||
var suffix = msg.content.substring(cmdTxt.length + config.prefix.length + 1); //add one for the ! and one for the space
|
var suffix = msg.content.substring(cmdTxt.length + config.prefix.length + 1); //add one for the ! and one for the space
|
||||||
|
|
Loading…
Add table
Reference in a new issue