Update CustomStatusPresets.plugin.js

This commit is contained in:
Mirco Wittrien 2022-08-08 14:14:00 +02:00
parent 3e4bb2dac2
commit 1b489dd057
1 changed files with 8 additions and 10 deletions

View File

@ -2,7 +2,7 @@
* @name CustomStatusPresets * @name CustomStatusPresets
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 1.1.2 * @version 1.1.3
* @description Allows you to save Custom Statuses as Quick Select * @description Allows you to save Custom Statuses as Quick Select
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -17,7 +17,7 @@ module.exports = (_ => {
"info": { "info": {
"name": "CustomStatusPresets", "name": "CustomStatusPresets",
"author": "DevilBro", "author": "DevilBro",
"version": "1.1.2", "version": "1.1.3",
"description": "Allows you to save Custom Statuses as Quick Select" "description": "Allows you to save Custom Statuses as Quick Select"
} }
}; };
@ -394,14 +394,12 @@ module.exports = (_ => {
let date = new Date; let date = new Date;
expiresAt = new Date(date.getFullYear(), date.getMonth(), date.getDate() + 1).getTime() - date.getTime(); expiresAt = new Date(date.getFullYear(), date.getMonth(), date.getDate() + 1).getTime() - date.getTime();
} }
BDFDB.LibraryModules.SettingsUtilsOld.updateRemoteSettings({ if (presets[id].status) BDFDB.LibraryModules.SettingsUtils.StatusSetting.updateSetting(presets[id].status);
status: presets[id].status, BDFDB.LibraryModules.SettingsUtils.CustomStatusSetting.updateSetting({
customStatus: { text: presets[id].text && presets[id].text.length > 0 ? presets[id].text : "",
text: presets[id].text && presets[id].text.length > 0 ? presets[id].text : null, expiresAtMs: expiresAt ? BDFDB.DiscordObjects.Timestamp().add(expiresAt, "ms").toDate().getTime().toString() : "0",
expiresAt: expiresAt ? BDFDB.DiscordObjects.Timestamp().add(expiresAt, "ms").toISOString() : null, emojiId: presets[id].emojiInfo ? presets[id].emojiInfo.id : "0",
emojiId: presets[id].emojiInfo ? presets[id].emojiInfo.id : null, emojiName: presets[id].emojiInfo ? presets[id].emojiInfo.name : ""
emojiName: presets[id].emojiInfo ? presets[id].emojiInfo.name : null
}
}); });
} }
})) }))