Added Tipbot Privacy Mode #3

Merged
ProfessorDey merged 1 commit from patch-1 into master 2017-12-05 01:39:36 +01:00
ProfessorDey commented 2017-11-14 18:33:29 +01:00 (Migrated from github.com)

Allow for Tipbot to be used privately while still notifying the user that has received the tip, via private message.

Updates the Help message for new usage instructions, fixes misspelling of 'address' and adds a Key for the [ ] and < > syntax, as some users may not understand their usage.

Reworks the subcommand parsing by using a more compact Switch Function. Necessitates the use of 'break;' but is far more compact and legible, presumed the old if else block is from early development with fewer features available. Switch statement should allow for easier expansion.

Modifies doTip() to avoid requiring code duplication, includes two new variables used to indicate that the tip should be done in privacy mode and where the tip value is located in the 'words' array.

Significant change to sendLbc and it's function call, requirement for private message for recipient required User object, thus the function now requires the actual GuildMember object, not only the ID. While this marginally increases overhead, it should also allow access to the send() function for that Guild Member, allowing for private message to be sent. Further the addition of a privacy flag (0 for non-private, 1 for private) was added so that the function can determine whether to send a public or private response. this required updating references to the Guild Member's id to 'member.id', but otherwise operation remains the same until the transaction is completed, following which it will check the privacy flag and if it is set, will privately send the successful tip message to both author and recipient, otherwise it will simply reply via the normal '.reply()' function.

Allow for Tipbot to be used privately while still notifying the user that has received the tip, via private message. Updates the Help message for new usage instructions, fixes misspelling of 'address' and adds a Key for the [ ] and < > syntax, as some users may not understand their usage. Reworks the subcommand parsing by using a more compact Switch Function. Necessitates the use of 'break;' but is far more compact and legible, presumed the old if else block is from early development with fewer features available. Switch statement should allow for easier expansion. Modifies doTip() to avoid requiring code duplication, includes two new variables used to indicate that the tip should be done in privacy mode and where the tip value is located in the 'words' array. Significant change to sendLbc and it's function call, requirement for private message for recipient required User object, thus the function now requires the actual GuildMember object, not only the ID. While this marginally increases overhead, it should also allow access to the send() function for that Guild Member, allowing for private message to be sent. Further the addition of a privacy flag (0 for non-private, 1 for private) was added so that the function can determine whether to send a public or private response. this required updating references to the Guild Member's id to 'member.id', but otherwise operation remains the same until the transaction is completed, following which it will check the privacy flag and if it is set, will privately send the successful tip message to both author and recipient, otherwise it will simply reply via the normal '.reply()' function.
nikooo777 commented 2017-11-14 18:52:10 +01:00 (Migrated from github.com)

Thank you!

We will test it in the other discord server and deploy it ASAP :)
@thebrazengeek will be happy :)

Thank you! We will test it in the other discord server and deploy it ASAP :) @thebrazengeek will be happy :)
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-tipbot#3
No description provided.