Fixed bugs Fearnlj01 found

This commit is contained in:
Kwoth
2016-10-08 11:55:56 +02:00
parent 81a3a33fff
commit 24978b7cb5
8 changed files with 125 additions and 123 deletions

View File

@@ -475,15 +475,9 @@ namespace NadekoBot.Modules.Administration
{
var channel = (ITextChannel)msg.Channel;
await (msg as IUserMessage).DeleteAsync();
while (count > 0)
{
int limit = (count < 100) ? count : 100;
var enumerable = (await msg.Channel.GetMessagesAsync(limit: limit));
await msg.Channel.DeleteMessagesAsync(enumerable);
await Task.Delay(1000); // there is a 1 per second per guild ratelimit for deletemessages
if (enumerable.Count < limit) break;
count -= limit;
}
int limit = (count < 100) ? count : 100;
var enumerable = (await msg.Channel.GetMessagesAsync(limit: limit));
await msg.Channel.DeleteMessagesAsync(enumerable);
}
//prune @user [x]

View File

@@ -63,7 +63,7 @@ namespace NadekoBot.Modules.Gambling
[NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)]
public async Task Shuffle(IUserMessage imsg)
public async Task ShuffleDeck(IUserMessage imsg)
{
var channel = (ITextChannel)imsg.Channel;

View File

@@ -208,35 +208,7 @@ namespace NadekoBot.Modules.Music
[NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)]
public Task Mute(IUserMessage umsg)
{
var channel = (ITextChannel)umsg.Channel;
MusicPlayer musicPlayer;
if (!MusicPlayers.TryGetValue(channel.Guild.Id, out musicPlayer))
return Task.CompletedTask;
if (((IGuildUser)umsg.Author).VoiceChannel != musicPlayer.PlaybackVoiceChannel)
return Task.CompletedTask;
musicPlayer.SetVolume(0);
return Task.CompletedTask;
}
[NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)]
public Task Max(IUserMessage umsg)
{
var channel = (ITextChannel)umsg.Channel;
MusicPlayer musicPlayer;
if (!MusicPlayers.TryGetValue(channel.Guild.Id, out musicPlayer))
return Task.CompletedTask;
if (((IGuildUser)umsg.Author).VoiceChannel != musicPlayer.PlaybackVoiceChannel)
return Task.CompletedTask;
musicPlayer.SetVolume(100);
return Task.CompletedTask;
}
[NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)]
public async Task Shuffle(IUserMessage umsg)
public async Task ShufflePlaylist(IUserMessage umsg)
{
var channel = (ITextChannel)umsg.Channel;
MusicPlayer musicPlayer;

View File

@@ -258,7 +258,7 @@ $@"🌍 **Weather for** 【{obj["target"]}】
[NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)]
public async Task Ud(IUserMessage umsg, [Remainder] string query = null)
public async Task UrbanDict(IUserMessage umsg, [Remainder] string query = null)
{
var channel = (ITextChannel)umsg.Channel;
@@ -404,7 +404,7 @@ $@"🌍 **Weather for** 【{obj["target"]}】
[NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)]
public async Task Clr(IUserMessage umsg, [Remainder] string color = null)
public async Task Color(IUserMessage umsg, [Remainder] string color = null)
{
var channel = (ITextChannel)umsg.Channel;

View File

@@ -93,7 +93,7 @@ namespace NadekoBot.Modules.Utility
[NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)]
public async Task DelAllQuotes(IUserMessage umsg, string keyword)
public async Task DelAllQuotes(IUserMessage umsg, [Remainder] string keyword)
{
var channel = (ITextChannel)umsg.Channel;

View File

@@ -198,7 +198,7 @@ namespace NadekoBot.Modules.Utility
uow.BotConfig.GetOrCreate().RemindMessageFormat = arg.Trim();
await uow.CompleteAsync().ConfigureAwait(false);
}
await channel.SendMessageAsync("`New remind message set.`");
await channel.SendMessageAsync("`New remind template set.`");
}
}
}