From ccdda874199cb64115abf5c0c6e7352d017cda39 Mon Sep 17 00:00:00 2001 From: Electron - Mark Firth Date: Fri, 13 Jul 2018 00:26:07 +1000 Subject: [PATCH] Tipbot Fixed & Made Easier to Use I've combined the tip help messages into one easy-to-read message to make it easier for people to access and use. If anyone can't understand the obviousness of the help, they can visit the tip FAQ page for a better understanding. However, because I have no Bot testing server, I have left some code in this version that's no longer required in case removing anything breaks it, It will be best to remove this at some point. --- bot/modules/tipbot.js | 72 +++++++++++++++---------------------------- 1 file changed, 24 insertions(+), 48 deletions(-) diff --git a/bot/modules/tipbot.js b/bot/modules/tipbot.js index 98523f0..1da7538 100644 --- a/bot/modules/tipbot.js +++ b/bot/modules/tipbot.js @@ -20,17 +20,26 @@ exports.tip = { return n !== ''; }), subcommand = words.length >= 2 ? words[1] : 'help', - helpmsgparts = [ - ['[help]', 'Get this message.'], - ['balance', 'Get your balance.'], - ['deposit', 'Get address for your deposits.'], - ['withdraw ADDRESS AMOUNT', 'Withdraw AMOUNT credits to ADDRESS'], - ['[private] ', 'Mention a user with @ and then the amount to tip them, or put private before the user to tip them privately.'], - ['Read our [**Tipbot FAQ**](https://lbry.io/faq/tipbot-discord) on how use the LBRY Discord Tipbot'] - ], + helpmsgparts = [], helpmsg = { embed: { - description: formatDescriptions(helpmsgparts) + '\nKey: [] : Optionally include contained keyword, <> : Replace with appropriate value.', + description: " + __**TIPS**__\n\n + **Balance**: `!tip balance`\n + **Deposit Address**: `!tip deposit`\n + **Withdraw**:, `!tip withdraw
`\n + **Private Tip**: `!privatetip `\n\n + __**ROLE TIPS**__ Use this to tip everyone in a role.\n\n + **Role Tip**: `!roletip `\n + **Private Role Tip**: `!privatetip `\n\n + __**MULTI TIPS**__ Use this to tip multiple people at once\n\n + **Multi Tip**: `!multitip `\n + **Private Multi Tip** `!multitip private `\n + **Note**: Multi tips can contain any amount of users to tip.\n\n + __**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, author: { name: '!tip' } } @@ -68,19 +77,8 @@ exports.multitip = { return n !== ''; }), subcommand = words.length >= 2 ? words[1] : 'help', - helpmsgparts = [ - ['[help]', 'Get this message.'], - ['+ ', 'Mention one or more users in a row, seperated by spaces, then an amount that each mentioned user will receive.'], - ['private + ', 'Put private before the user list to have each user tipped privately, without revealing other users tipped.'], - ['Read our [**Tipbot FAQ**](https://lbry.io/faq/tipbot-discord) on how use the LBRY Discord Tipbot'] - ], - helpmsg = { - embed: { - description: formatDescriptions(helpmsgparts) + '\nKey: [] : Optionally include contained keyword, <> : Replace with appropriate value, + : Value can be repeated for multiple entries.', - color: 1109218, - author: { name: '!multitip' } - } - }, + helpmsgparts = [], + helpmsg = {}, channelwarning = 'Please use <#' + spamchannel + '> or DMs to talk to bots.', MultiorRole = true; switch (subcommand) { @@ -106,19 +104,9 @@ exports.roletip = { return n !== ''; }), subcommand = words.length >= 2 ? words[1] : 'help', - helpmsgparts = [ - ['[help]', 'Get this message'], - [' ', 'Mention a single role, then an amount that each user in that role will receive.'], - ['private ', 'Put private before the role to have each user tipped privately, without revealing other users tipped.'], - ['Read our [**Tipbot FAQ**](https://lbry.io/faq/tipbot-discord) on how use the LBRY Discord Tipbot'] + helpmsgparts = [] ], - helpmsg = { - embed: { - description: formatDescriptions(helpmsgparts) + '\nKey: [] : Optionally include contained keyword, <> : Replace with appropriate value.', - color: 1109218, - author: { name: '!roletip' } - } - }, + helpmsg = {}, channelwarning = `Please use <#${spamchannel}> or DMs to talk to bots.`, MultiorRole = true; switch (subcommand) { @@ -136,20 +124,8 @@ exports.tips = { usage: '', description: 'Lists all available tipbot commands with brief descriptions for each one.', process: async function(bot, msg, suffix) { - let helpmsgparts = [ - ['!tip', 'Tip a given user with an amount of LBC or perform wallet specific operations.'], - ['!multitip', 'Tip multiple users simultaneously for the same amount of LBC each.'], - ['!roletip', 'Tip every user in a given role the same amount of LBC.'], - ['!tips', 'Lists all available tipbot commands with brief descriptions for each one.'], - ['Read our [**Tipbot FAQ**](https://lbry.io/faq/tipbot-discord) on how use the LBRY Discord Tipbot'] - ], - helpmsg = { - embed: { - description: `These are all the commands that TipBot currently supports. Use \`! help\` for usage instructions. -${formatDescriptions(helpmsgparts)}`, - color: 1109218, - author: { name: 'Tipbot Commands' } - } + let helpmsgparts = [], + helpmsg = {} }; msg.reply(helpmsg); }