diff --git a/src/handlers/Handler.ts b/src/handlers/Handler.ts index 5f4c0ca..1f9b85c 100644 --- a/src/handlers/Handler.ts +++ b/src/handlers/Handler.ts @@ -16,9 +16,10 @@ import { IReply } from '../definition/reply/IReply'; import { sendDefaultNotification, sendHelperNotification, + sendNotification, } from '../helper/notification'; import { UserPreferenceModal } from '../modal/UserPreferenceModal'; -import { Language } from '../lib/Translation/translation'; +import { Language, t } from '../lib/Translation/translation'; import { ReplyAIModal } from '../modal/AIreplyModal'; import { AIstorage } from '../storage/AIStorage'; import { UserPreferenceStorage } from '../storage/userPreferenceStorage'; @@ -205,5 +206,19 @@ export class Handler implements IHandler { } return; } + else if(lastMessage?.attachments && !lastMessage?.attachments?.[0]?.description){ + const content = { + message: t('Error_Missing_Attachment_Description', this.language) + } + await sendNotification(this.read, this.modify, this.sender, this.room, content); + return + } + else{ + const content = { + message: t('Error_Missing_Message', this.language) + } + await sendNotification(this.read, this.modify, this.sender, this.room, content); + return + } } } diff --git a/src/lib/Translation/locales/de.ts b/src/lib/Translation/locales/de.ts index 712615e..fe5c4d9 100644 --- a/src/lib/Translation/locales/de.ts +++ b/src/lib/Translation/locales/de.ts @@ -86,6 +86,7 @@ export const de = { AI_Gemini_Model_Not_Configured: "Ihr Gemini-Modell ist nicht richtig eingerichtet. Bitte überprüfen Sie Ihre Konfiguration", AI_Workspace_Model_Not_Configured: "Ihre Workspace-AI ist nicht richtig eingerichtet. Bitte kontaktieren Sie Ihren Administrator", AI_Something_Went_Wrong: "Etwas ist schiefgelaufen. Bitte versuchen Sie es später noch einmal.", - Refresh_Button_Text: "Aktualisieren" - + Refresh_Button_Text: "Aktualisieren", + Error_Missing_Attachment_Description: "Schnelle Antwort können nicht verwendet werden, da der Anhang keine Beschreibung enthält. Der Anhang muss eine Beschreibung haben, um fortzufahren.", + Error_Missing_Message: "Schnelle Antwort können nicht verwendet werden, da keine Nachricht zum Antworten vorhanden ist. Bitte versuchen Sie es mit einer gültigen Nachricht erneut." } diff --git a/src/lib/Translation/locales/en.ts b/src/lib/Translation/locales/en.ts index 5e140db..6023ece 100644 --- a/src/lib/Translation/locales/en.ts +++ b/src/lib/Translation/locales/en.ts @@ -86,4 +86,7 @@ export const en = { AI_Gemini_Model_Not_Configured: "Your Gemini Model is not set up properly. Please check your configuration", AI_Workspace_Model_Not_Configured: "Your Workspace AI is not set up properly. Please contact your administrator", AI_Something_Went_Wrong: "Something went wrong. Please try again later.", - Refresh_Button_Text: "Refresh"}; + Refresh_Button_Text: "Refresh", + Error_Missing_Attachment_Description: "Quick replies can't be used because the attachment has no description. The attachment must have a description to proceed.", + Error_Missing_Message: "Quick replies can't be used because there is no message to reply to. Please try again with a valid message." +}; diff --git a/src/lib/Translation/locales/pl.ts b/src/lib/Translation/locales/pl.ts index 3937e82..94770ce 100644 --- a/src/lib/Translation/locales/pl.ts +++ b/src/lib/Translation/locales/pl.ts @@ -86,7 +86,8 @@ export const pl = { AI_Gemini_Model_Not_Configured: "Twój model Gemini nie jest poprawnie skonfigurowany. Proszę sprawdzić swoją konfigurację", AI_Workspace_Model_Not_Configured: "Twoja AI w Workspace nie jest poprawnie skonfigurowana. Proszę skontaktować się z administratorem", AI_Something_Went_Wrong: "Coś poszło nie tak. Proszę spróbować ponownie później.", - Refresh_Button_Text: "Odśwież" - + Refresh_Button_Text: "Odśwież", + Error_Missing_Attachment_Description: "Nie można użyć szybkich odpowiedzi, ponieważ załącznik nie ma opisu. Załącznik musi zawierać opis, aby kontynuować.", + Error_Missing_Message: "Nie można użyć szybka odpowiedź, ponieważ nie ma wiadomości, na którą można odpowiedzieć. Spróbuj ponownie z prawidłową wiadomością." } diff --git a/src/lib/Translation/locales/pt.ts b/src/lib/Translation/locales/pt.ts index 146e6b7..0fc6a1c 100644 --- a/src/lib/Translation/locales/pt.ts +++ b/src/lib/Translation/locales/pt.ts @@ -86,7 +86,8 @@ export const pt = { AI_Gemini_Model_Not_Configured: "Seu Modelo Gemini não está configurado corretamente. Por favor, verifique sua configuração", AI_Workspace_Model_Not_Configured: "Sua IA do Workspace não está configurada corretamente. Por favor, entre em contato com o administrador", AI_Something_Went_Wrong: "Algo deu errado. Por favor, tente novamente mais tarde.", - Refresh_Button_Text: "Atualizar" - + Refresh_Button_Text: "Atualizar", + Error_Missing_Attachment_Description: "Resposta rápida não podem ser usadas porque o anexo não tem descrição. O anexo deve ter uma descrição para prosseguir.", + Error_Missing_Message: "Resposta rápida não podem ser usadas porque não há mensagem para responder. Por favor, tente novamente com uma mensagem válida." } diff --git a/src/lib/Translation/locales/ru.ts b/src/lib/Translation/locales/ru.ts index 09af97c..a136691 100644 --- a/src/lib/Translation/locales/ru.ts +++ b/src/lib/Translation/locales/ru.ts @@ -86,6 +86,7 @@ export const ru = { AI_Gemini_Model_Not_Configured: "Ваша модель Gemini не настроена должным образом. Пожалуйста, проверьте свою конфигурацию", AI_Workspace_Model_Not_Configured: "Ваша AI в Workspace не настроена должным образом. Пожалуйста, свяжитесь с администратором", AI_Something_Went_Wrong: "Что-то пошло не так. Пожалуйста, попробуйте позже.", - Refresh_Button_Text: "Обновить" - + Refresh_Button_Text: "Обновить", + Error_Missing_Attachment_Description: "Нельзя использовать быстрые ответы, так как вложение не содержит описания. Вложение должно иметь описание, чтобы продолжить.", + Error_Missing_Message: "Нельзя использовать быстрые ответы, так как нет сообщения, на которое можно ответить. Пожалуйста, попробуйте снова с допустимым сообщением." }