From 40f17746553a014c32c3e0194e2ea5d9902924b5 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Mon, 27 Jan 2025 19:57:11 +0000 Subject: [PATCH] fix: fixed .temprole not giving the role --- CHANGELOG.md | 7 +++++++ src/NadekoBot/Modules/Administration/Role/RoleCommands.cs | 3 ++- src/NadekoBot/NadekoBot.csproj | 2 +- src/NadekoBot/data/strings/commands/commands.en-US.yml | 6 +++--- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5df97f0b7..46d6b8950 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ Mostly based on [keepachangelog](https://keepachangelog.com/en/1.0.0/) except date format. a-c-f-r-o +## [5.3.8] - 27.01.2025 + +## Fixed + +- `.temprole` now correctly adds a role + - `.h temprole` also shows the correct overload now + ## [5.3.7] - 21.01.2025 ## Changed diff --git a/src/NadekoBot/Modules/Administration/Role/RoleCommands.cs b/src/NadekoBot/Modules/Administration/Role/RoleCommands.cs index fbcbce0d6..0381a9f77 100644 --- a/src/NadekoBot/Modules/Administration/Role/RoleCommands.cs +++ b/src/NadekoBot/Modules/Administration/Role/RoleCommands.cs @@ -221,7 +221,7 @@ public partial class Administration [RequireContext(ContextType.Guild)] [UserPerm(GuildPerm.Administrator)] [BotPerm(GuildPerm.ManageRoles)] - public async Task TempRole(ParsedTimespan timespan, IUser user, [Leftover] IRole role) + public async Task TempRole(ParsedTimespan timespan, IGuildUser user, [Leftover] IRole role) { if (!await CheckRoleHierarchy(role)) { @@ -231,6 +231,7 @@ public partial class Administration return; } + await user.AddRoleAsync(role); await _tempRoleService.AddTempRoleAsync(ctx.Guild.Id, role.Id, user.Id, timespan.Time); diff --git a/src/NadekoBot/NadekoBot.csproj b/src/NadekoBot/NadekoBot.csproj index aaafe2b52..486912379 100644 --- a/src/NadekoBot/NadekoBot.csproj +++ b/src/NadekoBot/NadekoBot.csproj @@ -4,7 +4,7 @@ enable true en - 5.3.7 + 5.3.8 $(MSBuildProjectDirectory) diff --git a/src/NadekoBot/data/strings/commands/commands.en-US.yml b/src/NadekoBot/data/strings/commands/commands.en-US.yml index 62d3df6d3..50884e680 100644 --- a/src/NadekoBot/data/strings/commands/commands.en-US.yml +++ b/src/NadekoBot/data/strings/commands/commands.en-US.yml @@ -4852,11 +4852,11 @@ temprole: - '15m @User Jail' - '7d @Newbie Trial Member' params: - - days: + - time: desc: "The time after which the role is automatically removed." - - user: + user: desc: "The user to give the role to." - - role: + role: desc: "The role to give to the user." minesweeper: desc: |-