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

55 commits

Author SHA1 Message Date
kzndotsh
0b494a41b8 feat(pyproject.toml): add 'emojis' package to dependencies to support emoji handling
feat(pyproject.toml): add 'types-dateparser', 'types-pytz', 'types-pyyaml' to dependencies for better type checking
refactor(pyproject.toml): clean up 'exclude' lists in 'tool.ruff' and 'tool.pyright' sections, removing unnecessary entries
feat(pyproject.toml): enable 'enableReachabilityAnalysis', 'reportImportCycles', 'strictDictionaryInference', 'strictListInference', 'strictSetInference' in 'tool.pyright' for stricter type checking
refactor(pyproject.toml): move '.venv' to 'ignore' list in 'tool.pyright' section for better project structure management
2024-09-14 04:51:52 -04:00
2e2a3b21b4 refactor: First starboard prototype 2024-09-04 06:32:13 -04:00
renovate[bot]
83395e9328
fix(deps): update dependency aioconsole to ^0.8.0 2024-08-31 17:48:56 +00:00
kzndotsh
6e6dd633aa refactor(reactionmenu): move stubs to new typings dir 2024-08-31 13:39:57 -04:00
kzndotsh
66ec2bbb71 feat(pyproject.toml): add pytz library to manage timezone related operations 2024-08-24 05:37:00 +00:00
kzndotsh
1a1a310b28 feat(pyproject.toml, bot.py): add jishaku library for debugging and load it as an extension in bot.py to enhance debugging capabilities 2024-08-22 03:57:14 +00:00
kzndotsh
ea1df7797c chore(pyproject.toml): update dependencies and linting rules
- feat(pyproject.toml): add pyyaml to main dependencies for YAML file handling
- fix(pyproject.toml): move pyyaml from wrong section to main dependencies
- refactor(pyproject.toml): add new linting rules "PLR0913", "PLR2004" to ignore list for better code quality
- feat(pyproject.toml): add "FURB" and "PL" to select list for enhanced linting checks
2024-08-22 02:55:57 +00:00
kzndotsh
829762d8d1 chore: switch from JSON to YAML for configuration file
feat: add pyyaml to dependencies to parse YAML files
fix: remove unused LOG_CHANNELS constant from constants.py
refactor: add default values for environment variables in constants.py
feat: ignore YAML configuration file in .gitignore
refactor: delete unused JSON example configuration file
2024-08-22 01:44:00 +00:00
renovate[bot]
a4c383702d
fix(deps): update dependency prisma to ^0.15.0 2024-08-17 00:11:53 +00:00
renovate[bot]
317893660e
fix(deps): update dependency ruff to ^0.6.0 2024-08-15 14:40:08 +00:00
kzndotsh
ae5006e12d chore: update pyproject.toml with new ruff rules 2024-08-06 05:38:55 -04:00
renovate[bot]
6c839e6fd0
fix(deps): update dependency prisma to ^0.14.0 2024-08-04 18:45:56 +00:00
kzndotsh
e43d8578ff feat(schema.prisma): uncomment development database URLs and comment production URLs for development testing
feat(pyproject.toml): add aiocache dependency for caching support
refactor(tux/cogs): change import style for checks from tux.utils
refactor(tux/cogs/admin/git.py): replace LinkButton with GithubButton for code reuse
refactor(tux/cogs/fun/xkcd.py): replace XkcdLinkButtons with XkcdButtons for code reuse
refactor(tux/cogs/guild/export.py): change import style for checks and exports from tux.utils
remove(tux/cogs/helpers.py): delete Helpers cog as it's no longer needed
refactor(tux/cogs/info/membercount.py): refactor member count command to return early if no guild is found

refactor(moderation): change import statement for checks module for better readability
feat(ban.py): add check_ban_conditions function to improve code reusability and maintainability
refactor(report.py): move ReportModal class to a separate file for better code organization

feat(snippets.py): add first and last page buttons to snippets list for better navigation
style(snippets.py): add line breaks for better code readability
fix(snippets.py): make error messages ephemeral and auto-delete after 30 seconds for cleaner chat
refactor(snippets.py): restructure snippet information embed for better readability and add bot latency
fix(client.py): disable query logging for better performance
refactor(guild_config.py): remove unused permission levels 8 and 9
fix(main.py): allow bot to mention roles for better user interaction
feat(buttons.py): add new buttons for XKCD and Github for better user experience
feat(report.py): add new report modal for anonymous reporting
refactor(constants.py): use config for TEMPVC constants instead of environment variables
style(embeds.py): simplify footer text in embeds for cleaner look
refactor(github.py): rename GitHubService to GithubService for consistency
2024-08-03 03:50:36 +00: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
kzndotsh
83cf9fbb46 fix(schema.prisma): add @id decorator to guild_id in GuildConfig model to ensure uniqueness and prevent duplication
feat(pyproject.toml): add pydantic package to manage data parsing and validation more efficiently

refactor(config.py): remove ConfigSelectMenu and ConfigSelectView classes to reduce redundancy
feat(config.py): import ConfigSetChannels, ConfigSetPrivateLogs, ConfigSetPublicLogs from tux.ui.views.config for better modularity and code organization

refactor(config.py): simplify and restructure guild configuration commands

- Replace the individual role setting commands with a single `config_set_roles` command that uses a choice parameter for the permission level. This reduces code duplication and makes the command more flexible.
- Replace the individual log setting commands with a single `config_set_logs` command that uses a choice parameter for the log category. This reduces code duplication and makes the command more flexible.
- Add a new `config_set_channels` command for configuring guild channels. This provides a more intuitive and user-friendly way to configure channels.
- Remove commented out code to improve code readability and maintainability.

refactor: remove commented out code for cleaner codebase
feat: add 'config_get_roles' command to fetch guild roles for better role management

refactor(guild_config.py): remove unused role update methods to clean up code
feat(guild_config.py): add method to update permission level roles for better role management
fix(guild_config.py): ensure guild exists before updating guild config to prevent errors

feat(tux/ui/views/config.py): add new file to handle discord UI views for setting log and channel configurations

This commit introduces a new file, config.py, in the tux/ui/views directory. This file contains classes for handling discord UI views for setting private, public, and channel logs. Each class has methods for setting different types of logs or channels, such as private log, report log, dev log, mod log, audit log, join log, jail channel, starboard channel, and general channel. These methods update the respective log or channel ID in the database and send a confirmation message to the user.
2024-07-28 17:50:44 +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
renovate[bot]
752359f6d5
fix(deps): update dependency ruff to ^0.5.0 2024-07-15 10:15:52 +00:00
kzndotsh
b02e1ee5f3 chore(.env.example): restructure and clean up environment variables for better organization and clarity
feat(.pre-commit-config.yaml): add pre-commit hooks for yaml, json, toml files and dotenv files for better code quality
feat(justfile): add check-types command to run pyright for type checking
refactor(pyproject.toml): replace aiopath with aiofiles and add types for aiofiles and psutil, adjust pyright settings for strict type checking
2024-07-13 19:21:16 +00:00
kzndotsh
7a02e448d3 chore: remove unused pyright and vulture configurations from .pre-commit-config.yaml and pyproject.toml
style(Dockerfile): improve readability by aligning RUN commands
refactor(pyproject.toml): increase line-length limit to 120 and change line-ending to 'lf' for better compatibility
2024-07-02 02:23:17 +00:00
kzndotsh
3137677cd8 feat(pyproject.toml): upgrade sentry-sdk to version 2.7.0 and add httpx and loguru extras for enhanced error tracking and logging capabilities 2024-06-27 03:23:31 +00:00
electron271
c07321a72a
Update pyproject.toml 2024-06-21 23:10:07 -05:00
renovate[bot]
f84276e312
fix(deps): update dependency psutil to v6 2024-06-19 02:11:37 +00:00
kzndotsh
c5220c733a feat(.env.example): add new environment variables for Github and reorganize the file for better readability
refactor(pyproject.toml): reorder dependencies and add new ones for better project management
feat(tux/utils/constants.py): add new constants for gate logging and tux logs to improve logging capabilities
2024-04-28 20:49:12 +00:00
renovate[bot]
102079f138
fix(deps): update dependency sentry-sdk to v2 2024-04-25 16:42:18 +00:00
renovate[bot]
67e65edd97
fix(deps): update dependency ruff to ^0.4.0 2024-04-18 23:18:29 +00:00
kzndotsh
669e31f4f4 chore(.gitignore): add github-private-key.pem to .gitignore to prevent accidental commit of private keys
refactor(pyproject.toml): replace pygithub with githubkit for better GitHub App authentication support
2024-04-18 07:04:39 +00:00
Kasen Engel
5f7178b2f9
Merge branch 'main' into githubapi 2024-04-14 06:56:36 -07:00
kzndotsh
5e7ed577da feat(pyproject.toml): add rsa dependency to support new encoding methods
feat(tools.py): add new encoding methods (base64, md5, sha256, sha512) to Tools class
feat(tools.py): add new command 'encode' to encode a string to a specified format
fix(tools.py): remove '#' from color if color format is HEX to ensure correct color conversion
style(tools.py): update description of 'tools' group to 'Various tool commands' for clarity
2024-04-12 19:09:38 +00:00
kzndotsh
ff1c83a7a6 feat(pyproject.toml): add httpx, cairosvg, and pillow dependencies for new color conversion feature
feat(tools.py): add new Tools cog with color conversion command to convert colors to different formats
2024-04-12 16:29:35 +00:00
yaboytabby
e91e981ab8 Added logic 2024-04-11 21:25:51 -05:00
kzndotsh
135c6ab0a0 chore(structure) move tmp to .archive + create infra dir 2024-04-11 18:10:01 -04:00
kzndotsh
7b117b1060 feat: add .editorconfig for consistent coding style across different editors
feat: add dependabot.yml for weekly updates of GitHub Actions
chore: update Python version from 3.11 to 3.12 in .mise.toml and pyproject.toml
chore: update various dependencies in pyproject.toml to their latest versions
feat: add dependency-review.yml for automated dependency review on pull requests and weekly schedule
feat: add docker-compose.yml for setting up bot and postgres services in Docker environment
2024-04-11 20:22:47 +00:00
kzndotsh
67cdc52212 chore(pre-commit-config.yaml): update ruff-pre-commit version to v0.3.6 for latest features and bug fixes
feat(mypy.ini): add new mypy.ini file for better type checking configuration
fix(schema.prisma): make created_at field in Users model nullable to handle users without creation time
feat(schema.prisma): add color field to Roles model to store role's color information
refactor(pyproject.toml): rearrange linting configuration for better readability and remove redundant mypy configuration
2024-04-11 17:56:45 +00:00
kzndotsh
693001b7d5 feat(docs): add COG_STANDARDS.md to provide guidelines for cog creation
feat(docs): add EMBED_STANDARDS.md to establish standards for embed usage
chore(docs): remove EMBED_STANDARD.md as it's replaced by EMBED_STANDARDS.md

docs: add EMBED_USAGE.md and EVENT_STANDARDS.md to provide usage guidelines and best practices for EmbedCreator utility and event listeners
chore: remove unused __event_template__.py and base_cog.py from examples directory to clean up the codebase
build(pyproject.toml): add aioconsole and psutil to poetry dependencies for better async console handling and system monitoring
2024-04-08 21:12:54 +00:00
kzndotsh
b944385860 feat(pyproject.toml): add psutil package to monitor system resources
refactor(guide.py): replace custom embed creation with EmbedCreator utility
feat(ping.py): add CPU and RAM usage to bot's latency check
refactor(poll.py): replace custom embed creation with EmbedCreator utility, add TODO for future improvements
refactor(rolecount.py): replace custom embed creation with EmbedCreator utility, improve choice names for clarity
refactor(controllers.py): move DatabaseController class to top for better readability
style(main.py): remove unnecessary newline
feat(constants.py): add POLL color and icon to constants
feat(embeds.py): add method to create poll embeds with specific color and icon
2024-04-08 20:48:59 +00:00
kzndotsh
fcc152d4a7 refactor(pyproject.toml): remove unused dependencies and add new ones for better functionality
fix(cog_loader.py): add exception handling to cog loading process to prevent crashes due to faulty cogs
feat(main.py): add shutdown process to handle bot termination gracefully and prevent data loss
refactor(main.py): remove console task from bot ready event to improve startup speed
feat(main.py): add KeyboardInterrupt handling to allow graceful shutdown on manual termination

refactor(console.py): replace ThreadPoolExecutor with aioconsole.ainput for non-blocking input
feat(console.py): add shutdown_bot method to initiate bot shutdown from console
fix(console.py): handle ValueError when channel_id is not an integer in send_message method
fix(console.py): handle discord.HTTPException when sending message fails in send_message method
refactor(console.py): use dictionary.get method to fetch command function to avoid KeyError

refactor(sentry.py): remove unused opentelemetry and aiohttp integrations to simplify code and improve performance
fix(sentry.py): remove unused variables 'instrumenter' and 'provider' to clean up code and improve readability
2024-04-08 15:51:14 +00:00
kzndotsh
f68a16b476 feat(base_cog.py): add base cog with example commands for better code organization
feat(settings.ini): add example ini file for abstracting permissions
feat(warn.py): add warn command to warn users for moderation purposes
refactor(ban.py, kick.py, unban.py): move default reason to function call for better readability
chore(pyproject.toml): remove black configuration as it's no longer needed
2024-04-01 19:27:00 +00:00
kzndotsh
3080f23d63 feat(pyproject.toml): add dateparser and opentelemetry-distro dependencies
fix(pyproject.toml): update sentry-sdk version and extras from httpx to opentelemetry
refactor(pyproject.toml): update linting configuration and ignore rules
refactor(tux/*): rename Constants alias from C to CONST for better readability
refactor(tux/database/models.py): improve function parameters naming for clarity
feat(tux/main.py): integrate opentelemetry for better tracing and monitoring
refactor(tux/utils/_utils.py): improve is_convertible_to_type function readability

refactor(constants.py): change all constant keys to uppercase for better readability and consistency
refactor(constants.py): rename class instance from 'C' to 'CONST' for better clarity and understanding
feat(constants.py): change import statement and usage examples to reflect the new class instance name 'CONST'
2024-03-31 19:29:27 +00:00
kzndotsh
669617b611 feat(pyproject.toml): add dateparser library to handle date parsing
refactor(ban.py): simplify ban command, add role checks, improve logging and error handling
refactor(kick.py): simplify kick command, add role checks, improve logging and error handling
refactor(slowmode.py): simplify slowmode command, add role checks, improve logging and error handling

refactor(unban.py): rename class 'unban' to 'Unban' for better code readability
feat(unban.py): add role check to unban command to restrict access to certain roles
refactor(unban.py): simplify unban logic by using discord.utils.get and discord.utils.find
fix(unban.py): handle discord.HTTPException for better error handling
refactor(unban.py): extract embed creation and error message sending to separate methods for better code organization
2024-03-31 17:46:58 +00:00
kzndotsh
772eae6a2d [Refactor] Major changes to dir structure, temp removal of permissions, added loguru, added some async libs, improve types, clean pyproject config 2024-03-27 16:16:33 -04:00
kzndotsh
d39034e25a [Deps][CI/CD][Docs] Minor updates and fixes 2024-03-26 17:36:26 -04:00
kzndotsh
feb7d91c0d [Deps][Fix] Update ruff version to latest and pyproject tweaks 2024-03-25 01:10:40 -04:00
kzndotsh
80659c800e [Feat][Infra] Add Sentry monitoring 2024-03-22 12:41:52 -04:00
kzndotsh
9f72cbb02b [Fix] Examples dir issue 2024-03-22 06:56:30 -04:00
kaizen
e64781ad1b [Refactor][Update] pre-commit hook versions and refactor error handling
Pyright type checking has been set to basic for now.

The pre-commit hooks for `ruff-pre-commit` and `pyright-python` have been updated to their latest versions for code quality improvements. The `pre-commit-config` and `pyproject.toml` files were modified to reflect these changes.

Also, the error handler has been completely rewritten in a more flexible and scalable manner, addressing various error scenarios in a cleaner and clearer way. Individual error handling methods for common cases are now in place, making it easier to extend with more exception types in the future.

Removed some unused references to the old error handler in the main application file, simplifying the logic there. The `pyright` type checking configuration in `pyproject.toml` was also adjusted for less strict checking, better suited to our current project requirements.

Lastly, the lockfile `poetry.lock` was updated and unnecessarily tagged "dev" packages were removed.

In the wake of these changes, be mindful that the behaviour of error prompts to the user and of type checks may slightly differ.

Additional notes include punctuation and formatting adjustments to improve readability throughout the files changed.
2024-01-09 22:58:09 -05:00
ExploitDemon
e5c905a024 [Fix] pyproject.toml refractoring 2024-01-08 19:01:17 -07:00
ExploitDemon
f70271f6c1 [Fix] Ruff 2024-01-08 18:35:14 -07:00
Scott
8657674d94 [Reorg] Removed docstrings and put relevant info into the tux_logger.md file 2023-12-29 11:58:04 -05:00
Scott
7362102c08 [Fix] reverted back to original and added some more rules 2023-12-29 10:12:22 -05:00
Scott
ae3fe443cf [Fix] Removed line length rule since it is not supported 2023-12-29 09:57:27 -05:00