From 0a79828ff79bf35aed48cbc12a965ce3841e2064 Mon Sep 17 00:00:00 2001 From: Toastie Date: Wed, 29 Jan 2025 20:09:01 +1300 Subject: [PATCH] fixed .temprole not giving the role --- CHANGELOG.md | 7 +++++++ src/EllieBot/EllieBot.csproj | 2 +- src/EllieBot/Modules/Administration/Role/RoleCommands.cs | 3 ++- src/EllieBot/data/strings/commands/commands.en-US.yml | 6 +++--- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cb4785..0845049 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ Mostly based on [keepachangelog](https://keepachangelog.com/en/1.1.0/) except date format. a-c-f-r-o +## [5.3.8] - 29.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/EllieBot/EllieBot.csproj b/src/EllieBot/EllieBot.csproj index 8620d8e..7dd0e0e 100644 --- a/src/EllieBot/EllieBot.csproj +++ b/src/EllieBot/EllieBot.csproj @@ -4,7 +4,7 @@ enable true en - 5.3.7 + 5.3.8 $(MSBuildProjectDirectory) diff --git a/src/EllieBot/Modules/Administration/Role/RoleCommands.cs b/src/EllieBot/Modules/Administration/Role/RoleCommands.cs index 32d5692..b6b0eb0 100644 --- a/src/EllieBot/Modules/Administration/Role/RoleCommands.cs +++ b/src/EllieBot/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/EllieBot/data/strings/commands/commands.en-US.yml b/src/EllieBot/data/strings/commands/commands.en-US.yml index 6d2ef7a..f3b3253 100644 --- a/src/EllieBot/data/strings/commands/commands.en-US.yml +++ b/src/EllieBot/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: |-