mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-01-07 15:11:57 +01:00
parent
a0a1847634
commit
3806dcf9fb
@ -110,6 +110,7 @@ router.post('/google', jsonParser, async (request, response) => {
|
||||
});
|
||||
|
||||
router.post('/yandex', jsonParser, async (request, response) => {
|
||||
try {
|
||||
const chunks = request.body.chunks;
|
||||
const lang = request.body.lang;
|
||||
|
||||
@ -130,7 +131,6 @@ router.post('/yandex', jsonParser, async (request, response) => {
|
||||
|
||||
console.log('Input text: ' + inputText);
|
||||
|
||||
try {
|
||||
const result = await fetch(`https://translate.yandex.net/api/v1/tr.json/translate?ucid=${ucid}&srv=android&format=text`, {
|
||||
method: 'POST',
|
||||
body: params,
|
||||
|
@ -299,8 +299,8 @@ const color = {
|
||||
* @returns {string} A UUIDv4 string
|
||||
*/
|
||||
function uuidv4() {
|
||||
if ('randomUUID' in crypto) {
|
||||
return crypto.randomUUID();
|
||||
if ('crypto' in global && 'randomUUID' in global.crypto) {
|
||||
return global.crypto.randomUUID();
|
||||
}
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
||||
const r = Math.random() * 16 | 0;
|
||||
|
Loading…
Reference in New Issue
Block a user