#1412 Add randomized user ids to OpenAI

This commit is contained in:
Cohee
2023-11-29 00:11:10 +02:00
parent 9145406522
commit e541c2b186
3 changed files with 18 additions and 2 deletions

View File

@ -259,6 +259,14 @@ const color = {
white: (mess) => color.byNum(mess, 37)
};
function uuidv4() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
const r = Math.random() * 16 | 0;
const v = c === 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
module.exports = {
getConfig,
getConfigValue,
@ -270,4 +278,5 @@ module.exports = {
delay,
deepMerge,
color,
uuidv4,
};