1
Fork 0
mirror of https://github.com/allthingslinux/tux.git synced 2024-10-03 00:53:12 +00:00
Commit graph

939 commits

Author SHA1 Message Date
kzndotsh
b881796990 feat(membercount.py): add staff count to member statistics
refactor(membercount.py): use discord.utils.get to fetch staff role and its members count for accuracy
fix(membercount.py): only display staff count if it's greater than 0 to avoid confusion when there are no staff members
2024-08-01 21:25:49 +00:00
Atmois
0a8d75452a
Capatlise cog_group in embed 2024-08-01 17:32:10 +01:00
Atmois
58741775e2
Improve help command 2024-08-01 17:24:49 +01:00
electron271
235e7ac3d8
[Commands] Re-add $snippetinfo and add force delete snippet for mods 2024-07-31 21:59:36 -05:00
electron271
8abdf47fe0
Merge pull request #348 from allthingslinux/renovate/pyright-1.x-lockfile
fix(deps): update dependency pyright to v1.1.374
2024-07-31 21:04:49 -05:00
kzndotsh
96af2c0bc6 feat(schema.prisma): switch from development to production database for deployment
refactor(cases.py): add UserConverter as fallback to MemberConverter for better user handling
feat(client.py): enable query logging in Prisma client for better debugging
feat(main.py): add startup log message for better tracking
feat(constants.py): add environment variables for database URLs to support both development and production environments
2024-07-31 23:30:05 +00:00
kzndotsh
56024ec2ff refactor(notes.py, dev.py, eval.py, git.py, mail.py): replace ctx.reply with ctx.send for better compatibility
feat(notes.py, dev.py, eval.py, git.py, mail.py): add ephemeral and delete_after parameters to ctx.send to improve user experience

refactor(random.py, xkcd.py, config.py, export.py, rolecount.py, avatar.py, run.py, ban.py): replace ctx.reply with ctx.send for better compatibility across different contexts
feat(random.py, config.py, avatar.py, run.py, ban.py): add delete_after parameter to auto delete messages after 30 seconds for cleaner chat
fix(rolecount.py): change fallback emoji from role.display_icon to "?" for better error handling
fix(avatar.py): add ephemeral parameter to make certain replies only visible to the command invoker

refactor(cases.py): remove commented code and unused function to improve code readability
refactor(cases.py): replace ctx.reply with ctx.send to ensure compatibility with different bot versions
feat(cases.py): add type hinting to emojis dictionary for better type safety
feat(cases.py): refactor emoji formatting and case description generation for better code organization
fix(jail.py): add condition to check existing permissions before setting new ones to avoid unnecessary API calls
refactor(jail.py): replace ctx.reply with ctx.send to ensure compatibility with different bot versions
style(jail.py): format interaction response to adhere to line length limit

refactor(moderation): replace ctx.reply with ctx.send for better compatibility across different contexts
feat(moderation): add delete_after and ephemeral options to interaction responses for better user experience
chore(moderation): remove unnecessary logging statements to clean up console output
feat(moderation/roles): add ephemeral and delete_after options to role assignment messages for better user experience

refactor(warn.py, poll.py, query.py, remindme.py, snippets.py, tldr.py, wiki.py): replace ctx.reply with ctx.send for consistency
feat(warn.py, poll.py, query.py, remindme.py, snippets.py): add delete_after and ephemeral parameters to ctx.send for better user experience
style(poll.py, tldr.py): remove unnecessary logger.info statements for cleaner code
fix(snippets.py): adjust permission level check for snippet deletion for better access control
feat(wiki.py): add alias 'wk' to wiki command for easier access
style(query.py): shorten footer text in embed message for brevity
2024-07-31 22:56:03 +00:00
Ryna
083c34997b
Merge branch 'main' into regex-patch-1 2024-07-31 16:59:06 -04:00
kzndotsh
7229bc585b refactor(jail.py): extract case insertion logic into a separate function for better code organization
feat(jail.py): add check to prevent jailing already jailed users to improve user experience
fix(jail.py): add error handling for case insertion failure to improve robustness and provide feedback
2024-07-31 20:55:50 +00:00
Ryna
413ccd59e1
Merge branch 'allthingslinux:main' into regex-patch-1 2024-07-31 16:43:20 -04:00
Ryna
f425eca93a updated regex to include ~ 2024-07-31 16:41:13 -04:00
kzndotsh
4c850e9948 refactor(unjail.py): break down unjail command into smaller functions for better readability and maintainability
fix(unjail.py): add error handling for discord API calls to improve robustness
feat(unjail.py): add logging for debugging and auditing purposes
2024-07-31 20:39:52 +00:00
pre-commit-ci[bot]
b4c4570bd3 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-07-31 19:45:01 +00:00
Ryna
e78f0872f2
Merge branch 'allthingslinux:main' into regex-patch-1 2024-07-31 15:36:31 -04:00
Ryna
3a6b610e74 updated regex pattern 2024-07-31 15:30:52 -04:00
kzndotsh
1e46704748 refactor(jail.py): improve code readability and maintainability by breaking down large functions into smaller ones
feat(jail.py): add error handling for jailing users outside of a guild context, jailing oneself, jailing a user with a higher or equal role, and jailing the server owner
fix(jail.py): correct the retrieval of jail role and jail channel by using the correct variable names jail_role_id and jail_channel_id
2024-07-31 19:22:58 +00:00
kzndotsh
78a9e17751 feat(schema.prisma): switch from production to development database for testing purposes
refactor(config.py): rename 'config_set_roles' to 'config_set_perms' for better clarity
feat(config.py): add new 'config_set_roles' command for role configuration
refactor(jail.py): improve error handling when jailing a user
fix(unjail.py): remove unnecessary return statement to allow case insertion even when no previous roles found
refactor(client.py): remove conditional debug check for database logging for cleaner code
2024-07-31 19:13:33 +00:00
kzndotsh
4b1b2de1a9 docs(README.md): add Development Notes section to provide additional instructions for local testing
style(README.md): improve readability by adding line breaks between steps in setup instructions
2024-07-31 18:52:13 +00:00
kzndotsh
da14cbcd49 refactor: increase delete_after time from 10 to 30 seconds in various files for better user experience
This change allows users more time to read the messages before they are automatically deleted.

refactor(moderation): increase ephemeral message delete_after time from 10 to 30 seconds for better user experience and to allow users more time to read the messages

refactor: increase delete_after time from 10 to 30 seconds in moderation/untimeout.py, moderation/warn.py, utility/snippets.py, handlers/error.py, and ui/views/config.py for better user experience and readability
2024-07-31 16:54:31 +00:00
kzndotsh
2110ec97e5 Merge branch 'main' of github.com:allthingslinux/tux 2024-07-31 12:51:43 -04:00
kzndotsh
36e8be37f0 refactor(git.py): replace custom permission check with discord.py's built-in role check for better maintainability and reliability
feat(git.py): allow more roles to create issues to increase user engagement and contribution
2024-07-31 16:50:23 +00:00
electron271
839d16509e
Add explanations for the optional dependencies 2024-07-31 10:03:57 -05:00
renovate[bot]
6ad2235e18
fix(deps): update dependency sentry-sdk to v2.12.0 2024-07-31 13:57:04 +00:00
renovate[bot]
d314fdb003
fix(deps): update dependency pyright to v1.1.374 2024-07-31 10:19:44 +00:00
renovate[bot]
3fceba1fc2
fix(deps): update dependency githubkit to v0.11.8 2024-07-31 10:19:32 +00:00
kzndotsh
c52ca09555 refactor(cases.py): update case type emojis and add case status emoji for better visual representation 2024-07-31 04:46:34 -04:00
kzndotsh
001d310fd3 refactor(cases.py): update case type emojis and add case status emoji for better visual representation
- Updated the case type emojis to use the new set of emojis defined in the 'emojis' dictionary.
- Added a case status emoji to visually represent the active or inactive status of a case.
- Refactored the _add_case_to_embed method to use the new emojis and properly format the case type and action.
2024-07-31 04:28:37 -04:00
kzndotsh
2fd4575cfa refactor(config.py): remove redundant describe decorator from config_set_logs command to improve code readability 2024-07-31 07:23:07 +00:00
kzndotsh
1680343f59 refactor(schema.prisma): switch from DEV_DATABASE_URL to PROD_DATABASE_URL for production readiness
refactor(constants.py): remove unused ROLES constant to clean up code
2024-07-31 07:16:59 +00:00
kzndotsh
6cfe3a0a97 refactor(config.py): replace custom checks with built-in has_permissions check for better compatibility
chore(config.py): add TODO comments for future improvements and features
style(config.py): change 'category' to 'setting' in app_commands.describe for better clarity
2024-07-31 07:03:04 +00:00
kzndotsh
c800bc72b2 docs(schema.prisma): add detailed comments for better understanding of the schema
refactor(schema.prisma): uncomment DEV_DATABASE_URL and DEV_DIRECT_URL for development database usage
style(schema.prisma): remove comment from case_status field for cleaner code
2024-07-31 06:21:36 +00:00
kzndotsh
d70209b889 feat(README.md): add dynamic role-based permission system to feature list
docs(README.md): update installation steps to include bot run command
docs(commands.md): add new file to document bot commands
docs(services.md): add new file to document bot services
feat(info.py): add new cog for server, bot, and member info commands
feat(avatar.py): add new cog for avatar command to fetch user avatars

feat(membercount.py): add new MemberCount cog to show server member count
This new cog includes a command 'membercount' that shows the total number of members, humans, bots, and staff in the server.
2024-07-31 06:06:14 +00:00
kzndotsh
63c9f76501
Merge pull request #339 from allthingslinux/renovate/pre-commit-3.x-lockfile 2024-07-31 01:36:05 -04:00
kzndotsh
0565cb3d68
Merge pull request #343 from allthingslinux/checks 2024-07-31 01:32:44 -04:00
kzndotsh
0a39e14ac6 refactor(tux/cogs): replace permission checks with custom checks for better control over permissions
feat(tux/cogs): add permission level checks to commands for better access control
docs(tux/cogs): add docstrings to commands for better understanding of their functionality

feat(moderation): add permission level checks to moderation commands for enhanced security
fix(report.py): remove unnecessary permission level check from report command
refactor(timeout.py): rearrange decorators for consistency across codebase

refactor(checks.py): simplify permission check logic for better readability and performance

- Simplified the logic for setting higher_bound and determining the source type.
- Removed unnecessary comments and added new ones for clarity.
- Combined the checks for author and role into a single line.
- Simplified the sysadmin and bot owner checks by getting the user ID once and reusing it.
2024-07-31 05:24:17 +00:00
kzndotsh
4460776d1e docs(checks.py): add detailed docstrings and comments to improve code readability and maintainability
refactor(checks.py): streamline code for better readability and performance
fix(checks.py): handle potential exceptions to prevent runtime errors

docs(checks.py): add detailed docstrings to has_pl and ac_has_pl functions for better understanding of their usage
refactor(checks.py): improve error messages and logging for better clarity and debugging
style(checks.py): shorten some log messages for readability
2024-07-31 04:33:16 +00:00
kzndotsh
0b000be44d feat(guild_config.py): add logging to guild config controller for better debugging
refactor(guild_config.py): simplify get_perm_level_role and get_perm_level_roles methods for better readability and error handling
fix(guild_config.py): handle case where no guild config is found for a given guild_id to prevent attribute errors

refactor(checks.py): improve permission checks and role fetching logic

- refactor: Improve permission check logic by adding more detailed logging and error handling.
- refactor: Simplify role fetching logic by using walrus operator and removing redundant checks.
- refactor: Improve readability by removing unnecessary comments and adding more descriptive logging.
- refactor: Improve error handling by adding try-except blocks around database calls.
- refactor: Simplify permission level to name conversion logic.
- refactor: Improve code readability and maintainability.

refactor(checks.py): simplify get_perm_level_roles function to improve readability and performance
fix(checks.py): handle exceptions in get_perm_level_roles function to prevent crashes
style(checks.py): remove redundant comments to improve code cleanliness
2024-07-31 03:40:43 +00:00
electron271
7dd6ba57cf
[Checks] finish checks for once and for all.. hopefully 2024-07-30 20:51:02 -05:00
kzndotsh
3fc6a5ee01 feat(docs): add MkDocs documentation with initial pages
chore(justfile): add commands to serve and build docs using MkDocs
feat(mkdocs.yml): add initial MkDocs configuration with Material theme
chore(pyproject.toml): add mkdocs-material as a dependency for docs group
2024-07-31 01:38:07 +00:00
electron271
330da3d5af
WIP: Add Functionality
Co-authored-by: kzndotsh <kzndotsh@users.noreply.github.com>
2024-07-29 19:13:54 -05:00
kzndotsh
ac34dbb70d
Merge pull request #341 from allthingslinux/main 2024-07-29 17:08:00 -04:00
kzndotsh
a2b839c5b3
Merge branch 'checks' into main 2024-07-29 17:06:51 -04:00
kzndotsh
ad919afc14 feat(docs): add CLI.md, COG_STANDARDS.md, EMBED_STANDARDS.md to .archive directory
docs(CLI.md): provide instructions for installation, development, Docker, linting, formatting, and Git commands
docs(COG_STANDARDS.md): outline standards for creating or updating cogs for the Tux Discord bot
docs(EMBED_STANDARDS.md): establish standards and best practices for creating and utilizing Discord embeds

docs: add EMBED_USAGE.md, EVENT_STANDARDS.md, PROJECT_STRUCTURE.md to provide detailed guidelines and project structure information for contributors

feat(README.md): add dynamic permission system to feature list to reflect new functionality
docs(README.md): update installation steps to include running the bot
docs(PERMISSIONS.md): change permission level 0 from 'Everyone' to 'Member' for clarity
chore(docs/resources): remove unused image.png file from resources
2024-07-29 20:58:32 +00:00
kzndotsh
e34647f984 refactor(notes.py): simplify and streamline notes management code
- Remove redundant database operations and logging
- Simplify command structure and usage
- Improve command descriptions and help messages
- Use ModerationCogBase for common moderation functionality
- Remove unused imports and clean up code structure

refactor(notes): refactor note commands to use commands.Context instead of discord.Interaction for better compatibility
feat(notes): add aliases for note commands for better user experience
fix(notes): handle case when note is not found in delete, update and view commands to prevent errors
feat(notes): add error handling for MemberNotFound and UserNotFound exceptions in delete, update and view commands
refactor(notes): refactor handle_note_response to include previous content in update command for better tracking of changes

feat(config.py): update permission level descriptions for better clarity
feat(ban.py, cases.py, jail.py, kick.py): add user avatar to embeds for better user identification
feat(jail.py): add setup_jail command to configure jail role and channel permissions
fix(jail.py): add checks for jail role and channel existence before jailing a user

chore(notes.py): remove unused Notes class to clean up codebase
feat(timeout.py, unban.py, unjail.py, untimeout.py, warn.py): add user avatar to embed thumbnail for better user recognition
refactor(unjail.py): improve error handling and add more checks for jail role and channel existence
style(info.py): remove unnecessary logging statements to declutter logs

refactor(snippets.py): remove page parameter from list_snippets function to simplify usage
feat(snippets.py): implement pagination for list_snippets function to improve user experience
fix(snippets.py): improve error handling for snippet deletion to prevent unauthorized deletions
style(error.py): remove unnecessary blank line to improve code readability
style(event.py): improve warning message for harmful commands to enhance user understanding

fix(embeds.py): remove unnecessary rounding precision for latency calculation to simplify code
style(embeds.py): remove unnecessary special characters from latency display for cleaner output
refactor(embeds.py): remove type ignore comments after confirming type compatibility
fix(flags.py): change default reason for KickFlags and TimeoutFlags to MISSING for better error handling
docs(flags.py): update description for TimeoutFlags reason to include examples
2024-07-29 20:38:09 +00:00
electron271
f323f1a35d
perm system part 1 2024-07-29 11:45:22 -05:00
kzndotsh
58db2c8a24 refactor(help.py): improve code readability and maintainability by extracting logic into helper methods
fix(help.py): correct the handling of command groups in send_bot_help method to ensure all subcommands are properly displayed
style(help.py): adjust code formatting for better readability and consistency with Python's PEP 8 style guide
2024-07-29 15:49:10 +00:00
renovate[bot]
b12e8d81df
fix(deps): update dependency pre-commit to v3.8.0 2024-07-28 22:26:41 +00:00
electron271
a445431c73
[Meta] Scaffolding for the permission check system. 2024-07-28 16:32:59 -05:00
kzndotsh
002e7d24b6 docs(PERMISSIONS.md): update permission levels to reflect changes in role hierarchy
refactor(schema.prisma): change perm_level_roles to perm_level_role_id for better clarity and consistency
refactor(config.py): update methods and messages to reflect changes in role handling
refactor(snippets.py): rename db_controller to db and config_db to config for better readability
refactor(snippets.py): update permission checks to use new perm_level_9_role_id
refactor(snippets.py): update db method calls to reflect new method names in DatabaseController

refactor(guild_config.py): reorganize methods under CRUD comments for better readability
feat(guild_config.py): add get_perm_level_role method to fetch role based on role type
feat(guild_config.py): add update_perm_level_role method to update role based on level
fix(guild_config.py): modify update_perm_level_role to use upsert instead of update for better data consistency
style(guild_config.py): remove commented out code for cleaner codebase
2024-07-28 19:46:56 +00:00
kzndotsh
6116f762e3
Merge pull request #337 from clonidine/docs-remove-mypy 2024-07-28 14:22:28 -04:00