.prune fixed
This commit is contained in:
parent
4dc8ca82e2
commit
92eb26cb0e
@ -573,7 +573,7 @@ namespace NadekoBot.Modules.Administration
|
|||||||
.Parameter("num", ParameterType.Optional)
|
.Parameter("num", ParameterType.Optional)
|
||||||
.Do(async e =>
|
.Do(async e =>
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace("user_or_num")) // if nothing is set, clear nadeko's messages, no permissions required
|
if (string.IsNullOrWhiteSpace(e.GetArg("user_or_num"))) // if nothing is set, clear nadeko's messages, no permissions required
|
||||||
{
|
{
|
||||||
await Task.Run(async () =>
|
await Task.Run(async () =>
|
||||||
{
|
{
|
||||||
@ -591,9 +591,9 @@ namespace NadekoBot.Modules.Administration
|
|||||||
}).ConfigureAwait(false);
|
}).ConfigureAwait(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!e.User.ServerPermissions.ManageMessages)
|
if (!e.User.GetPermissions(e.Channel).ManageMessages)
|
||||||
return;
|
return;
|
||||||
else if (e.Server.CurrentUser.ServerPermissions.ManageMessages)
|
else if (!e.Server.CurrentUser.GetPermissions(e.Channel).ManageMessages)
|
||||||
{
|
{
|
||||||
await e.Channel.SendMessage("💢I don't have the permission to manage messages.");
|
await e.Channel.SendMessage("💢I don't have the permission to manage messages.");
|
||||||
return;
|
return;
|
||||||
@ -610,15 +610,15 @@ namespace NadekoBot.Modules.Administration
|
|||||||
await msg.Delete().ConfigureAwait(false);
|
await msg.Delete().ConfigureAwait(false);
|
||||||
await Task.Delay(100).ConfigureAwait(false);
|
await Task.Delay(100).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
//else if first argument is user
|
//else if first argument is user
|
||||||
var usr = e.Server.FindUsers(e.GetArg("user_or_num")).FirstOrDefault();
|
var usr = e.Server.FindUsers(e.GetArg("user_or_num")).FirstOrDefault();
|
||||||
if (usr == null)
|
if (usr == null)
|
||||||
return;
|
return;
|
||||||
val = 100;
|
val = 100;
|
||||||
int.TryParse("num", out val);
|
if (!int.TryParse(e.GetArg("num"), out val))
|
||||||
if (val <= 0)
|
val = 100;
|
||||||
return;
|
|
||||||
await Task.Run(async () =>
|
await Task.Run(async () =>
|
||||||
{
|
{
|
||||||
var msgs = (await e.Channel.DownloadMessages(100).ConfigureAwait(false)).Where(m => m.User.Id == usr.Id).Take(val);
|
var msgs = (await e.Channel.DownloadMessages(100).ConfigureAwait(false)).Where(m => m.User.Id == usr.Id).Take(val);
|
||||||
|
Loading…
Reference in New Issue
Block a user