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;
}
}
//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.`");
}
}
}

View File

@ -305,27 +305,27 @@ namespace NadekoBot.Resources {
/// <summary>
/// Looks up a localized string similar to ani anime aq.
/// </summary>
public static string ani_cmd {
public static string anime_cmd {
get {
return ResourceManager.GetString("ani_cmd", resourceCulture);
return ResourceManager.GetString("anime_cmd", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Queries anilist for an anime and shows the first result..
/// </summary>
public static string ani_desc {
public static string anime_desc {
get {
return ResourceManager.GetString("ani_desc", resourceCulture);
return ResourceManager.GetString("anime_desc", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to `~ani aquarion evol`.
/// </summary>
public static string ani_usage {
public static string anime_usage {
get {
return ResourceManager.GetString("ani_usage", resourceCulture);
return ResourceManager.GetString("anime_usage", resourceCulture);
}
}
@ -807,7 +807,7 @@ namespace NadekoBot.Resources {
}
/// <summary>
/// Looks up a localized string similar to `.calcops`.
/// Looks up a localized string similar to `~calcops`.
/// </summary>
public static string calcops_usage {
get {
@ -1463,33 +1463,6 @@ namespace NadekoBot.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to clr prune.
/// </summary>
public static string clr_cmd {
get {
return ResourceManager.GetString("clr_cmd", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Shows you what color corresponds to that hex..
/// </summary>
public static string clr_desc {
get {
return ResourceManager.GetString("clr_desc", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to `~clr 00ff00`.
/// </summary>
public static string clr_usage {
get {
return ResourceManager.GetString("clr_usage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to cmdcooldown cmdcd.
/// </summary>
@ -1517,6 +1490,33 @@ namespace NadekoBot.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to color clr.
/// </summary>
public static string color_cmd {
get {
return ResourceManager.GetString("color_cmd", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Shows you what color corresponds to that hex..
/// </summary>
public static string color_desc {
get {
return ResourceManager.GetString("color_desc", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to `~clr 00ff00`.
/// </summary>
public static string color_usage {
get {
return ResourceManager.GetString("color_usage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to commands cmds.
/// </summary>
@ -1590,7 +1590,7 @@ namespace NadekoBot.Resources {
}
/// <summary>
/// Looks up a localized string similar to .
/// Looks up a localized string similar to `~convertlist`.
/// </summary>
public static string convertlist_usage {
get {
@ -1833,7 +1833,7 @@ namespace NadekoBot.Resources {
}
/// <summary>
/// Looks up a localized string similar to `.delallq`.
/// Looks up a localized string similar to `.delallq kek`.
/// </summary>
public static string delallquotes_usage {
get {
@ -4191,7 +4191,7 @@ namespace NadekoBot.Resources {
}
/// <summary>
/// Looks up a localized string similar to mute min.
/// Looks up a localized string similar to mute.
/// </summary>
public static string mute_cmd {
get {
@ -4200,7 +4200,7 @@ namespace NadekoBot.Resources {
}
/// <summary>
/// Looks up a localized string similar to Sets the music volume to 0%.
/// Looks up a localized string similar to Mutes a mentioned user in a voice channel..
/// </summary>
public static string mute_desc {
get {
@ -4209,7 +4209,7 @@ namespace NadekoBot.Resources {
}
/// <summary>
/// Looks up a localized string similar to `!!min`.
/// Looks up a localized string similar to `.mute @Someone`.
/// </summary>
public static string mute_usage {
get {
@ -4920,29 +4920,29 @@ namespace NadekoBot.Resources {
}
/// <summary>
/// Looks up a localized string similar to remindmsg.
/// Looks up a localized string similar to remindtemplate.
/// </summary>
public static string remindmsg_cmd {
public static string remindtemplate_cmd {
get {
return ResourceManager.GetString("remindmsg_cmd", resourceCulture);
return ResourceManager.GetString("remindtemplate_cmd", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sets message for when the remind is triggered. Available placeholders are %user% - user who ran the command, %message% - Message specified in the remind, %target% - target channel of the remind. .
/// </summary>
public static string remindmsg_desc {
public static string remindtemplate_desc {
get {
return ResourceManager.GetString("remindmsg_desc", resourceCulture);
return ResourceManager.GetString("remindtemplate_desc", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to `.remindmsg do something else`.
/// Looks up a localized string similar to `.remindtemplate %user%, you gotta do %message%!`.
/// </summary>
public static string remindmsg_usage {
public static string remindtemplate_usage {
get {
return ResourceManager.GetString("remindmsg_usage", resourceCulture);
return ResourceManager.GetString("remindtemplate_usage", resourceCulture);
}
}
@ -6144,7 +6144,7 @@ namespace NadekoBot.Resources {
}
/// <summary>
/// Looks up a localized string similar to Shows a name and a link to every special emoji in the message..
/// Looks up a localized string similar to Shows a name and a link to every SPECIAL emoji in the message..
/// </summary>
public static string showemojis_desc {
get {
@ -6153,7 +6153,7 @@ namespace NadekoBot.Resources {
}
/// <summary>
/// Looks up a localized string similar to `.se A message full of emojis`.
/// Looks up a localized string similar to `.se A message full of SPECIALemojis`.
/// </summary>
public static string showemojis_usage {
get {
@ -6191,27 +6191,54 @@ namespace NadekoBot.Resources {
/// <summary>
/// Looks up a localized string similar to shuffle sh.
/// </summary>
public static string shuffle_cmd {
public static string shuffledeck_cmd {
get {
return ResourceManager.GetString("shuffle_cmd", resourceCulture);
return ResourceManager.GetString("shuffledeck_cmd", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Reshuffles all cards back into the deck..
/// </summary>
public static string shuffledeck_desc {
get {
return ResourceManager.GetString("shuffledeck_desc", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to `$sh`.
/// </summary>
public static string shuffledeck_usage {
get {
return ResourceManager.GetString("shuffledeck_usage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to shuffle sh.
/// </summary>
public static string shuffleplaylist_cmd {
get {
return ResourceManager.GetString("shuffleplaylist_cmd", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Shuffles the current playlist..
/// </summary>
public static string shuffle_desc {
public static string shuffleplaylist_desc {
get {
return ResourceManager.GetString("shuffle_desc", resourceCulture);
return ResourceManager.GetString("shuffleplaylist_desc", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to `!!sh`.
/// </summary>
public static string shuffle_usage {
public static string shuffleplaylist_usage {
get {
return ResourceManager.GetString("shuffle_usage", resourceCulture);
return ResourceManager.GetString("shuffleplaylist_usage", resourceCulture);
}
}
@ -6693,7 +6720,7 @@ namespace NadekoBot.Resources {
}
/// <summary>
/// Looks up a localized string similar to `~translangs` or `~translangs language`.
/// Looks up a localized string similar to `~translangs`.
/// </summary>
public static string translangs_usage {
get {

View File

@ -613,13 +613,13 @@
<value>`.k "@some Guy" Your behaviour is toxic.`</value>
</data>
<data name="mute_cmd" xml:space="preserve">
<value>mute min</value>
<value>mute</value>
</data>
<data name="mute_desc" xml:space="preserve">
<value>Sets the music volume to 0%</value>
<value>Mutes a mentioned user in a voice channel.</value>
</data>
<data name="mute_usage" xml:space="preserve">
<value>`!!min`</value>
<value>`.mute @Someone`</value>
</data>
<data name="unmute_cmd" xml:space="preserve">
<value>unmute</value>
@ -828,14 +828,14 @@
<data name="remind_usage" xml:space="preserve">
<value>`.remind me 1d5h Do something` or `.remind #general Start now!`</value>
</data>
<data name="remindmsg_cmd" xml:space="preserve">
<value>remindmsg</value>
<data name="remindtemplate_cmd" xml:space="preserve">
<value>remindtemplate</value>
</data>
<data name="remindmsg_desc" xml:space="preserve">
<data name="remindtemplate_desc" xml:space="preserve">
<value>Sets message for when the remind is triggered. Available placeholders are %user% - user who ran the command, %message% - Message specified in the remind, %target% - target channel of the remind. </value>
</data>
<data name="remindmsg_usage" xml:space="preserve">
<value>`.remindmsg do something else`</value>
<data name="remindtemplate_usage" xml:space="preserve">
<value>`.remindtemplate %user%, you gotta do %message%!`</value>
</data>
<data name="serverinfo_cmd" xml:space="preserve">
<value>serverinfo sinfo</value>
@ -1314,13 +1314,13 @@
<data name="draw_usage" xml:space="preserve">
<value>`$draw [x]`</value>
</data>
<data name="shuffle_cmd" xml:space="preserve">
<data name="shuffleplaylist_cmd" xml:space="preserve">
<value>shuffle sh</value>
</data>
<data name="shuffle_desc" xml:space="preserve">
<data name="shuffleplaylist_desc" xml:space="preserve">
<value>Shuffles the current playlist.</value>
</data>
<data name="shuffle_usage" xml:space="preserve">
<data name="shuffleplaylist_usage" xml:space="preserve">
<value>`!!sh`</value>
</data>
<data name="flip_cmd" xml:space="preserve">
@ -1942,7 +1942,7 @@
<value>List of the convertable dimensions and currencies.</value>
</data>
<data name="convertlist_usage" xml:space="preserve">
<value />
<value>`~convertlist`</value>
</data>
<data name="wowjoke_cmd" xml:space="preserve">
<value>wowjoke</value>
@ -2043,13 +2043,13 @@
<data name="youtube_usage" xml:space="preserve">
<value>`~yt query`</value>
</data>
<data name="ani_cmd" xml:space="preserve">
<data name="anime_cmd" xml:space="preserve">
<value>ani anime aq</value>
</data>
<data name="ani_desc" xml:space="preserve">
<data name="anime_desc" xml:space="preserve">
<value>Queries anilist for an anime and shows the first result.</value>
</data>
<data name="ani_usage" xml:space="preserve">
<data name="anime_usage" xml:space="preserve">
<value>`~ani aquarion evol`</value>
</data>
<data name="imdb_cmd" xml:space="preserve">
@ -2232,13 +2232,13 @@
<data name="wiki_usage" xml:space="preserve">
<value>`~wiki query`</value>
</data>
<data name="clr_cmd" xml:space="preserve">
<value>clr prune</value>
<data name="color_cmd" xml:space="preserve">
<value>color clr</value>
</data>
<data name="clr_desc" xml:space="preserve">
<data name="color_desc" xml:space="preserve">
<value>Shows you what color corresponds to that hex.</value>
</data>
<data name="clr_usage" xml:space="preserve">
<data name="color_usage" xml:space="preserve">
<value>`~clr 00ff00`</value>
</data>
<data name="videocall_cmd" xml:space="preserve">
@ -2473,7 +2473,7 @@
<value>List the valid languages for translation.</value>
</data>
<data name="translangs_usage" xml:space="preserve">
<value>`~translangs` or `~translangs language`</value>
<value>`~translangs`</value>
</data>
<data name="bind_cmd" xml:space="preserve">
<value>bind</value>
@ -2524,7 +2524,7 @@
<value>Shows all available operations in .calc command</value>
</data>
<data name="calcops_usage" xml:space="preserve">
<value>`.calcops`</value>
<value>`~calcops`</value>
</data>
<data name="calcops_cmd" xml:space="preserve">
<value>calcops</value>
@ -2533,7 +2533,7 @@
<value>Deletes all quotes on a specified keyword.</value>
</data>
<data name="delallquotes_usage" xml:space="preserve">
<value>`.delallq`</value>
<value>`.delallq kek`</value>
</data>
<data name="delallquotes_cmd" xml:space="preserve">
<value>delallq daq</value>
@ -2614,9 +2614,18 @@
<value>showemojis se</value>
</data>
<data name="showemojis_desc" xml:space="preserve">
<value>Shows a name and a link to every special emoji in the message.</value>
<value>Shows a name and a link to every SPECIAL emoji in the message.</value>
</data>
<data name="showemojis_usage" xml:space="preserve">
<value>`.se A message full of emojis`</value>
<value>`.se A message full of SPECIALemojis`</value>
</data>
<data name="shuffledeck_cmd" xml:space="preserve">
<value>shuffle sh</value>
</data>
<data name="shuffledeck_desc" xml:space="preserve">
<value>Reshuffles all cards back into the deck.</value>
</data>
<data name="shuffledeck_usage" xml:space="preserve">
<value>`$sh`</value>
</data>
</root>