Merge remote-tracking branch 'refs/remotes/Kwoth/master' into Ncalc
This commit is contained in:
@ -6,6 +6,7 @@ using NadekoBot.Modules.Permissions.Classes;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using ChPermOverride = Discord.ChannelPermissionOverrides;
|
||||
|
||||
namespace NadekoBot.Modules.Administration.Commands
|
||||
@ -91,12 +92,26 @@ namespace NadekoBot.Modules.Administration.Commands
|
||||
.AddCheck(SimpleCheckers.ManageChannels())
|
||||
.Do(async e =>
|
||||
{
|
||||
if (!e.Server.CurrentUser.ServerPermissions.ManageChannels)
|
||||
{
|
||||
await e.Channel.SendMessage("`I have insufficient permission to do that.`");
|
||||
return;
|
||||
}
|
||||
|
||||
var allTxtChannels = e.Server.TextChannels.Where(c => c.Name.EndsWith("-voice"));
|
||||
var validTxtChannelNames = e.Server.VoiceChannels.Select(c => GetChannelName(c.Name));
|
||||
|
||||
var invalidTxtChannels = allTxtChannels.Where(c => !validTxtChannelNames.Contains(c.Name));
|
||||
|
||||
invalidTxtChannels.ForEach(async c => await c.Delete());
|
||||
foreach (var c in invalidTxtChannels)
|
||||
{
|
||||
try
|
||||
{
|
||||
await c.Delete();
|
||||
}
|
||||
catch { }
|
||||
await Task.Delay(500);
|
||||
}
|
||||
|
||||
await e.Channel.SendMessage("`Done.`");
|
||||
});
|
||||
|
@ -292,7 +292,7 @@ namespace NadekoBot.Modules.Pokemon
|
||||
var targetType = stringToPokemonType(targetTypeStr);
|
||||
if (targetType == null)
|
||||
{
|
||||
await e.Channel.SendMessage("Invalid type specified. Type must be one of:\nNORMAL, FIRE, WATER, ELECTRIC, GRASS, ICE, FIGHTING, POISON, GROUND, FLYING, PSYCHIC, BUG, ROCK, GHOST, DRAGON, DARK, STEEL").ConfigureAwait(false);
|
||||
await e.Channel.SendMessage("Invalid type specified. Type must be one of:\n" + string.Join(", ", NadekoBot.Config.PokemonTypes.Select(t => t.Name.ToUpperInvariant()))).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
if (targetType == GetPokeType(e.User.Id))
|
||||
|
Reference in New Issue
Block a user