Various changes to quotes (including mod deletion)#468
Open
Conversation
Moderators can now delete quotes when they are quoted, from the list of quotes of a user, from the allq command, and delete all quotes from a certain user using ?purgequotes rebuild_mc has been added everywhere where quotes are deleted the delete emoji in ?lq can now only be clicked by the quote list author or by a mod (whereas any users used to be able to click it before and start the delete prompt, but only the author could use the prompt). The person who clicks the reacts is also the only one that can then delete a quote. By doing this, this fixes #215, since Marty cannot even start the prompt anymore. (The check that the message wasn't written by the bot was still added in case and might be useful in case Marty can ever react on other people's messages).
namemcguffin
approved these changes
Sep 1, 2021
davidlougheed
requested changes
Sep 1, 2021
| return all((0 <= int(msg.content) <= len(quote_list), | ||
| msg.author == user_deleting, | ||
| msg.channel == ctx.message.channel, | ||
| msg.author != self.bot.user)) |
| conn.commit() | ||
| index = int(message.content) - 1 | ||
| if index == -1: | ||
| await ctx.send('Exit delq.', delete_after=60) |
Member
There was a problem hiding this comment.
can you early return here to avoid indenting everything?
| except ValueError: | ||
| return False | ||
|
|
||
| while p.edit_mode: |
Member
There was a problem hiding this comment.
this kinda looks like its duplicating a bunch of code - whats up there?
|
|
||
| @commands.command() | ||
| @is_moderator() | ||
| async def purgequotes(self, ctx, user: str): |
Member
There was a problem hiding this comment.
can you make this purge_quotes and add an alias purgequotes to keep the function names pep8?
|
|
||
| while p.edit_mode: | ||
| if user_deleting == ctx.message.author: | ||
| if user_deleting == ctx.message.author: |
namemcguffin
reviewed
Sep 1, 2021
| p = Pages(ctx, | ||
| item_list=quote_list_text, | ||
| title='Quotes from {}'.format(quote_author.display_name)) | ||
| title='Quotes from {}'.format(quote_author.display_name), |
Contributor
There was a problem hiding this comment.
replace with f-strings for consistency (same for line 390)
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.
Moderators can now delete quotes when they are quoted, from the list of quotes of a user, from the allq command, and delete all quotes from a certain user using ?purgequotes
rebuild_mc has been added everywhere where quotes are deleted
the delete emoji in ?lq can now only be clicked by the quote list author or by a mod (whereas any users used to be able to click it before and start the delete prompt, but only the author could use the prompt). The person who clicks the reacts is also the only one that can then delete a quote. By doing this, this fixes #215, since Marty cannot even start the prompt anymore. (The check that the message wasn't written by the bot was still added in case and might be useful in case Marty can ever react on other people's messages).
Resolves #215
Checklist: