From 136f17c4ad4c3d5943852b2b3bf69b46ad2291d0 Mon Sep 17 00:00:00 2001 From: YULIUS KURNIAWAN KRISTIANTO Date: Sun, 4 Nov 2018 21:23:12 +0700 Subject: [PATCH 1/3] strict balance on general and remove comma --- bot/modules/tipbot.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bot/modules/tipbot.js b/bot/modules/tipbot.js index 3054a24..ea9aa36 100644 --- a/bot/modules/tipbot.js +++ b/bot/modules/tipbot.js @@ -33,7 +33,7 @@ exports.tip = { usage: '', description: 'Tip a given user with an amount of LBC or perform wallet specific operations.', process: async function(bot, msg, suffix) { - let tipper = msg.author.id.replace('!', ''), + let tipper = msg.author.id.replace('!' ''), words = msg.content .trim() .split(' ') @@ -48,7 +48,7 @@ exports.tip = { privateOrSandboxOnly(msg, channelwarning, doHelp, [helpmsg]); break; case 'balance': - doBalance(msg, tipper); + privateOrSandboxOnly(msg, channelwarning, doBalance, [tipper]); break; case 'deposit': privateOrSandboxOnly(msg, channelwarning, doDeposit, [tipper]); @@ -66,7 +66,7 @@ exports.multitip = { usage: '', description: 'Tip multiple users simultaneously for the same amount of LBC each.', process: async function(bot, msg, suffix) { - let tipper = msg.author.id.replace('!', ''), + let tipper = msg.author.id.replace('!' ''), words = msg.content .trim() .split(' ') @@ -91,7 +91,7 @@ exports.roletip = { usage: '', description: 'Tip all users in a specified role an amount of LBC.', process: async function(bot, msg, suffix) { - let tipper = msg.author.id.replace('!', ''), + let tipper = msg.author.id.replace('!' ''), words = msg.content .trim() .split(' ') From ed3050b1ac4835b715726169f05794517443b805 Mon Sep 17 00:00:00 2001 From: YULIUS KURNIAWAN KRISTIANTO Date: Tue, 6 Nov 2018 03:09:47 +0700 Subject: [PATCH 2/3] Update tipbot.js bring back comma --- bot/modules/tipbot.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/modules/tipbot.js b/bot/modules/tipbot.js index ea9aa36..9a61c38 100644 --- a/bot/modules/tipbot.js +++ b/bot/modules/tipbot.js @@ -33,7 +33,7 @@ exports.tip = { usage: '', description: 'Tip a given user with an amount of LBC or perform wallet specific operations.', process: async function(bot, msg, suffix) { - let tipper = msg.author.id.replace('!' ''), + let tipper = msg.author.id.replace('!',''), words = msg.content .trim() .split(' ') @@ -66,7 +66,7 @@ exports.multitip = { usage: '', description: 'Tip multiple users simultaneously for the same amount of LBC each.', process: async function(bot, msg, suffix) { - let tipper = msg.author.id.replace('!' ''), + let tipper = msg.author.id.replace('!',''), words = msg.content .trim() .split(' ') @@ -91,7 +91,7 @@ exports.roletip = { usage: '', description: 'Tip all users in a specified role an amount of LBC.', process: async function(bot, msg, suffix) { - let tipper = msg.author.id.replace('!' ''), + let tipper = msg.author.id.replace('!',''), words = msg.content .trim() .split(' ') From 54fe1351bbc1f506582ca70960cf3d511d49a09e Mon Sep 17 00:00:00 2001 From: Niko Storni Date: Thu, 15 Nov 2018 11:57:40 -0500 Subject: [PATCH 3/3] run linter --- bot/modules/tipbot.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/bot/modules/tipbot.js b/bot/modules/tipbot.js index 9a61c38..df534eb 100644 --- a/bot/modules/tipbot.js +++ b/bot/modules/tipbot.js @@ -24,7 +24,7 @@ const helpmsg = { '__**FURTHER INFORMATION**__\n\n' + '**Help**: `!tip help` *Get this message.\n' + 'Read our [Tipbot FAQ](https://lbry.io/faq/tipbot-discord) for a more details', - color: 1109218, + color: 1109218 } }; @@ -33,7 +33,7 @@ exports.tip = { usage: '', description: 'Tip a given user with an amount of LBC or perform wallet specific operations.', process: async function(bot, msg, suffix) { - let tipper = msg.author.id.replace('!',''), + let tipper = msg.author.id.replace('!', ''), words = msg.content .trim() .split(' ') @@ -66,7 +66,7 @@ exports.multitip = { usage: '', description: 'Tip multiple users simultaneously for the same amount of LBC each.', process: async function(bot, msg, suffix) { - let tipper = msg.author.id.replace('!',''), + let tipper = msg.author.id.replace('!', ''), words = msg.content .trim() .split(' ') @@ -91,7 +91,7 @@ exports.roletip = { usage: '', description: 'Tip all users in a specified role an amount of LBC.', process: async function(bot, msg, suffix) { - let tipper = msg.author.id.replace('!',''), + let tipper = msg.author.id.replace('!', ''), words = msg.content .trim() .split(' ') @@ -161,7 +161,7 @@ function doWithdraw(message, tipper, words, helpmsg) { amount = getValidatedAmount(words[3]); if (amount === null) { - message.reply("Invalid amount of credits specified... Cannot withdraw credits.").then(message => message.delete(5000)); + message.reply('Invalid amount of credits specified... Cannot withdraw credits.').then(message => message.delete(5000)); return; } @@ -189,7 +189,7 @@ function doTip(bot, message, tipper, words, helpmsg, MultiorRole) { let amount = getValidatedAmount(words[amountOffset]); if (amount === null) { - return message.reply("Invalid amount of credits specified...").then(message => message.delete(5000)); + return message.reply('Invalid amount of credits specified...').then(message => message.delete(5000)); } if (message.mentions.users.first() && message.mentions.users.first().id) { @@ -213,7 +213,7 @@ function doMultiTip(bot, message, tipper, words, helpmsg, MultiorRole) { } let [userIDs, amount] = findUserIDsAndAmount(message, words, prv); if (amount == null) { - message.reply("Invalid amount of credits specified...").then(message => message.delete(5000)); + message.reply('Invalid amount of credits specified...').then(message => message.delete(5000)); return; } if (!userIDs) { @@ -297,7 +297,6 @@ ${tx}${msgtail}`; usr.send(recipientmsg); } } else { - let generalmsg = `just tipped <@${recipient}> ${amount} LBC. ${tx}${msgtail}`; message.reply(generalmsg);