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

228 lines
6.9 KiB
Python
Raw Normal View History

2024-05-06 11:52:55 +00:00
import discord
from discord.ext import commands
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
from prisma.models import Note
from tux.utils.constants import Constants as CONST
2024-05-06 11:52:55 +00:00
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
from . import ModerationCogBase
2024-05-06 11:52:55 +00:00
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
class Notes(ModerationCogBase):
def __init__(self, bot: commands.Bot) -> None:
super().__init__(bot)
2024-05-06 11:52:55 +00:00
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
@commands.hybrid_group(
name="notes",
aliases=["n"],
usage="notes <subcommand>",
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
)
@commands.guild_only()
async def notes(self, ctx: commands.Context[commands.Bot]) -> None:
2024-05-06 11:52:55 +00:00
"""
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
Notes related commands.
2024-05-06 11:52:55 +00:00
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
Parameters
----------
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
ctx : commands.Context[commands.Bot]
The context object for the command.
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
"""
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
if ctx.invoked_subcommand is None:
await ctx.send_help("notes")
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
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
@notes.command(
name="create",
aliases=["c", "add", "a"],
usage="notes create [target] [content]",
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
)
@commands.guild_only()
async def create_note(self, ctx: commands.Context[commands.Bot], target: discord.Member, content: str) -> None:
2024-05-07 02:02:00 +00:00
"""
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
Create a note for a user.
2024-05-07 02:02:00 +00:00
Parameters
----------
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
ctx : commands.Context[commands.Bot]
The context in which the command is being invoked.
target : discord.Member
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
The member to add a note to.
content : str
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
The content of the note
2024-05-07 02:02:00 +00:00
"""
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
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
if ctx.guild:
try:
note = await self.db.note.insert_note(
note_target_id=target.id,
note_moderator_id=ctx.author.id,
note_content=content,
guild_id=ctx.guild.id,
)
except Exception as e:
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
await ctx.send(f"An error occurred while creating the note: {e}", delete_after=30, ephemeral=True)
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
return
await self.handle_note_response(ctx, note, "created", content, target)
@notes.command(
name="delete",
aliases=["d"],
usage="notes delete [note_id]",
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
)
@commands.guild_only()
async def delete_note(self, ctx: commands.Context[commands.Bot], note_id: int) -> None:
2024-05-07 02:02:00 +00:00
"""
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
Delete a note by ID.
2024-05-07 02:02:00 +00:00
Parameters
----------
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
ctx : commands.Context[commands.Bot]
The context in which the command is being invoked.
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
note_id : int
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
The ID of the note to delete
Raises
------
commands.MemberNotFound
If the member is not found.
commands.UserNotFound
If the user is not found.
2024-05-07 02:02:00 +00:00
"""
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
if ctx.guild:
note = await self.db.note.get_note_by_id(note_id)
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
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
if not note:
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
await ctx.send("Note not found.", delete_after=30, ephemeral=True)
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
return
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
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
await self.db.note.delete_note_by_id(note_id)
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
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
try:
target = await commands.MemberConverter().convert(ctx, str(note.note_target_id))
except commands.MemberNotFound:
target = await commands.UserConverter().convert(ctx, str(note.note_target_id))
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
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
await self.handle_note_response(ctx, note, "deleted", note.note_content, target)
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
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
@notes.command(
name="update",
aliases=["u", "edit", "e", "modify", "m"],
usage="notes update [note_id] [content]",
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
)
@commands.guild_only()
async def update_note(self, ctx: commands.Context[commands.Bot], note_id: int, content: str) -> None:
2024-05-07 02:02:00 +00:00
"""
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
Update a note by ID.
2024-05-07 02:02:00 +00:00
Parameters
----------
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
ctx : commands.Context[commands.Bot]
The context in which the command is being invoked.
2024-05-07 02:02:00 +00:00
note_id : int
The ID of the note to update.
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
content : str
2024-05-07 02:02:00 +00:00
The new content for the note.
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
Raises
------
commands.MemberNotFound
If the member is not found.
commands.UserNotFound
If the user is not found
2024-05-07 02:02:00 +00:00
"""
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
if ctx.guild:
note = await self.db.note.get_note_by_id(note_id)
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
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
if not note:
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
await ctx.send("Note not found.", delete_after=30, ephemeral=True)
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
return
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
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
previous_content = note.note_content
await self.db.note.update_note_by_id(note_id, content)
2024-05-06 11:52:55 +00:00
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
try:
target = await commands.MemberConverter().convert(ctx, str(note.note_target_id))
except commands.MemberNotFound:
target = await commands.UserConverter().convert(ctx, str(note.note_target_id))
2024-05-06 11:52:55 +00:00
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
await self.handle_note_response(ctx, note, "updated", content, target, previous_content)
@notes.command(
name="view",
aliases=["v", "get", "g"],
usage="notes view [note_id]",
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
)
@commands.guild_only()
async def view_note(
2024-05-06 11:52:55 +00:00
self,
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
ctx: commands.Context[commands.Bot],
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
note_id: int,
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
) -> None:
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
"""
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
View a note by ID.
2024-05-06 11:52:55 +00:00
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
Parameters
----------
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
ctx : commands.Context[commands.Bot]
The context in which the command is being invoked.
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
note_id : int
The ID of the note to view.
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
Raises
------
commands.MemberNotFound
If the member is not found.
commands.UserNotFound
If the user is not found.
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
"""
2024-05-06 11:52:55 +00:00
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
if ctx.guild:
note = await self.db.note.get_note_by_id(note_id)
2024-05-06 23:41:31 +00:00
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
if not note:
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
await ctx.send("Note not found.", delete_after=30, ephemeral=True)
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
return
2024-05-07 02:02:00 +00:00
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
try:
target = await commands.MemberConverter().convert(ctx, str(note.note_target_id))
except commands.MemberNotFound:
target = await commands.UserConverter().convert(ctx, str(note.note_target_id))
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
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
await self.handle_note_response(ctx, note, "viewed", note.note_content, target)
2024-05-07 02:02:00 +00:00
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
async def handle_note_response(
2024-05-07 02:02:00 +00:00
self,
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
ctx: commands.Context[commands.Bot],
note: Note,
action: str,
content: str,
target: discord.Member | discord.User,
previous_content: str | None = None,
2024-05-07 02:02:00 +00:00
) -> None:
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
moderator = ctx.author
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
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
fields = [
("Moderator", f"__{moderator}__\n`{moderator.id}`", True),
("Target", f"__{target}__\n`{target.id}`", True),
("Content", f"> {content}", False),
]
if previous_content:
fields.append(("Previous Content", f"> {previous_content}", False))
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
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
embed = await self.create_embed(
ctx,
title=f"Note #{note.note_id} {action}",
fields=fields,
color=CONST.EMBED_COLORS["NOTE"],
icon_url=CONST.EMBED_ICONS["NOTE"],
)
chore(.pre-commit-config.yaml): update ruff-pre-commit version from v0.4.2 to v0.4.8 to get the latest features and bug fixes refactor(notes.py): refactor notes.py to improve code maintainability and readability feat(notes.py): add new functionalities to manage notes, including create, delete, update, view, and list notes fix(notes.py): fix the issue of not being able to handle users and moderators not found in the database style(notes.py): improve code documentation for better understanding of the functionalities refactor: update note management commands to improve usability and error handling - refactor(note): update note creation, deletion, and update commands to include more detailed error handling and user feedback - feat(note): add command to view a note by ID for easier note management - feat(note): add command to list all notes for a member or by a moderator for better note overview - style: improve code readability and maintainability by restructuring and adding detailed docstrings - fix: correct the setup function to correctly add the NotesCog to the bot feat(notes.py): add methods to retrieve notes by user and moderator IDs for better data retrieval feat(constants.py): add NOTE color and icon for better visual distinction of note-related messages refactor(constants.py): rename EMBED_SPECIAL_CHARS to UNICODE for better semantics feat(constants.py): add EMOJIS dictionary for more flexible emoji usage feat(embeds.py): add method to set author in embed for more detailed embeds feat(embeds.py): add method to create note-specific embed for better note representation
2024-06-14 16:41:06 +00:00
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
await self.send_embed(ctx, embed, log_type="private")
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
await ctx.send(embed=embed, delete_after=30, ephemeral=True)
2024-05-06 23:41:31 +00:00
2024-05-06 11:52:55 +00:00
async def setup(bot: commands.Bot) -> None:
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
await bot.add_cog(Notes(bot))