Skip to content

Commit 0aae705

Browse files
committed
fix: role buttons being re-sent
1 parent 2747437 commit 0aae705

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

backend/src/plugins/RoleButtons/functions/applyAllRoleButtons.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ export async function applyAllRoleButtons(pluginData: GuildPluginData<RoleButton
88
const config = pluginData.config.get();
99
for (const [configName, configItem] of Object.entries(config.buttons)) {
1010
// Use the hash of the config to quickly check if we need to update buttons
11-
const hash = createHash("md5").update(JSON.stringify(configItem)).digest("hex");
11+
const configItemToHash = { ...configItem, name: configName }; // Add name property for backwards compatibility
12+
const hash = createHash("md5").update(JSON.stringify(configItemToHash)).digest("hex");
1213
const savedButtonsItem = savedRoleButtons.find((bt) => bt.name === configName);
1314
if (savedButtonsItem?.hash === hash) {
1415
// No changes

0 commit comments

Comments
 (0)