This commit is contained in:
2025-06-15 01:54:51 +09:00
parent 0ce72da2ba
commit a91c845683

View File

@@ -37,6 +37,8 @@ class LibreTranslateAPI {
return result; return result;
} }
this.logger.info(`${detection.confidence} ${detection.confidence}`)
if (detection.confidence > MIN_CONFIDENCE_SCORE) { if (detection.confidence > MIN_CONFIDENCE_SCORE) {
for (const targetLang of targetLanguages) { for (const targetLang of targetLanguages) {
if (!((detection.language === 'zh-Hans' || detection.language === 'zh-Hant') && (targetLang === 'zh-Hans' || targetLang === 'zh-Hant')) && detection.language !== targetLang && this.allowedLanguages.includes(detection.language) && this.allowedLanguages.includes(targetLang)) { if (!((detection.language === 'zh-Hans' || detection.language === 'zh-Hant') && (targetLang === 'zh-Hans' || targetLang === 'zh-Hant')) && detection.language !== targetLang && this.allowedLanguages.includes(detection.language) && this.allowedLanguages.includes(targetLang)) {
@@ -142,8 +144,8 @@ class ControllerPlugin extends BaseControllerPlugin {
await this.sendMessage(request, `**\`${nrc_username}\`**: ${nrc_message}`) await this.sendMessage(request, `**\`${nrc_username}\`**: ${nrc_message}`)
if (this.controller.config.get('ClusterChatSync.use_libretranslate')) { if (this.controller.config.get('ClusterChatSync.use_libretranslate')) {
this.logger.info(`${this.translator_language}`)
const result = await this.translator.translate(nrc_message, this.translator_language); const result = await this.translator.translate(nrc_message, this.translator_language);
this.logger.info(result);
if (result && result.action) { if (result && result.action) {
await this.sendMessage(request, `**\`${nrc_username}\`**: ${result.passage}`) await this.sendMessage(request, `**\`${nrc_username}\`**: ${result.passage}`)