feat(schema.prisma): add Starboard and StarboardMessage models for starboard feature
fix(schema.prisma): remove unnecessary comments and adjust model attributes for better data handling
feat(cases.py): change case_number to be dynamic instead of fixed format
feat(case.py): add functions to handle case count incrementation for better case tracking
- 'case_target_id' and 'note_target_id' renamed to 'case_user_id' and 'note_user_id' respectively
- 'case_target_roles' renamed to 'case_user_roles'
- All related function names and parameters updated to reflect these changes
feat(bot.py): enhance logging for Prisma client setup and connection status for better debugging
style(bot.py): improve logging messages for better readability
feat(main.py): integrate Sentry setup into main function for better error tracking
refactor(constants.py): simplify database URL environment variables and add verbose loading for dotenv
chore(sentry.py): remove redundant Sentry setup file as setup is now integrated into main function
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
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
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
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
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
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.
docs(PERMISSIONS.md): add new documentation file explaining the permissions management system
refactor(schema.prisma): simplify GuildConfig model by removing unnecessary fields and adding permission level roles fields for better permissions management
feat(config.py): add ConfigSelectMenu and ConfigSelectView classes for guild role configuration
refactor(config.py): replace individual role setting commands with a single command using the new classes
chore(config.py): comment out old role setting commands for reference, to be removed in future commits
refactor: consolidate channel setting commands into a single command for better maintainability
feat: add a new command to set all roles and channels using a select menu for improved user experience
feat: add role configuration options for different permission levels
This commit introduces the ability to configure roles for different permission levels (0-9) in the application. This allows for more granular control over user permissions and enhances the flexibility of the role management system.
refactor(client.py): conditionally set log_queries based on DEBUG constant for better control over logging in different environments
refactor(guild_config.py): simplify method and variable names for readability and maintainability
style(guild_config.py): improve code formatting for better readability
refactor(guild_config.py): simplify variable names by removing redundant 'guild_' prefix
chore(guild_config.py): comment out unused methods to improve code readability and performance
refactor(guild_config.py): simplify field names for better readability and consistency
feat(guild_config.py): comment out unused role retrieval methods to improve performance
chore(guild_config.py): add commented out code for future permission level roles feature
fix(main.py): uncomment debug related imports and function calls to enable debugging
feat(constants.py): change default value of DEBUG constant to True to enable debugging by default
feat(schema.prisma): add case_status field to Case model to track case status
fix(schema.prisma): change case_number and note_number types from Int to BigInt to handle larger numbers
docs(case.py): add docstrings to methods in CaseController class to improve code readability and provide detailed information about the methods' functionality and parameters
refactor(case.py): remove get_all_cases and get_case_by_id methods from CaseController class as they were not being used, reducing unnecessary code
feat(case.py): import logger from loguru for better logging capabilities
feat(case.py): import CaseWhereInput from prisma.types to handle case queries more efficiently
refactor(case.py): simplify case retrieval methods in CaseController
- Replace multiple specific case retrieval methods with more general methods that accept options for filtering.
- This reduces code duplication and improves maintainability.
- Add docstrings to new methods to improve code readability and provide usage information.
refactor: simplify and optimize case retrieval methods in the database layer
feat: add update_case method to allow case reason and status modification
feat: add delete_case_by_number method to allow case deletion by its number
refactor(schema.prisma): switch from PROD to DEV database URLs for development testing
feat(schema.prisma): add JAIL and UNJAIL to CaseType enum to support new jail feature
feat(schema.prisma): add case_target_roles field to Case model to store jailed user's roles
refactor(schema.prisma): add comments to case_number and case_expires_at fields for clarity
refactor(schema.prisma): add comment to reminder_channel_id field for clarity
feat(jail.py): add new Jail cog for jailing users in the server
feat(unjail.py): add new Unjail class to handle unjailing of users
feat(case.py): add method to get last jail case by target id and guild id for unjailing process
feat(flags.py): add JailFlags and UnjailFlags classes to handle command flags for jailing and unjailing commands
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
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
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.
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
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
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
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
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
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
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
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
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.