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

19 commits

Author SHA1 Message Date
kzndotsh
9e221709ac refactor: remove dollar sign from usage instructions in various commands for consistency
chore: remove error handling blocks from dev.py to simplify code and rely on global error handling

refactor: remove dollar sign from usage instructions in command decorators for clarity and consistency across all command usage instructions

feat(error.py): add prefix to command usage in error messages for better clarity
refactor(error.py): change error messages to be more descriptive and accurate
feat(error.py): use embeds for error messages for better readability
refactor(error.py): comment out specific error handlers to allow global handler to catch all errors for consistency

refactor(help.py): remove static prefix and add dynamic prefix fetching to improve flexibility
feat(help.py): add command aliases to help command categories for better command visibility
refactor(help.py): change several methods to async to support dynamic prefix fetching
feat(embeds.py): add create_error_embed method to standardize error embed creation
2024-08-15 06:33:00 +00:00
kzndotsh
edefd3a1df chore(archive): remove old files and update docs 2024-08-04 12:31:27 -04: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
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
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
kzndotsh
1da76195c6 feat(bot.py): add new bot.py file to handle bot setup, cog loading, and event listeners
This new bot.py file includes the Tux class which extends commands.Bot. It handles bot setup, including database connection and cog loading, and includes event listeners for bot readiness and disconnection. It also includes a shutdown method to properly close connections and cancel outstanding tasks.

feat(rolecount.py): add new RoleCount cog to display number of users in each role
This new feature allows users to see the number of users in each role in the server. It supports distro, language, DE/WM, misc, and vanity roles. The role count is displayed in an embed with pagination support.

refactor(run.py): improve readability by breaking down function parameters into multiple lines
style(run.py): change usage from $run <code> to $run [code] for better command understanding
feat(tty_roles.py): add return type to setup function for better type checking
fix(ban.py): change icon_url from CASE to ACTIVE_CASE to reflect the correct case status
fix(ban.py): correct the case action from BAN to the actual action
feat(cases.py): add a check to ensure the slash command is used for this command
feat(cases.py): add total_cases to display the total number of cases in the case list
fix(cases.py): ensure the case reason and status are updated correctly
fix(cases.py): correct the icon_url to reflect the correct case status
fix(jail.py): change icon_url from CASE to ACTIVE_CASE to reflect the correct case status
fix(jail.py): correct the case action from BAN to JAIL
fix(kick.py): change icon_url from CASE to ACTIVE_CASE to reflect the correct case status
feat(purge.py): add support for discord.Thread in addition to discord.TextChannel
fix(purge.py): handle exceptions during message purging and provide a user-friendly error message

refactor(slowmode.py): modify slowmode command to accept discord.Thread in addition to discord.TextChannel for better functionality
fix(unban.py): remove unnecessary target parameter and replace with flags.username_or_id for more accurate unbanning
refactor(unban.py): change error handling to include discord.NotFound exception for better error management
style(unban.py, unjail.py): change icon_url from "CASE" to "ACTIVE_CASE" for better visual representation
refactor(unjail.py): simplify method call to get_last_jail_case_by_target_id for cleaner code

refactor(warn.py): simplify warn command structure to improve maintainability
feat(warn.py): add checks for self-warn, higher role warn, and owner warn to prevent misuse
style(warn.py): improve embed formatting for better readability
feat(membercount.py): add staff count to membercount command for more detailed server info
refactor(info.py, membercount.py, ping.py, case.py, main.py): remove unnecessary logger imports and usages for cleaner code
refactor(main.py): rename client.py to bot.py for better semantics
style(info.py): use discord.utils.format_dt for date formatting consistency

feat(flags.py): add aliases and default values to UnbanFlags
refactor(flags.py): swap positions of reason and status in CaseModifyFlags for better readability
feat(flags.py): add new WarnFlags class for handling member warnings
2024-07-26 18:28:18 +00:00
kzndotsh
dd9cff006f chore: remove unused pagination.py file from .archive directory
feat: add new emoji assets for active_case, added, ban, inactive_case, jail, kick, removed, timeout, warn
feat(pyproject.toml): add reactionmenu package to project dependencies
refactor(ban.py): update usage instruction for ban command and remove unnecessary line after ban execution

feat(moderation/cases.py): add new moderation cases management feature
feat(reactionmenu/__init__.pyi): add new reactionmenu library for discord pagination

The moderation cases management feature allows for viewing and modifying moderation cases in the server. The reactionmenu library supports pagination with buttons, reactions, and category selection using selects.

feat(tux/stubs/reactionmenu/abc.pyi): add new stub file for reactionmenu module

This commit adds a new stub file for the reactionmenu module in the tux library. This will help in providing type hints and autocompletion for the reactionmenu module in IDEs that support Python type hints.

docs: add detailed docstrings to methods and properties in the menu class

This commit adds detailed docstrings to all methods and properties in the menu class. The docstrings include information about the purpose of each method/property, the parameters they accept, the return type, and any exceptions they might raise. This will make it easier for developers to understand how to use the menu class and what each method/property does.

feat: add set_relay and remove_relay methods in the code to handle button press events
docs: add comprehensive docstrings for set_relay and remove_relay methods explaining their functionality, parameters, and exceptions

feat(buttons.pyi): add new type stub file for reactionmenu/buttons.py to provide type hints and improve code readability and maintainability

feat: add ReactionButton class and related methods

This commit introduces the ReactionButton class, which represents a reaction in the ReactionMenu. It includes several methods for setting button details, generating skip buttons, and factory methods for creating specific types of buttons. This enhancement provides a more structured and flexible way to manage reactions in the ReactionMenu.

feat(core.pyi): add new file for ReactionMenu class with methods and properties
docs(core.pyi): add docstrings for ReactionMenu class, methods, and properties to improve code readability and provide usage information

feat: add multiple overloads to start method in ReactionMenu class to support various types of send_to parameters
docs: add comprehensive docstring to start method explaining its parameters, their types, and possible exceptions raised

feat(tux/stubs/reactionmenu): add decorators.pyi and errors.pyi stub files for better type checking
docs(decorators.pyi, errors.pyi): add MIT license and function/class descriptions for better understanding of the code

feat(reactionmenu): add new file views_menu.pyi for type hinting and better code intelligence

feat: add methods to manage menu items in ViewMenu class

- Add methods to add, remove, enable, disable, and get select items
- Add methods to add, remove, enable, disable, and get go to select items
- Add methods to add, remove, enable, disable, and get button items
- Add methods to update menu, randomize button styles, set button styles, and refresh menu items
- Add methods to stop and start the menu
- These changes provide a comprehensive interface for managing menu items in the ViewMenu class.

docs: Add comprehensive docstring to the start method in the menu class

This commit adds a detailed docstring to the start method in the menu class. The docstring includes a description of the method, its parameters, and the exceptions it raises. This will improve code readability and provide better understanding for developers working with this method.

refactor(flags.py): replace default "No reason provided" with MISSING for better error handling
style(flags.py): rename flag names for better clarity and understanding
feat(flags.py): add new class CaseModifyFlags to handle case modifications
2024-07-25 15:04:44 +00:00
kzndotsh
2181da725b refactor(logging): remove unused code 2024-07-24 09:07:05 -04:00
kzndotsh
679de67165 style(neofetch.py, cog_loader.py, avatar.py, tldr.py): correct comment block formatting for consistency
refactor(neofetch.py): modify line separator for better visual appeal
2024-07-15 10:46:57 +00:00
kzndotsh
35dfe6d9d9 docs: update docstrings to follow numpydoc style guide
style: update command usage syntax for better clarity
feat: add new Roles cog for role management commands

refactor(random.py, xkcd.py, run.py, ban.py, kick.py, notes.py, purge.py, slowmode.py, timeout.py, unban.py): simplify command aliases and usage instructions for better user experience
feat(run.py): change command aliases to 'compile' and 'exec' to better reflect command functionality
style(timeout.py): update docstring format for consistency

refactor(warn.py): simplify usage instructions for better user experience
feat(avatar.py): add support for optional member parameter to allow fetching avatar of other members or self
style(avatar.py): update docstring format for better readability
refactor(snippets.py): update usage instructions and add guild_only decorator for better command control
refactor(tldr.py): add alias and usage instruction for tldr command, add guild_only decorator for better command control
style(tldr.py): update docstring format for better readability

refactor(wiki.py): add aliases, usage instructions to wiki commands for better user experience
style(functions.py): standardize docstring format for consistency and readability
2024-07-15 09:42:09 +00:00
kzndotsh
bf08491c5a feat(console.py): add new console.py file to handle bot commands from console
refactor(console.py): replace ThreadPoolExecutor with aioconsole.ainput for non-blocking input
fix(console.py): handle ValueError when channel ID is not an integer in send_message function
refactor(console.py): remove unused close_executor function
feat(console.py): add shutdown_bot function to initiate bot shutdown from console
style(console.py): improve code readability and comments

feat: add command_func() to enhance functionality

feat(pagination.py): add new file for handling pagination in discord interactions
This new file includes a class for creating interactive list menus in discord. It allows for navigation through a list of items (either strings or discord.Embed objects) using buttons in the discord UI. The list menu can be set to be ephemeral (disappears after a certain timeout) or persistent. The class also includes methods for handling user interactions with the list menu, such as jumping to the first or last item, or navigating to the next or previous item.

feat(rolecount.py): add new RoleCount cog to count users in each role
This new feature allows users to see the number of users in each role. It supports distro, language, DE/WM, misc, and vanity roles. The role count is displayed in an embed with pagination support.

feat(moderation): add ModerationCogBase class to handle moderation tasks

This class includes methods for creating and sending embeds, and sending direct messages to users. This will help in managing moderation tasks more efficiently.
2024-07-13 20:02:03 +00:00
kzndotsh
e464051cdc feat(guide.py): add new guide.py file to provide server guide functionality
feat(tools.py): add new tools.py file to provide various tool commands
refactor(tldr.py): remove redundant docstring, rename tldr function to slash_tldr
feat(tldr.py): add prefix_tldr function to support prefix command for TLDR pages

refactor(wiki.py): remove unused import 'app_commands' from discord
style(wiki.py): remove explicit command descriptions for 'arch' and 'atl' commands for cleaner code
docs(wiki.py): simplify function docstrings for 'arch_wiki' and 'atl_wiki' methods for better readability
2024-07-13 19:40:25 +00:00
kzndotsh
fe57c02b99 feat(neofetch.py): add new neofetch command to display system and server stats
chore(.pre-commit-config.yaml): add new pre-commit hooks for trailing commas and gitleaks
refactor(cog_loader.py): improve error logging for cog loading failures
style(.pre-commit-config.yaml, cog_loader.py): apply code formatting rules

style(dev.py, eval.py, git.py, mail.py, random.py): improve code readability by breaking down long lines of code into multiple lines
refactor(eval.py): add trailing comma to logger.warning for better code formatting
refactor(git.py): simplify import statement for Issue from githubkit.versions.latest.models
refactor(mail.py): add line breaks for better readability and code consistency
refactor(random.py): add line breaks in function parameters and conditions for better readability

style(xkcd.py, config.py, export.py): refactor function arguments to multi-line for better readability

style: reformat code for better readability in audit.py, commands.py, gate.py, member.py, run.py, temp_vc.py, tty_roles.py, purge.py
refactor: improve code readability by breaking down complex expressions and function calls into multiple lines

style: reformat code for better readability and PEP8 compliance in multiple files

refactor: simplify list declaration in guide.py for better readability

refactor: improve function parameter formatting in multiple files for better readability

refactor: improve string formatting in multiple files for better readability

refactor: improve function declaration formatting in multiple files for better readability

refactor: improve embed creation in rolecount.py for better readability

style(snippets.py, tldr.py, tools.py, wiki.py): reformat code for better readability
refactor(tools.py): simplify dictionary initialization for encodings and decodings
perf(tldr.py, tools.py): reduce subprocess.run arguments to improve performance
fix(wiki.py): correct the order of error handling and embed creation for better error management

refactor(case.py): improve readability by breaking down long function signatures into multiple lines
style(case.py): add trailing commas to improve code formatting and ease of future changes

style(case.py): improve readability by breaking down long function parameters into multiple lines
refactor(case.py): add trailing commas in dictionary to make future changes cleaner and more readable

style(guild_config.py): refactor function definitions to improve readability and adhere to PEP8 line length standards

style: apply PEP 8 style guide to improve readability and maintainability
refactor: add trailing commas to improve diff readability in future changes
fix(event_handler.py): add missing comma in message string to fix syntax error

style: apply black formatting to improve code readability and maintain consistency across the codebase
2024-07-02 03:41:57 +00:00
kzndotsh
692855e6be Refactor database models and clean up archive
Temp moving moderation and misc files to .archive for cleanup purposes.
Updated `schema.prisma` to use environment variables for production.
Removed redundant user, role, and emoji statistics database models and associated controllers.
Integrated a new `Case` model to consolidate infraction-related data.
Modified reminder, snippet, and note models, and their corresponding controllers to streamline and standardize the database structure.
Removed outdated database seeding commands.
2024-06-29 06:08:48 -04:00
kzndotsh
ef441a7e12 feat: add new mod.py and voice.py files in .archive directory for logging moderation and voice activities
refactor: move mod.py from tux/cogs/logging to .archive directory to improve project structure
2024-05-01 06:18:14 +00:00
kzndotsh
5e67bc6306 feat(ctx_error_handler.py): add new error handler for command context
refactor(error_handler.py): update error handling logic to improve error messages and logging
fix(error_handler.py): handle app command errors separately to avoid conflicts
style(error_handler.py): improve code readability and maintainability by simplifying error handling logic

feat(test_error_handler.py): add new file for testing error handling in discord.py
This new file contains a Cog class with commands to raise every type of discord.py error for testing purposes.

feat: add error handling commands to ErrorTests cog in discord bot

This commit adds a series of commands to the ErrorTests cog in the discord bot. Each command raises a specific exception when invoked, allowing for testing and debugging of error handling mechanisms. The exceptions covered include DisabledCommand, CommandInvokeError, CommandOnCooldown, MaxConcurrencyReached, various ExtensionErrors, ClientException, and CommandRegistrationError.

refactor(error_handler.py): rename ErrorHandler to UnifiedErrorHandler for clarity
feat(error_handler.py): add support for traditional command errors and app command errors
fix(error_handler.py): improve error message for better user experience
style(error_handler.py): refactor code for better readability and maintainability
2024-05-01 04:10:58 +00:00
kzndotsh
f21d7233f5 feat(ghub.py): add new GitHub commands for discord bot
refactor(ghub.py): improve error handling and code readability by extracting common code into helper functions

feat: add create, get, and comment commands to GitHub bot
- The create command allows users to create a pull request in a specified repository.
- The get command retrieves a specific pull request from a repository.
- The comment command allows users to comment on a specific pull request in a repository.
These changes were made to enhance the functionality of the GitHub bot.

chore(ghub.py): remove ghub.py file as it is no longer needed in the project
2024-04-18 07:08:03 +00:00
kzndotsh
135c6ab0a0 chore(structure) move tmp to .archive + create infra dir 2024-04-11 18:10:01 -04:00