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

741 commits

Author SHA1 Message Date
kzndotsh
cf5e8825f3 refactor(avatar.py): modify avatar command to support both slash and prefix commands
feat(avatar.py): add guild_only decorator to restrict command usage to guilds only
style(avatar.py): improve function and parameter descriptions for better understanding
fix(avatar.py): replace profile_avatar with global_avatar for accurate representation
2024-07-13 19:38:17 +00:00
kzndotsh
37c796d24e feat(schema.prisma): add DEV_DATABASE_URL and DEV_DIRECT_URL as commented lines for easy switch between prod and dev databases
refactor(schema.prisma): reorder CaseType enum values for better readability
fix(schema.prisma): rename TIMEOUT_ADD and TIMEOUT_REMOVE to TIMEOUT and UNTIMEOUT for better semantics
2024-07-13 19:37:14 +00:00
kzndotsh
709202ace7 feat(helpers.py): add new helper functions for discord bot to improve code reusability and maintainability 2024-07-13 19:35:25 +00:00
kzndotsh
8b2c035069 refactor(main.py): rename TuxBot class to Tux for simplicity
chore(main.py): comment out unused imports and variables to clean up code
fix(main.py): remove activity_changer as it's no longer used
style(main.py): add logger.info statements for better logging
refactor(main.py): simplify prefix and token assignment
refactor(main.py): replace bot.shutdown() with bot.close() for clarity
chore(main.py): comment out console related code as it's not used currently
2024-07-13 19:33:47 +00:00
kzndotsh
c72551ccca chore(activities.py): remove activities.py as it is no longer needed
feat(flags.py): add new flags.py file to handle command flags for ban, temp ban, kick, timeout, and unban commands
2024-07-13 19:32:49 +00:00
kzndotsh
51692de2fd feat(tux/handlers): add activity, error, and event handlers for bot functionality
- activity.py: Implement ActivityHandler for managing bot activities
- error.py: Implement ErrorHandler for handling command errors
- event.py: Implement EventHandler for handling guild join/leave events and harmful message detection
2024-07-13 19:30:47 +00:00
kzndotsh
44120fdbb8 refactor(functions.py): simplify harmful_command_pattern for readability
fix(functions.py): remove unused import Callable
refactor(functions.py): remove redundant second_test in is_harmful function
feat(functions.py): add return type hints to datetime_to_unix and datetime_to_elapsed_time functions
chore(functions.py): remove unused functions to improve code maintainability
2024-07-13 19:29:14 +00:00
kzndotsh
a9bcf45421 refactor(cog_loader.py): replace aiopath with pathlib and aiofiles for better compatibility
fix(cog_loader.py): remove conditional cog_ignore_list based on DEV constant, use a single COG_IGNORE_LIST for simplicity
style(cog_loader.py): rename variables for clarity, apath to path, and filepath to path
2024-07-13 19:26:53 +00:00
kzndotsh
7925a3cecc refactor(settings.json, constants.py): simplify and rename EMBED_STATE_COLORS and EMBED_STATE_ICONS to EMBED_COLORS and EMBED_ICONS respectively for better readability
feat(constants.py): add TOKEN, PREFIX, COG_IGNORE_LIST constants to handle environment specific variables for better code maintainability
style(constants.py): remove unused UNICODE and EMOJIS constants to clean up the code
fix(settings.json): update EMBED_COLORS and EMBED_ICONS values to reflect the latest design changes
2024-07-13 19:25:16 +00:00
kzndotsh
365c0278f8 feat: add new modules for tux application
This commit includes the addition of new modules for the tux application. These modules include cogs, database, handlers, services, and utils. Each of these modules has been initialized with an __init__.py file.
2024-07-13 19:23:48 +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
electron271
ee47eb22c0
Merge pull request #300 from Bikoil/main
Added warning when `rm -rf ~`  is mentioned
2024-07-13 11:23:35 -05:00
electron271
b1bf1cc84f
Merge pull request #299 from allthingslinux/renovate/pyright-1.x-lockfile
fix(deps): update dependency pyright to v1.1.371
2024-07-11 21:31:57 -05:00
electron271
780d036423
Merge pull request #305 from allthingslinux/renovate/sentry-sdk-2.x-lockfile
fix(deps): update dependency sentry-sdk to v2.9.0
2024-07-11 21:27:21 -05:00
kzndotsh
2645bd7351 feat(assets): update distro logos for antix, mx, and redhat to provide more updated and visually appealing images 2024-07-11 17:26:03 -04:00
kzndotsh
cbafd221c5 feat(assets): add new distro icons for better visual representation of different operating systems 2024-07-11 14:31:52 -04:00
kzndotsh
b410e7d5c8 feat(assets): add new badges and emojis for user achievements and notifications
chore(assets): remove unused slicedsymbol images to clean up the assets directory
2024-07-11 17:38:59 +00:00
Biko
b6bfd29000
Merge branch 'allthingslinux:main' into main 2024-07-11 03:21:07 +03:00
pre-commit-ci[bot]
161ebd88a0 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-07-11 00:19:41 +00:00
Bikoil
1b4d0749a5 Accidentally imported a module twice 2024-07-11 03:19:10 +03:00
Bikoil
e9fd9d8a39 Added support warning for dangerous windows commands 2024-07-11 03:16:06 +03:00
renovate[bot]
f040273344
fix(deps): update dependency sentry-sdk to v2.9.0 2024-07-10 09:47:48 +00:00
renovate[bot]
93a2e4e393
fix(deps): update dependency pyright to v1.1.371 2024-07-10 09:47:40 +00:00
electron271
979bc82008
remove mod/admin from ds and replace with staff 2024-07-06 15:04:43 -05:00
electron271
6b3ec268e0
allow mods/admins/devs to delete snippets 2024-07-06 14:55:59 -05:00
Bikoil
c4bd401135 Added so that tux shows a Warning when someone says rm -rf ~ to the list 2024-07-04 02:51:54 +03:00
kzndotsh
884c9f91f0 style(Dockerfile): add line breaks for better readability and maintainability
fix(Dockerfile): ensure commands are chained properly with && and \ for correct execution
style(Dockerfile): add newline at end of file to adhere to POSIX standards
2024-07-02 21:09:07 +00:00
kzndotsh
3df8509f7d fix(justfile): correct typo in docker compose command from --detatch to -d for proper detaching of the process
style(justfile): remove trailing whitespace in run and setup-env commands for cleaner code
2024-07-02 20:56:44 +00:00
kzndotsh
53a7493345 feat(poetry.toml): add poetry.toml file to create virtual environments within the project directory
refactor(dev.py): rearrange error handling methods for better readability and maintainability
refactor(avatar.py): extract common logic into send_avatar method to reduce code duplication
refactor(remindme.py): simplify database access by directly using the reminder table
feat(case.py, note.py, reminder.py): add ensure_guild_exists method to check and create guild if not exists
refactor(case.py, note.py, reminder.py): call ensure_guild_exists before creating a new entry to ensure guild exists

feat(snippet.py): add ensure_guild_exists method to check and create guild if not exists
refactor(snippet.py): modify create_snippet method to call ensure_guild_exists before creating a snippet, ensuring guild existence
2024-07-02 19:19:07 +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
2625d93419 chore(poetry.lock): update dependencies in lock file to ensure project uses the latest secure versions
chore(pydantic): upgrade pydantic from 2.7.4 to 2.8.0 for better data validation
chore(pydantic-core): upgrade pydantic-core from 2.18.4 to 2.20.0 to match pydantic version
feat(typing-extensions): add python version specific markers for typing-extensions to ensure compatibility

chore: remove pydantic_core-2.18.4 hashes from the project as they are no longer needed

chore: upgrade pydantic_core from 2.18.4 to 2.20.0 for better performance and bug fixes

feat: update pydantic_core to version 2.20.0 for better performance and compatibility

feat: update pydantic_core to version 2.20.0 for better performance and stability
2024-07-02 02:45:24 +00:00
kzndotsh
511d240006
Merge pull request #297 from allthingslinux/renovate/pillow-10.x-lockfile 2024-07-01 22:40:05 -04:00
kzndotsh
050d91bfe4
Merge pull request #296 from allthingslinux/pre-commit-ci-update-config 2024-07-01 22:39:54 -04:00
kzndotsh
45e9c55d53
Merge pull request #293 from allthingslinux/renovate/sentry-sdk-2.x-lockfile 2024-07-01 22:39:43 -04:00
kzndotsh
f7095ac972 Merge branch 'main' of github.com:allthingslinux/tux 2024-07-01 22:37:30 -04:00
kzndotsh
54469b3228 refactor(mail.py, random.py, export.py): simplify function definitions and calls for better readability
feat(random.py): add hybrid_group for random generation commands to improve command organization
style(random.py): update custom responses in eight_ball function for consistency
fix(random.py): add guild_only decorator to random command group to restrict usage to guild channels
2024-07-02 02:33:45 +00:00
kzndotsh
96b04b1b16 [Fix] Linting and formatting via Ruff 2024-07-02 02:33:36 +00:00
kzndotsh
bd1f57fc68 refactor(logging): simplify function arguments and conditional statements for better readability
feat(logging): optimize the way 'expires_at' is calculated in 'gate.py'
refactor(member.py): simplify the way fields are added to embed
refactor(message.py): simplify the condition for checking if a message is not a message
chore(auto_respond.py): remove the file as it's no longer needed
2024-07-02 02:33:14 +00:00
kzndotsh
bf416f8338 feat(wiki.py): add new Wiki cog to query ArchWiki and ATL Wiki APIs
This new feature allows users to search the ArchWiki and All Things Linux Wiki directly from the bot, returning the title and URL of the first search result.
2024-07-02 02:32:54 +00:00
kzndotsh
95e7f665b2 refactor(git.py): rename 'git' instance to 'github' for better clarity
style(git.py): shorten long lines to improve readability
feat(xkcd.py): add XkcdLinkButtons class to provide link buttons for xkcd comics
style(neofetch.py, xkcd.py): shorten long lines to improve readability
refactor(xkcd.py): move XkcdLinkButtons class to the top for better organization

refactor(roles.py): rename group to role for better semantics
style(roles.py, run.py, temp_vc.py, tty_roles.py, purge.py, avatar.py, guide.py, info.py, membercount.py): simplify function calls and conditions for better readability
fix(report.py): simplify report submission process, remove webhook creation and deletion
feat(avatar.py): add prefix command for getting member avatar
chore(roles.py, run.py, temp_vc.py, purge.py, avatar.py, membercount.py): remove logger calls to reduce verbosity

style: refactor multiline function calls and conditions to single line for better readability
fix(snippets.py): correct database controller attribute from 'snippets' to 'snippet' to match the correct database table name
2024-07-02 02:32:28 +00:00
kzndotsh
c8b5e1f0e8 refactor(admin/clear.py): remove clear.py as it's functionality is now covered by dev.py
feat(admin/dev.py): add new dev.py file to handle developer related commands such as syncing and clearing command trees, and loading, unloading, and reloading cogs for better bot management

chore: remove unused admin cogs (load, reload, sync, unload) from the project to clean up the codebase
2024-07-02 02:31:09 +00:00
kzndotsh
4d6c56d65e refactor(activities.py, console.py, constants.py, embeds.py, exports.py, functions.py, pagination.py, sentry.py): simplify function definitions and improve readability
style(activities.py, console.py, constants.py, embeds.py, exports.py, functions.py, pagination.py, sentry.py): reformat code to adhere to PEP8 guidelines
feat(functions.py): add harmful command detection and formatting stripping functions for better security and data handling
docs(sentry.py): add docstring to setup_sentry function for better code documentation
2024-07-02 02:29:28 +00:00
kzndotsh
ed1aaaad19 feat(cog_loader.py): add support for loading cogs from 'handlers' folder to extend bot functionality
feat(error_handler.py): add new ErrorHandler cog to handle bot command errors in a centralized manner
feat(event_handler.py): add new EventHandler cog to handle bot events such as guild join, guild remove, and message
refactor(main.py): improve code readability and organization by reordering and grouping related code blocks
style(cog_loader.py, main.py): remove unnecessary blank lines to adhere to PEP 8 style guide
2024-07-02 02:28:57 +00:00
kzndotsh
d96ffa5492 feat(schema.prisma): add GuildConfig model to store guild-specific configurations
refactor(schema.prisma): add unique and index constraints to Guild and Reminder models for better data integrity and query performance
refactor(__init__.py): rename controllers to singular form for better semantics
feat(__init__.py): add GuildController and GuildConfigController to DatabaseController for handling guild and guild config related operations

feat(case.py): add CaseController class to handle database operations for cases

This commit introduces a new class, CaseController, in the case.py file. This class provides methods for various database operations related to cases, such as getting all cases, getting a case by its ID, inserting a new case, deleting a case by its ID, updating a case by its number and guild ID, and various methods for getting cases based on different parameters. This class will help in managing the cases in the database in a more structured and efficient way.

feat(database/controllers/guild.py): add GuildController class to manage guild operations
This class includes methods to get, insert, and delete guilds by id.

feat(guild_config.py): add GuildConfigController class to manage guild configurations

This new class provides methods for creating, updating, and retrieving guild configurations. It also ensures that a guild exists before performing operations. This change allows for more efficient and organized management of guild configurations.

feat(database/controllers): add NoteController, ReminderController, SnippetController classes for database operations
- NoteController provides methods for CRUD operations on notes and fetching notes based on various parameters
- ReminderController provides methods for CRUD operations on reminders
- SnippetController provides methods for CRUD operations on snippets and fetching snippets based on various parameters
2024-07-02 02:28:00 +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
renovate[bot]
dbc0f6e84f
fix(deps): update dependency pillow to v10.4.0 2024-07-01 21:15:44 +00:00
pre-commit-ci[bot]
bffffc0130
[pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.10 → v0.5.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.10...v0.5.0)
2024-07-01 21:14:54 +00:00
kzndotsh
62f74b67aa
Merge pull request #295 from allthingslinux/refactor-multiguild 2024-06-29 06:11:09 -04: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
renovate[bot]
68e03ac1ff
fix(deps): update dependency sentry-sdk to v2.7.1 2024-06-27 17:19:41 +00:00