From 3cd76ce611f47361d8ac26811f79ea1189cb69ea Mon Sep 17 00:00:00 2001 From: Borys Date: Wed, 6 Mar 2024 15:36:29 +0200 Subject: [PATCH] fix translate bot --- bots/translateBot/.env.example | 42 +++++++++++++++------------------- bots/translateBot/api.js | 4 ++-- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/bots/translateBot/.env.example b/bots/translateBot/.env.example index 4d3b47c57..4a150e6a3 100644 --- a/bots/translateBot/.env.example +++ b/bots/translateBot/.env.example @@ -1,26 +1,22 @@ -TYPE= +TYPE=DEV #--- < Main data * > --- -BOT_ADDRESS= -CONFERENCE_ADDRESS= -APP_USERNAME= -APP_PASSWORD= -DEFAULT_ROOM= -API_URL= -USER_LIMIT_PER_ROOM= +BOT_ADDRESS=dev.dxmpp.com +CONFERENCE_ADDRESS=@conference.dev.dxmpp.com +APP_USERNAME=temp_temp@mailinator.com +APP_PASSWORD=temp_temp@mailinator.com + +DEFAULT_ROOM=3f61d58b25c5c83458a967c7a4a2d198f1c55d4d3fe5ed8ace931f2d8b3e7145@conference.dev.dxmpp.com +API_URL=https://api.ethoradev.com/v1/ +USER_LIMIT_PER_ROOM=3 #--- < Bot information > --- -FIRST_NAME= -LAST_NAME= -PHOTO_URL= -TOKEN_NAME='' -PRESENCE_WAIT= -#--- < Database > --- -MONGO_USERNAME= -MONGO_PASSWORD= -MONGO_HOSTNAME= -MONGO_PORT= -MONGO_DB= -#--- < Settings * > --- -PRESENCE= -INVITATION= +FIRST_NAME=Translate +LAST_NAME=Bot +PHOTO_URL=https://cdn-icons-png.flaticon.com/512/3898/3898082.png +TOKEN_NAME='Example token' +PRESENCE_WAIT=5 + +PRESENCE=false +INVITATION=true #--- < Application token * > --- -TOKEN='' +TOKEN='JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7ImRpc3BsYXlOYW1lIjoiQVRPTSIsImRvbWFpbk5hbWUiOiI2NWU4MGY4YmE1NGVmZWU1MWJiMjg3YWIiLCJjcmVhdG9ySWQiOiI2NWU3MmZlNGE1NGVmZWU1MWJiMjdhODYiLCJidW5kbGVJZCI6ImNvbS5ldGhvcmEiLCJwcmltYXJ5Q29sb3IiOiIjMDAzRTlDIiwic2Vjb25kYXJ5Q29sb3IiOiIjMjc3NUVBIiwiY29pblN5bWJvbCI6IkVUTyIsImNvaW5OYW1lIjoiRXRob3JhIENvaW4iLCJkZWZhdWx0QWNjZXNzUHJvZmlsZU9wZW4iOnRydWUsImRlZmF1bHRBY2Nlc3NBc3NldHNPcGVuIjp0cnVlLCJ1c2Vyc0NhbkZyZWUiOnRydWUsImlzVXNlckRhdGFFbmNyeXB0ZWQiOmZhbHNlLCJwYXJlbnRBcHBJZCI6IjY0NmNjOGRjOTZkNGE0ZGM4ZjdiMmYyZCIsImlzQWxsb3dlZE5ld0FwcENyZWF0ZSI6dHJ1ZSwiaXNCYXNlQXBwIjpmYWxzZSwiX2lkIjoiNjVlODBmOGJhNTRlZmVlNTFiYjI4N2FkIiwiZGVmYXVsdFJvb21zIjpbXSwiY3JlYXRlZEF0IjoiMjAyNC0wMy0wNlQwNjozOTowNy42ODlaIiwidXBkYXRlZEF0IjoiMjAyNC0wMy0wNlQwNjozOTowNy42ODlaIiwiX192IjowfSwiaWF0IjoxNzA5NzA3MTYzfQ.gDnE_PQMGxExzz1EVDcFNzqY-n8bAC1ZgVey86PwZS0' +GOOGLE_TOKEN='' diff --git a/bots/translateBot/api.js b/bots/translateBot/api.js index 29d0ced17..f945e339b 100644 --- a/bots/translateBot/api.js +++ b/bots/translateBot/api.js @@ -9,8 +9,8 @@ const http = axios.create({ export const botLogin = async (username, password) => { try { - const request = await http.post('users/login', { - username: username, + const request = await http.post('users/login-with-email', { + email: username, password: password }, { headers: {