From 1225c029877579d454e6edcbd34326c1eb5ab966 Mon Sep 17 00:00:00 2001 From: Akinator31 Date: Tue, 25 Nov 2025 15:11:41 +0100 Subject: [PATCH] refactor(move): refactor move command format --- .../src/commands/move_thread/slash_command/move_thread.rs | 2 +- .../src/commands/move_thread/text_command/move_thread.rs | 2 +- rustmail/src/i18n/language/en.rs | 6 ++++-- rustmail/src/i18n/language/fr.rs | 6 ++++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/rustmail/src/commands/move_thread/slash_command/move_thread.rs b/rustmail/src/commands/move_thread/slash_command/move_thread.rs index 6e090447..e54679ef 100644 --- a/rustmail/src/commands/move_thread/slash_command/move_thread.rs +++ b/rustmail/src/commands/move_thread/slash_command/move_thread.rs @@ -131,7 +131,7 @@ impl RegistrableCommand for MoveCommand { let mut params = HashMap::new(); params.insert("category".to_string(), category_name.to_string()); - params.insert("staff".to_string(), command.user.name.clone()); + params.insert("staff".to_string(), command.user.id.to_string()); let response = MessageBuilder::system_message(&ctx, &config) .translated_content( diff --git a/rustmail/src/commands/move_thread/text_command/move_thread.rs b/rustmail/src/commands/move_thread/text_command/move_thread.rs index 3369960f..68333055 100644 --- a/rustmail/src/commands/move_thread/text_command/move_thread.rs +++ b/rustmail/src/commands/move_thread/text_command/move_thread.rs @@ -45,7 +45,7 @@ pub async fn move_thread( let mut params = HashMap::new(); params.insert("category".to_string(), category_name.to_string()); - params.insert("staff".to_string(), msg.author.name.clone()); + params.insert("staff".to_string(), msg.author.id.to_string()); let confirmation_msg = get_translated_message( config, diff --git a/rustmail/src/i18n/language/en.rs b/rustmail/src/i18n/language/en.rs index 749fd196..99061a19 100644 --- a/rustmail/src/i18n/language/en.rs +++ b/rustmail/src/i18n/language/en.rs @@ -474,7 +474,7 @@ pub fn load_english_messages(dict: &mut ErrorDictionary) { ); dict.messages.insert( "move_thread.success".to_string(), - DictionaryMessage::new("✅ Thread moved to category '{category}' by {staff}") + DictionaryMessage::new("✅ Thread moved to category **{category}** by <@{staff}>") .with_description("The thread has been successfully moved to the new category"), ); dict.messages.insert( @@ -604,7 +604,9 @@ pub fn load_english_messages(dict: &mut ErrorDictionary) { ); dict.messages.insert( "close.auto_canceled_on_message".to_string(), - DictionaryMessage::new("Scheduled closure has been automatically canceled because a message was received."), + DictionaryMessage::new( + "Scheduled closure has been automatically canceled because a message was received.", + ), ); dict.messages.insert( "close.replacing_existing_closure".to_string(), diff --git a/rustmail/src/i18n/language/fr.rs b/rustmail/src/i18n/language/fr.rs index fed8901d..9affdca1 100644 --- a/rustmail/src/i18n/language/fr.rs +++ b/rustmail/src/i18n/language/fr.rs @@ -502,7 +502,7 @@ pub fn load_french_messages(dict: &mut ErrorDictionary) { ); dict.messages.insert( "move_thread.success".to_string(), - DictionaryMessage::new("✅ Thread déplacé vers la catégorie '{category}' par {staff}") + DictionaryMessage::new("✅ Thread déplacé vers la catégorie **{category}** par <@{staff}>") .with_description("Le thread a été déplacé avec succès vers la nouvelle catégorie"), ); dict.messages.insert( @@ -632,7 +632,9 @@ pub fn load_french_messages(dict: &mut ErrorDictionary) { ); dict.messages.insert( "close.auto_canceled_on_message".to_string(), - DictionaryMessage::new("La fermeture programmée a été automatiquement annulée car un message a été reçu."), + DictionaryMessage::new( + "La fermeture programmée a été automatiquement annulée car un message a été reçu.", + ), ); dict.messages.insert( "close.replacing_existing_closure".to_string(),