Closed FluxC0 closed 1 day ago
This pull request implements a new feature to ban users from creating polls using the Tux bot. It introduces new commands for poll banning and unbanning, adds checks to prevent poll-banned users from creating polls, and includes the necessary database interactions to manage these bans.
Change | Details | Files |
---|---|---|
Implement poll ban and unban functionality |
|
tux/utils/flags.py tux/cogs/moderation/pollban.py tux/cogs/moderation/pollunban.py |
Update Poll cog to check for poll bans |
|
tux/cogs/utility/poll.py |
sequenceDiagram
participant User
participant Tux
participant Database
User->>Tux: /pollban command
Tux->>Database: Check if user is already banned
Database-->>Tux: Ban status
alt User not banned
Tux->>Database: Insert POLLBAN case
Tux->>User: Send confirmation
else User already banned
Tux->>User: Send 'already banned' message
end
sequenceDiagram
participant User
participant Tux
participant Database
User->>Tux: /poll command
Tux->>Database: Check if user is poll banned
Database-->>Tux: Ban status
alt User not banned
Tux->>Tux: Create poll
Tux->>User: Send poll
else User is banned
Tux->>User: Send 'poll banned' message
end
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.
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:
Enhancements:
Documentation: