Skip to content

Conversation

@basil-squared
Copy link
Contributor

@basil-squared basil-squared commented Sep 23, 2024

Description

Creates the pollban command, which can prevent someone from making polls using tux. Fixes #565 .

Guidelines

  • My code follows the style guidelines of this project (formatted with Ruff)

  • I have performed a self-review of my own code

  • I have commented my code, particularly in hard-to-understand areas

  • I have made corresponding changes to the documentation if needed

  • My changes generate no new warnings

  • I have tested this change

  • Any dependent changes have been merged and published in downstream modules

  • I have added all appropriate labels to this PR

  • [ V] I have followed all of these guidelines.

How Has This Been Tested? (if applicable)

I used pollban on myself to make sure the command processed, and then tested making a poll afterwards to ensure that the ban works. Then, i unbanned myself and tested making polls afterward.

Summary by Sourcery

Add new commands 'pollban' and 'pollunban' to manage user permissions for creating polls. Implement checks to enforce poll bans and update documentation to reflect these changes.

New Features:

  • Introduce the 'pollban' command to allow moderators to ban users from creating polls using the bot.
  • Add the 'pollunban' command to allow moderators to unban users from creating polls.

Enhancements:

  • Implement a check to determine if a user is banned from creating polls before allowing them to create one.

Documentation:

  • Update documentation to include details about the new 'pollban' and 'pollunban' commands, including their parameters and usage.

@sourcery-ai

This comment was marked as duplicate.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @FluxC0 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider moving the is_pollbanned method to a shared utility or base class to avoid code duplication between PollBan and PollUnban classes.
  • The comment in on_reaction_add about the bot 'freaking out' suggests an underlying issue with reaction removal. This should be investigated and addressed properly rather than just leaving a comment.
Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 3 issues found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

basil-squared and others added 3 commits September 26, 2024 16:51
@basil-squared
Copy link
Contributor Author

yeah, those changes make sense. i felt as if it was a little unprofessional, but i didnt know what to change it to. thank you for addressing my note.

@electron271 electron271 merged commit e2b4fc8 into main Sep 27, 2024
@electron271 electron271 deleted the 565-add-poll-ban branch September 27, 2024 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add poll ban

3 participants