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

13 commits

Author SHA1 Message Date
electron271
3aa6542985
[Commands] add reminders 2024-04-22 10:57:15 -05:00
kzndotsh
9268f8a27e feat(schema.prisma): add Commands and CommandStats models to track command usage
fix(schema.prisma): set default value for bot field in Users model to false
feat(error_handler.py): add handling for CommandNotFound error
refactor(ban.py, kick.py): add database logging for infractions, improve error handling and embed creation
feat(ban.py, kick.py): add support for Jr. Mod role in ban and kick commands
docs(kick.py): add docstrings for methods and class

feat(warn.py): add database integration for warnings, now warnings are stored in the database
refactor(warn.py): improve warning embeds, now they include more detailed information
refactor(infractions.py): move InfractionType enum to a separate file for better organization
feat(constants.py): add new constants for infraction embeds
feat(embeds.py): add new method for creating infraction embeds
feat(enums.py): new file for storing enums, starting with InfractionType
2024-04-14 05:57:53 +00:00
kzndotsh
a9632dd1c6 refactor(schema.prisma): replace unique constraint with composite primary key in UserRoles model for better data integrity
feat(db.py): add seed_user_roles command to seed user roles from discord guild
style(db.py): replace hardcoded message with constant GUILD_ONLY_MESSAGE for better maintainability
refactor(tldr.py): change create_default_embed to create_info_embed for better semantics
feat(__init__.py): add UserRolesController to DatabaseController for handling user roles operations
feat(user_roles.py): add UserRolesController for CRUD operations on user roles in the database
2024-04-12 21:45:03 +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
0495b70a88 refactor(schema.prisma): remove commented out SQLite datasource to clean up code
refactor(constants.py): rename CHANNELS to LOG_CHANNELS for better clarity
feat(constants.py): add LOG to EMBED_STATE_COLORS and EMBED_STATE_ICONS for log embeds
feat(constants.py): add EMBED_SPECIAL_CHARS for special character usage in embeds
feat(embeds.py): add set_image method to EmbedCreator for image support in embeds
feat(embeds.py): add create_log_embed method to EmbedCreator for creating log embeds
feat(functions.py): add compare_changes, extract_guild_attrs, extract_member_attrs functions for better data handling
2024-04-09 07:25:57 +00:00
kzndotsh
22cd22c795 refactor(schema.prisma): rename 'author' and 'author_id' to 'user' and 'user_id' in Reminders model for better clarity and consistency with other models
feat(database/controllers.py): add CRUD operations for users in UsersController
feat(database/controllers.py): add CRUD operations for infractions in InfractionsController
feat(database/controllers.py): add CRUD operations for notes in NotesController
feat(database/controllers.py): add CRUD operations for snippets in SnippetsController
docs(database/controllers.py): add docstrings to all methods in UsersController, InfractionsController, NotesController, and SnippetsController
refactor(database/controllers.py): add type hints to all methods in UsersController, InfractionsController, NotesController, and SnippetsController
feat(database/controllers.py): import Reminders model from prisma.models
feat(database/controllers.py): import datetime module for handling date and time data

docs(database/controllers.py): add docstrings to SnippetsController and RemindersController methods for better code understanding
feat(database/controllers.py): add RemindersController class to handle database operations related to reminders
refactor(database/controllers.py): add RemindersController to DatabaseController for centralized database operations management

style(embeds.py): add line breaks for better code readability and maintainability
2024-04-07 01:53:58 +00:00
kzndotsh
e5af901ff3 docs(README.md): update command instruction to include server id for clarity
refactor(schema.prisma): add autoincrement() to id fields in Infractions, Notes, Reminders models for automatic id generation
feat(controllers.py): add toggle_afk method in UsersController to enable/disable afk status
refactor(controllers.py): remove infraction_id from create_infraction method in InfractionsController as id is autoincremented
feat(controllers.py): add create_note, delete_note, update_note methods in NotesController for note management
2024-04-06 13:41:11 +00:00
kzndotsh
2ffe01954e chore: remove opencommit.yml workflow as it's no longer needed
refactor(schema.prisma): change InfractionType from enum to string for flexibility
refactor(schema.prisma): make created_at fields nullable and default to now() for better data consistency
refactor(database/controllers.py): rename find_users and find_user to get_all_users and get_user_by_id for better readability
feat(database/controllers.py): add InfractionsController and SnippetsController to handle infractions and snippets related operations
refactor(database/controllers.py): move InfractionType enum to controllers.py for better organization
2024-04-05 23:29:51 +00:00
kzndotsh
89d8fd788e [DB] Add example controller 2024-04-05 18:46:28 -04:00
kzndotsh
030d0647b9 fix(schema.prisma): refactor schema to improve readability and remove unused models
feat(schema.prisma): add new models for Settings, Notes, and Reminders to support new features
fix(main.py): move database connection after starting coroutines to ensure they are started before connecting to the database
feat(main.py): add log message for closing database connection to improve debugging
2024-04-05 21:22:12 +00:00
kzndotsh
8a4fd58f20 feat(schema.prisma): switch database provider from sqlite to postgresql for better scalability and performance
chore(schema.prisma): comment out old postgresql datasource configuration for future reference

refactor(schema.prisma): update database schema to better represent Discord data

- Replace 'roles' model with 'Users' and 'Roles' models to separate user and role data
- Add 'UserRoles' model to represent many-to-many relationship between users and roles
- Replace 'notes' model with 'Infractions' and 'Snippets' models to separate infraction and snippet data
- Remove 'moderators', 'settings', 'logs', 'guilds', and 'messages' models as they are not needed in the new schema
- Add 'InfractionType' enum to represent different types of infractions
- Update comments to better explain the purpose of each model and field

These changes were made to better align the database schema with the data provided by Discord and to simplify the data model.

feat: add new models for logs, user_roles, notes, snippets, guilds, infractions to extend database schema

WHY: To support new features such as logging, user roles, moderator notes, text snippets, guilds, and user infractions.
2024-04-05 18:41:20 +00:00
kzndotsh
6a2dbd7003 [Refactor] More major changes, replaced supabase client with prisma, added error handler concept 2024-03-28 01:20:05 -04: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