Translate impersonate and streaming responses. 4-state auto-mode for translation

This commit is contained in:
SillyLossy
2023-05-28 16:18:30 +03:00
parent 5a678b74c3
commit 8c48843d72
4 changed files with 97 additions and 49 deletions

View File

@ -48,7 +48,7 @@ EventEmitter.prototype.removeListener = function (event, listener) {
}
};
EventEmitter.prototype.emit = function (event) {
EventEmitter.prototype.emit = async function (event) {
var i, listeners, length, args = [].slice.call(arguments, 1);
if (typeof this.events[event] === 'object') {
@ -56,7 +56,7 @@ EventEmitter.prototype.emit = function (event) {
length = listeners.length;
for (i = 0; i < length; i++) {
listeners[i].apply(this, args);
await listeners[i].apply(this, args);
}
}
};
@ -68,4 +68,4 @@ EventEmitter.prototype.once = function (event, listener) {
});
};
export { EventEmitter }
export { EventEmitter }