diff --git a/NadekoBot/Modules/Utility/UtilityModule.cs b/NadekoBot/Modules/Utility/UtilityModule.cs index 999ec44a..16902f5c 100644 --- a/NadekoBot/Modules/Utility/UtilityModule.cs +++ b/NadekoBot/Modules/Utility/UtilityModule.cs @@ -52,16 +52,15 @@ namespace NadekoBot.Modules.Utility }); cgb.CreateCommand(Prefix + "inrole") - .Description("Lists every person from the provided role or roles (separated by a ',') on this server.") + .Description("Lists every person from the provided role or roles (separated by a ',') on this server. If the list is too long for 1 message, you must have Manage Messages permission.") .Parameter("roles", ParameterType.Unparsed) .Do(async e => { await Task.Run(async () => { - if (!e.User.ServerPermissions.MentionEveryone) return; var arg = e.GetArg("roles").Split(',').Select(r => r.Trim()); string send = $"`Here is a list of users in a specfic role:`"; - foreach (var roleStr in arg.Where(str => !string.IsNullOrWhiteSpace(str))) + foreach (var roleStr in arg.Where(str => !string.IsNullOrWhiteSpace(str) && str != "@everyone" && str != "everyone")) { var role = e.Server.FindRoles(roleStr).FirstOrDefault(); if (role == null) continue; @@ -71,6 +70,11 @@ namespace NadekoBot.Modules.Utility while (send.Length > 2000) { + if (!e.User.ServerPermissions.ManageMessages) + { + await e.Channel.SendMessage($"{e.User.Mention} you are not allowed to use this command on roles with a lot of users in them to prevent abuse."); + return; + } var curstr = send.Substring(0, 2000); await e.Channel.Send(curstr.Substring(0,