Merged
Conversation
- Removed several collectors - Reduced indent creep - Split up individual interaction logic into their own functions - Resolved any multiple uses of `interaction.update`/`interaction.reply` - Embed-ified certain responses - Security can now directly add attachments in response to a modmail This is completely untested as of this commit
This is the start of a potential solution for the confirm interaction bugs, see dev lounge for a more detailed write up
# botSetup.js - vibotChannels was not actually passed a db argument # extensions.js - Rearranged some logic in `TextChannel.next` to ensure message is deleted even when cancelled - Removed unnecessary `result = message = message.delete()` # modmailRespond.js - Now uses `Modmail.send` from modmail.js, this includes adding attachments # modmail.js - Added `.then(resp => resp.fetch())` whenever we receive an InteractionResponse instead of a Message - Confirmed all buttons work as intended - Confirmed replying with attachments works with and without text
2 tasks
|
This PR should now be ready for a classical review. |
- Now shows image if only 1 attachment that is an image - logCommand.js now uses developerId instead of vi's id
Ragviswa
reviewed
Feb 8, 2024
| .setFooter({ text: 'Type \'cancel\' to cancel' }) | ||
| .setColor(Discord.Colors.Blue); | ||
|
|
||
| const confirmResponse = await interaction.reply({ embeds: [confirmEmbed] }).then(resp => resp.fetch()); |
Contributor
There was a problem hiding this comment.
I think there's a fetchReply boolean flag you can set to true for the reply method that allows you to automatically fetch the reply you send.
Ragviswa
suggested changes
Feb 10, 2024
Contributor
Ragviswa
left a comment
There was a problem hiding this comment.
I love the direction modmail has been refactored to so far. It's definitely a lot easier to read and follow compared to before. There are some areas which I feel would make the refactor even better than it is. The only reason I have given this much constructive feedback because I can see the potential for the modmail system with the new refactor.
- Could we use
awaitwherever there is a promised function, just to be consistent. I see some promised functions likedeleteandeditaren't always awaited - I would prefer if we were more selective about the arguments being passed into the
Modmailfunctions. There are instances where not all arguments are used, the argument names are inconsistent, or we use alternative means to access arguments instead of the direct variable. - It would be nice if we used exit conditions for the
Modmailfunctions as opposed to nesting as it makes the code flow easier to understand. - Minor, but if we could group embeds together and reduce new-lines to separate functions affecting the same embed, it would help with mentally separating each embed constructor.
- Do you mind taking
modmail.jsout of.eslintignoreto fix the minor styling issues? Understandable if this is too much work though.
Co-authored-by: Raghav Viswakumar <59955668+Ragviswa@users.noreply.github.com>
- Moved module.exports to the bottom - some small style-based changes
- Moved sending modmail reply to user to a function - Moved destructuring in modmail functions to function declaration - removed various little-used/uselessly mapped values from the ModmailData structure - Using `fetchReply: true` instead of `.then(res => res.fetch())` - Changed forwarding confirmation message to match send response confirmation - Added await to mmbl check in sendModMail function
- removed modmail from eslintignore - removed commented out `modmail.init` call - moved `modmail.js` to the `lib` folder - Removed individual collectors for modmails in favor of forwarding `modmail*` buttons in `index.js` - Removed unused execute from modmail - cleaned up eslint for `modmail.js` - Modmails now allow more than 1 image to be sent as a modmail - All vibot messages should now be embeds
Keep button state after restart, no need to reset to 'unlock'
- Deleted modmailclose command - Refactored modmailRespond - Removed modmailRespond from eslintignore
Ragviswa
approved these changes
Feb 12, 2024
Contributor
Ragviswa
left a comment
There was a problem hiding this comment.
Massive W to readability + code cleanliness. Big TY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ViBot 8.14.0
Changelog
Changes
;modmailclosewas removed.Bugs
Quality of Life
;mmr;mmrnow uses the same function as pressing theSend Messagebutton so it now acts exactly as if you pressed it.modmail.jsandmodmailRespond.jshave been fixed for ESLint errors.;restart.Summary
Overview
Send Messagebutton on modmailsTextChannel.nextvibotChannelsnow actually provided adbobjectExamples
Send Messageresponse with attachment and no text, followed by;mmrwith text and attachmentsWhat users see

