mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-11-02 15:54:27 -05:00
.warnp should accept roles only below your max role. Also added a custom error message
This commit is contained in:
@@ -323,6 +323,14 @@ namespace NadekoBot.Modules.Administration
|
|||||||
public async Task WarnPunish(int number, AddRole _, IRole role, StoopidTime time = null)
|
public async Task WarnPunish(int number, AddRole _, IRole role, StoopidTime time = null)
|
||||||
{
|
{
|
||||||
var punish = PunishmentAction.AddRole;
|
var punish = PunishmentAction.AddRole;
|
||||||
|
|
||||||
|
if (ctx.Guild.OwnerId != ctx.User.Id &&
|
||||||
|
role.Position >= ((IGuildUser)ctx.User).GetRoles().Max(x => x.Position))
|
||||||
|
{
|
||||||
|
await ReplyErrorLocalizedAsync("role_too_high");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var success = _service.WarnPunish(ctx.Guild.Id, number, punish, time, role);
|
var success = _service.WarnPunish(ctx.Guild.Id, number, punish, time, role);
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
|
|||||||
@@ -80,6 +80,7 @@
|
|||||||
"greet_off": "Greet announcements disabled.",
|
"greet_off": "Greet announcements disabled.",
|
||||||
"greet_on": "Greet announcements enabled on this channel.",
|
"greet_on": "Greet announcements enabled on this channel.",
|
||||||
"hierarchy": "You can't use this command on users with a role higher or equal than yours (or mine) in the role hierarchy.",
|
"hierarchy": "You can't use this command on users with a role higher or equal than yours (or mine) in the role hierarchy.",
|
||||||
|
"role_too_high": "You can't use this command with roles which are above your highest role, unless you're server administrator.",
|
||||||
"images_loading": "Images will be reloaded within a few seconds.",
|
"images_loading": "Images will be reloaded within a few seconds.",
|
||||||
"insuf_perms_i": "I have insufficient permissions.",
|
"insuf_perms_i": "I have insufficient permissions.",
|
||||||
"insuf_perms_u": "You have insufficient permissions.",
|
"insuf_perms_u": "You have insufficient permissions.",
|
||||||
|
|||||||
Reference in New Issue
Block a user