mirror of
https://github.com/LBRYFoundation/lbry-tipbot.git
synced 2025-08-23 16:57:24 +00:00
fix tipping bug
This commit is contained in:
parent
037958db49
commit
da96401cbf
1 changed files with 11 additions and 21 deletions
|
@ -80,7 +80,7 @@ exports.multitip = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
channelwarning = 'Please use <#' + spamchannel + '> or DMs to talk to bots.',
|
channelwarning = 'Please use <#' + spamchannel + '> or DMs to talk to bots.',
|
||||||
MultiorRole = true
|
MultiorRole = true;
|
||||||
switch (subcommand) {
|
switch (subcommand) {
|
||||||
case 'help':
|
case 'help':
|
||||||
privateOrSandboxOnly(msg, channelwarning, doHelp, [helpmsg]);
|
privateOrSandboxOnly(msg, channelwarning, doHelp, [helpmsg]);
|
||||||
|
@ -117,7 +117,7 @@ exports.roletip = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
channelwarning = `Please use <#${spamchannel}> or DMs to talk to bots.`,
|
channelwarning = `Please use <#${spamchannel}> or DMs to talk to bots.`,
|
||||||
MultiorRole = true
|
MultiorRole = true;
|
||||||
switch (subcommand) {
|
switch (subcommand) {
|
||||||
case 'help':
|
case 'help':
|
||||||
privateOrSandboxOnly(msg, channelwarning, doHelp, [helpmsg]);
|
privateOrSandboxOnly(msg, channelwarning, doHelp, [helpmsg]);
|
||||||
|
@ -224,7 +224,7 @@ function doTip(bot, message, tipper, words, helpmsg, MultiorRole) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message.mentions.users.first() && message.mentions.users.first().id) {
|
if (message.mentions.users.first() && message.mentions.users.first().id) {
|
||||||
return sendLBC(message, tipper, message.mentions.users.first().id.replace('!', ''), amount, prv, MultiorRole);
|
return sendLBC(bot, message, tipper, message.mentions.users.first().id.replace('!', ''), amount, prv, MultiorRole);
|
||||||
}
|
}
|
||||||
message.reply('Sorry, I could not find a user in your tip...');
|
message.reply('Sorry, I could not find a user in your tip...');
|
||||||
}
|
}
|
||||||
|
@ -252,7 +252,7 @@ function doMultiTip(bot, message, tipper, words, helpmsg, MultiorRole) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (let i = 0; i < userIDs.length; i++) {
|
for (let i = 0; i < userIDs.length; i++) {
|
||||||
sendLBC(message, tipper, userIDs[i].toString(), amount, prv, MultiorRole);
|
sendLBC(bot, message, tipper, userIDs[i].toString(), amount, prv, MultiorRole);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -261,38 +261,28 @@ function doRoleTip(bot, message, tipper, words, helpmsg, MultiorRole) {
|
||||||
doHelp(message, helpmsg);
|
doHelp(message, helpmsg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var prv = false;
|
let prv = false;
|
||||||
var amountOffset = 2;
|
let amountOffset = 2;
|
||||||
if (words.length >= 4 && words[1] === 'private') {
|
if (words.length >= 4 && words[1] === 'private') {
|
||||||
prv = true;
|
prv = true;
|
||||||
amountOffset = 3;
|
amountOffset = 3;
|
||||||
}
|
}
|
||||||
let amount = getValidatedAmount(words[amountOffset]);
|
let amount = getValidatedAmount(words[amountOffset]);
|
||||||
if (amount == null) {
|
if (amount == null) {
|
||||||
message
|
message.reply("I don't know how to tip that many LBC coins...").then(message => message.delete(10000));
|
||||||
.reply("I don't know how to tip that many LBC coins...")
|
|
||||||
.then(message => message.delete(10000));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (message.mentions.roles.first().id) {
|
if (message.mentions.roles.first().id) {
|
||||||
if (message.mentions.roles.first().members.first().id) {
|
if (message.mentions.roles.first().members.first().id) {
|
||||||
let userIDs = message.mentions.roles
|
let userIDs = message.mentions.roles.first().members.map(member => member.user.id.replace('!', ''));
|
||||||
.first()
|
for (let i = 0; i < userIDs.length; i++) {
|
||||||
.members.map(member => member.user.id.replace('!', ''));
|
|
||||||
for (var i = 0; i < userIDs.length; i++) {
|
|
||||||
sendLBC(bot, message, tipper, userIDs[i], amount, prv, MultiorRole);
|
sendLBC(bot, message, tipper, userIDs[i], amount, prv, MultiorRole);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
message
|
return message.reply('Sorry, I could not find any users to tip in that role...').then(message => message.delete(10000));
|
||||||
.reply('Sorry, I could not find any users to tip in that role...')
|
|
||||||
.then(message => message.delete(10000));
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
message
|
return message.reply('Sorry, I could not find any roles in your tip...').then(message => message.delete(10000));
|
||||||
.reply('Sorry, I could not find any roles in your tip...')
|
|
||||||
.then(message => message.delete(10000));
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue