3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-06-16 11:05:03 +00:00

fix: role buttons being re-sent

This commit is contained in:
Dragory 2025-05-31 22:21:31 +00:00
parent 27474375c3
commit 0aae70561c
No known key found for this signature in database

View file

@ -8,7 +8,8 @@ export async function applyAllRoleButtons(pluginData: GuildPluginData<RoleButton
const config = pluginData.config.get();
for (const [configName, configItem] of Object.entries(config.buttons)) {
// Use the hash of the config to quickly check if we need to update buttons
const hash = createHash("md5").update(JSON.stringify(configItem)).digest("hex");
const configItemToHash = { ...configItem, name: configName }; // Add name property for backwards compatibility
const hash = createHash("md5").update(JSON.stringify(configItemToHash)).digest("hex");
const savedButtonsItem = savedRoleButtons.find((bt) => bt.name === configName);
if (savedButtonsItem?.hash === hash) {
// No changes