wineater-bot 3.6.0 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wineater-bot",
3
- "version": "3.6.0",
3
+ "version": "3.7.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "src/index.js",
package/src/js/i18n.js CHANGED
@@ -543,6 +543,7 @@ class Translator {
543
543
  const config = await this.api.getStoreConfig(storeName);
544
544
  this.storeLanguage = config.lang;
545
545
  this.supportedLanguages = config.available_languages;
546
+ this.OpenAIApiKey = config.open_ai_key;
546
547
  // ✅ Если язык уже сохранён в localStorage — использовать его
547
548
  const storedLang = localStorage.getItem('selectedLanguage');
548
549
  if (storedLang && this.translations[storedLang]) {
@@ -602,7 +603,7 @@ class Translator {
602
603
  return textObject;
603
604
  }
604
605
 
605
- const apiKey = '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'; // ✅ Заменить на твой реальный ключ
606
+ const apiKey = this.OpenAIApiKey; // ✅ Заменить на твой реальный ключ
606
607
  const url = 'https://api.openai.com/v1/chat/completions';
607
608
 
608
609
  const headers = {