.sar rm will now accept role ids, in the role is deleted
This commit is contained in:
parent
e9430abca7
commit
55ae57b4cc
1 changed files with 12 additions and 5 deletions
|
@ -192,15 +192,22 @@ public partial class Administration
|
||||||
[Cmd]
|
[Cmd]
|
||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
[UserPerm(GuildPerm.ManageRoles)]
|
[UserPerm(GuildPerm.ManageRoles)]
|
||||||
public async Task SarRemove([Leftover] IRole role)
|
[Priority(1)]
|
||||||
{
|
public Task SarRemove([Leftover] IRole role)
|
||||||
var guser = (IGuildUser)ctx.User;
|
=> SarRemove(role.Id);
|
||||||
|
|
||||||
var success = await _service.RemoveAsync(role.Guild.Id, role.Id);
|
[Cmd]
|
||||||
|
[RequireContext(ContextType.Guild)]
|
||||||
|
[UserPerm(GuildPerm.ManageRoles)]
|
||||||
|
[Priority(0)]
|
||||||
|
public async Task SarRemove([Leftover] ulong roleId)
|
||||||
|
{
|
||||||
|
var role = await ctx.Guild.GetRoleAsync(roleId);
|
||||||
|
var success = await _service.RemoveAsync(ctx.Guild.Id, roleId);
|
||||||
if (!success)
|
if (!success)
|
||||||
await Response().Error(strs.self_assign_not).SendAsync();
|
await Response().Error(strs.self_assign_not).SendAsync();
|
||||||
else
|
else
|
||||||
await Response().Confirm(strs.self_assign_rem(Format.Bold(role.Name))).SendAsync();
|
await Response().Confirm(strs.self_assign_rem(Format.Bold(role?.Name ?? roleId.ToString()))).SendAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Cmd]
|
[Cmd]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue