lbry-tipbot/bot
ProfessorDey 623250e1b4
Adding Multi User Tipping and Role Tipping
This is actually not too substantial an addition. it adds 2 additional command exports for tipbot, namely !multitip and !roletip.

!multitip [private] <user>+ <amount>
The more complex new feature, this command will take a list of users, seperated by spaces, and passes through to doTip() if you only list a single user. It tests each word past the ! command and private tag, checking for a user mention using the regex.test() function of the Discord.js USERS_PATTERN, using that to count the number of users mentioned in a row, then takes the first word that is not a match to be the amount. Error checking then returns the appropriate errors to the user, if any. Otherwise it proceeds to send tips to each user individually. this results in messages for every user that receives a tip, which can be messy. It will also message the author once for every user a tip is sent to, if using private mode, this isn't ideal, but would require rewriting the sendLbc() function, which is outside the scope of this commit.

!roletip <role> <amount>
This is a relatively simpler feature, the command taking a single role and an amount, then extracting the userIDs from the role via the Roles.members and GuildMember.user values. It will return seperate errors for a lack of a role in the message and the lack of any users in a role. Like the !multitip command, it will send tips individually to each user, with the same spam of messages either in the channel or the author's private channel.
2018-02-06 06:18:05 +00:00
..
modules Adding Multi User Tipping and Role Tipping 2018-02-06 06:18:05 +00:00
bot.js prettified code 2017-11-23 02:01:52 +01:00
plugins.js prettified code 2017-11-23 02:01:52 +01:00