From b38eeeab4275c7346d20da48702910dbdaf08c47 Mon Sep 17 00:00:00 2001 From: almeidx Date: Sat, 14 Aug 2021 14:54:18 +0100 Subject: [PATCH] update for discord.js --- .../src/plugins/SelfGrantableRoles/commands/RoleAddCmd.ts | 8 +++++--- .../plugins/SelfGrantableRoles/commands/RoleRemoveCmd.ts | 8 ++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/backend/src/plugins/SelfGrantableRoles/commands/RoleAddCmd.ts b/backend/src/plugins/SelfGrantableRoles/commands/RoleAddCmd.ts index 45345c78..8fa9cca4 100644 --- a/backend/src/plugins/SelfGrantableRoles/commands/RoleAddCmd.ts +++ b/backend/src/plugins/SelfGrantableRoles/commands/RoleAddCmd.ts @@ -43,7 +43,7 @@ export const RoleAddCmd = selfGrantableRolesCmd({ pluginData, msg.channel, `<@!${msg.author.id}> Unknown ${args.roleNames.length === 1 ? "role" : "roles"}`, - { users: true }, + { users: [msg.author.id] }, ); lock.unlock(); return; @@ -88,7 +88,7 @@ export const RoleAddCmd = selfGrantableRolesCmd({ pluginData, msg.channel, `<@!${msg.author.id}> Got an error while trying to grant you the roles`, - { users: true }, + { users: [msg.author.id] }, ); return; } @@ -120,7 +120,9 @@ export const RoleAddCmd = selfGrantableRolesCmd({ messageParts.push("couldn't recognize some of the roles"); } - sendSuccessMessage(pluginData, msg.channel, `<@!${msg.author.id}> ${messageParts.join("; ")}`, { users: true }); + sendSuccessMessage(pluginData, msg.channel, `<@!${msg.author.id}> ${messageParts.join("; ")}`, { + users: [msg.author.id], + }); lock.unlock(); }, diff --git a/backend/src/plugins/SelfGrantableRoles/commands/RoleRemoveCmd.ts b/backend/src/plugins/SelfGrantableRoles/commands/RoleRemoveCmd.ts index 1a896e1e..7a4bb83b 100644 --- a/backend/src/plugins/SelfGrantableRoles/commands/RoleRemoveCmd.ts +++ b/backend/src/plugins/SelfGrantableRoles/commands/RoleRemoveCmd.ts @@ -51,14 +51,14 @@ export const RoleRemoveCmd = selfGrantableRolesCmd({ msg.channel, `<@!${msg.author.id}> Removed ${removedRolesStr.join(", ")} ${removedRolesWord};` + ` couldn't recognize the other roles you mentioned`, - { users: true }, + { users: [msg.author.id] }, ); } else { sendSuccessMessage( pluginData, msg.channel, `<@!${msg.author.id}> Removed ${removedRolesStr.join(", ")} ${removedRolesWord}`, - { users: true }, + { users: [msg.author.id] }, ); } } catch { @@ -66,7 +66,7 @@ export const RoleRemoveCmd = selfGrantableRolesCmd({ pluginData, msg.channel, `<@!${msg.author.id}> Got an error while trying to remove the roles`, - { users: true }, + { users: [msg.author.id] }, ); } } else { @@ -74,7 +74,7 @@ export const RoleRemoveCmd = selfGrantableRolesCmd({ pluginData, msg.channel, `<@!${msg.author.id}> Unknown ${args.roleNames.length === 1 ? "role" : "roles"}`, - { users: true }, + { users: [msg.author.id] }, ); }