From 867d1223788fb50e6047a341cde9bc2c19df82bc Mon Sep 17 00:00:00 2001 From: GitBranch Date: Mon, 8 Aug 2016 23:36:28 +0800 Subject: [PATCH 01/10] The anti-triggered edit 2: Electric boogaloo I pulled into the wrong branch. Now this should be correct. --- NadekoBot/Modules/Translator/Helpers/GoogleTranslator.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NadekoBot/Modules/Translator/Helpers/GoogleTranslator.cs b/NadekoBot/Modules/Translator/Helpers/GoogleTranslator.cs index b1a10a8c..c4af2d78 100644 --- a/NadekoBot/Modules/Translator/Helpers/GoogleTranslator.cs +++ b/NadekoBot/Modules/Translator/Helpers/GoogleTranslator.cs @@ -99,7 +99,8 @@ namespace NadekoBot.Modules.Translator.Helpers { "bengali", "bn"}, { "bulgarian", "bg"}, { "catalan", "ca"}, - { "chinese", "zh-CN"}, + { "chinese-traditional", "zh-TW"}, + { "chinese-simplified", "zh-CN"}, { "croatian", "hr"}, { "czech", "cs"}, { "danish", "da"}, @@ -163,6 +164,7 @@ namespace NadekoBot.Modules.Translator.Helpers { "bn", "bn"}, { "bg", "bg"}, { "ca", "ca"}, + { "zh-TW", "zh-TW"}, { "zh-CN", "zh-CN"}, { "hr", "hr"}, { "cs", "cs"}, From 9cbf00d7582432d0565a336749ea730ae530eb28 Mon Sep 17 00:00:00 2001 From: AraHaan Date: Wed, 10 Aug 2016 04:44:22 -0500 Subject: [PATCH 02/10] Fixed Rolluo documentation in Source File. --- NadekoBot/Modules/Gambling/DiceRollCommand.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NadekoBot/Modules/Gambling/DiceRollCommand.cs b/NadekoBot/Modules/Gambling/DiceRollCommand.cs index 55bb5ee1..326d85c4 100644 --- a/NadekoBot/Modules/Gambling/DiceRollCommand.cs +++ b/NadekoBot/Modules/Gambling/DiceRollCommand.cs @@ -27,7 +27,7 @@ namespace NadekoBot.Modules.Gambling cgb.CreateCommand(Module.Prefix + "rolluo") .Description("Rolls 0-100. If you supply a number [x] it rolls up to 30 normal dice (unordered)." + - $" If you split 2 numbers with letter d (xdy) it will roll x dice from 1 to y. | `{Prefix}roll` or `{Prefix}roll` 7 or `{Prefix}roll 3d5`") + $" If you split 2 numbers with letter d (xdy) it will roll x dice from 1 to y. | `{Prefix}rolluo` or `{Prefix}rolluo 7` or `{Prefix}rolluo 3d5`") .Parameter("num", ParameterType.Optional) .Do(RollFunc(false)); @@ -161,4 +161,4 @@ namespace NadekoBot.Modules.Gambling } }; } -} \ No newline at end of file +} From bda684eb5dcb49d51c110946d629e5b1f561c4f7 Mon Sep 17 00:00:00 2001 From: AraHaan Date: Wed, 10 Aug 2016 04:52:44 -0500 Subject: [PATCH 03/10] Fixed some things to deal with the command stuff that shows on the help command. This should help fix the placements of data in the code blocks. This is needed to simplify things and to make it more understandable. --- NadekoBot/Modules/Music/MusicModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NadekoBot/Modules/Music/MusicModule.cs b/NadekoBot/Modules/Music/MusicModule.cs index 9bf173b7..a4c40bd3 100644 --- a/NadekoBot/Modules/Music/MusicModule.cs +++ b/NadekoBot/Modules/Music/MusicModule.cs @@ -466,7 +466,7 @@ namespace NadekoBot.Modules.Music //var msRegex = new Regex(@"(?\d+)>(?\d+)", RegexOptions.Compiled); cgb.CreateCommand(Prefix + "movesong") .Alias(Prefix + "ms") - .Description($"Moves a song from one position to another. | `{Prefix} ms` 5>3") + .Description($"Moves a song from one position to another. | `{Prefix} ms 5>3`") .Parameter("fromto") .Do(async e => { @@ -502,7 +502,7 @@ namespace NadekoBot.Modules.Music cgb.CreateCommand(Prefix + "setmaxqueue") .Alias(Prefix + "smq") - .Description($"Sets a maximum queue size. Supply 0 or no argument to have no limit. | `{Prefix}smq` 50 or `{Prefix}smq`") + .Description($"Sets a maximum queue size. Supply 0 or no argument to have no limit. | `{Prefix}smq 50` or `{Prefix}smq`") .Parameter("size", ParameterType.Unparsed) .Do(async e => { From f9d049c3132bc71b9fa012863f7a3bd4705268ae Mon Sep 17 00:00:00 2001 From: AraHaan Date: Wed, 10 Aug 2016 05:03:07 -0500 Subject: [PATCH 04/10] Minor Fix to the Documentation in the Source of the ~osu b command --- NadekoBot/Modules/Searches/Commands/OsuCommands.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NadekoBot/Modules/Searches/Commands/OsuCommands.cs b/NadekoBot/Modules/Searches/Commands/OsuCommands.cs index 8ead137d..5907fc6c 100644 --- a/NadekoBot/Modules/Searches/Commands/OsuCommands.cs +++ b/NadekoBot/Modules/Searches/Commands/OsuCommands.cs @@ -56,7 +56,7 @@ namespace NadekoBot.Modules.Searches.Commands }); cgb.CreateCommand(Module.Prefix + "osu b") - .Description($"Shows information about an osu beatmap. |`{Prefix}osu b` https://osu.ppy.sh/s/127712") + .Description($"Shows information about an osu beatmap. |`{Prefix}osu b https://osu.ppy.sh/s/127712`") .Parameter("map", ParameterType.Unparsed) .Do(async e => { From ad1a793a4c939c691ae27867489ab7df1a453c5c Mon Sep 17 00:00:00 2001 From: AraHaan Date: Wed, 10 Aug 2016 05:10:37 -0500 Subject: [PATCH 05/10] Remove New line at end of file. ffs From aa663354275694153eef6806c8016477cf665fce Mon Sep 17 00:00:00 2001 From: GitBranch Date: Wed, 10 Aug 2016 21:04:16 +0800 Subject: [PATCH 06/10] The anti-triggered edit 3: This time it's China --- NadekoBot/Modules/Translator/Helpers/GoogleTranslator.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/NadekoBot/Modules/Translator/Helpers/GoogleTranslator.cs b/NadekoBot/Modules/Translator/Helpers/GoogleTranslator.cs index c4af2d78..4bc8f384 100644 --- a/NadekoBot/Modules/Translator/Helpers/GoogleTranslator.cs +++ b/NadekoBot/Modules/Translator/Helpers/GoogleTranslator.cs @@ -101,6 +101,7 @@ namespace NadekoBot.Modules.Translator.Helpers { "catalan", "ca"}, { "chinese-traditional", "zh-TW"}, { "chinese-simplified", "zh-CN"}, + { "chinese", "zh-CN"}, { "croatian", "hr"}, { "czech", "cs"}, { "danish", "da"}, From 645bb1bd853fd0f47fef29fe645af8f2c1d08ff1 Mon Sep 17 00:00:00 2001 From: Seregy Date: Wed, 10 Aug 2016 22:36:53 +0300 Subject: [PATCH 07/10] Fixed youtube time arguments --- NadekoBot/Modules/Music/Classes/Song.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/NadekoBot/Modules/Music/Classes/Song.cs b/NadekoBot/Modules/Music/Classes/Song.cs index d235776a..d3f5b571 100644 --- a/NadekoBot/Modules/Music/Classes/Song.cs +++ b/NadekoBot/Modules/Music/Classes/Song.cs @@ -297,10 +297,22 @@ namespace NadekoBot.Modules.Music.Classes if (video == null) // do something with this error throw new Exception("Could not load any video elements based on the query."); - var m = Regex.Match(query, @"\?t=(?\d*)"); + + var m = Regex.Match(query, @"\?t=((?\d*)h)?((?\d*)m)?((?\d*)s)?"); int gotoTime = 0; if (m.Captures.Count > 0) - int.TryParse(m.Groups["t"].ToString(), out gotoTime); + { + int hours; + int minutes; + int seconds; + + int.TryParse(m.Groups["h"].ToString(), out hours); + int.TryParse(m.Groups["m"].ToString(), out minutes); + int.TryParse(m.Groups["s"].ToString(), out seconds); + + gotoTime = hours * 60 * 60 + minutes * 60 + seconds; + } + var song = new Song(new SongInfo { Title = video.Title.Substring(0, video.Title.Length - 10), // removing trailing "- You Tube" From 034fe99f3f5a45147df5185d87c87347c9ff4b09 Mon Sep 17 00:00:00 2001 From: Seregy Date: Thu, 11 Aug 2016 00:38:51 +0300 Subject: [PATCH 08/10] Fixed regex for links with just numeric time --- NadekoBot/Modules/Music/Classes/Song.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NadekoBot/Modules/Music/Classes/Song.cs b/NadekoBot/Modules/Music/Classes/Song.cs index d3f5b571..0b0a479a 100644 --- a/NadekoBot/Modules/Music/Classes/Song.cs +++ b/NadekoBot/Modules/Music/Classes/Song.cs @@ -298,7 +298,7 @@ namespace NadekoBot.Modules.Music.Classes if (video == null) // do something with this error throw new Exception("Could not load any video elements based on the query."); - var m = Regex.Match(query, @"\?t=((?\d*)h)?((?\d*)m)?((?\d*)s)?"); + var m = Regex.Match(query, @"\?t=((?\d*)h)?((?\d*)m)?((?\d*)s?)?"); int gotoTime = 0; if (m.Captures.Count > 0) { From 06de3866781206c9bca6e2c9168260654de257b4 Mon Sep 17 00:00:00 2001 From: blitz4694 Date: Thu, 11 Aug 2016 11:38:28 +1000 Subject: [PATCH 09/10] Missed another bold thingy --- NadekoBot/Modules/Games/Commands/PollCommand.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NadekoBot/Modules/Games/Commands/PollCommand.cs b/NadekoBot/Modules/Games/Commands/PollCommand.cs index 785d5c5f..b7082803 100644 --- a/NadekoBot/Modules/Games/Commands/PollCommand.cs +++ b/NadekoBot/Modules/Games/Commands/PollCommand.cs @@ -18,7 +18,7 @@ namespace NadekoBot.Modules.Games.Commands internal override void Init(CommandGroupBuilder cgb) { cgb.CreateCommand(Module.Prefix + "poll") - .Description($"Creates a poll, only person who has manage server permission can do it. | `{Prefix}poll Question?;Answer1;Answ 2;A_3`") + .Description($"Creates a poll, only person who has manage server permission can do it. **Needs Manage Server Permissions**| `{Prefix}poll Question?;Answer1;Answ 2;A_3`") .Parameter("allargs", ParameterType.Unparsed) .Do(async e => { @@ -138,4 +138,4 @@ namespace NadekoBot.Modules.Games.Commands catch { } } } -} \ No newline at end of file +} From c8b911922333235c9663c25fff2cfd717d102893 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Thu, 11 Aug 2016 07:00:40 +0200 Subject: [PATCH 10/10] updated commandlist --- NadekoBot/Classes/ServerSpecificConfig.cs | 8 +++----- docs/Commands List.md | 18 +++++++++--------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/NadekoBot/Classes/ServerSpecificConfig.cs b/NadekoBot/Classes/ServerSpecificConfig.cs index 9142e574..c2680e4a 100644 --- a/NadekoBot/Classes/ServerSpecificConfig.cs +++ b/NadekoBot/Classes/ServerSpecificConfig.cs @@ -64,7 +64,7 @@ namespace NadekoBot.Classes await saveLock.WaitAsync(); try { - File.WriteAllText(filePath, JsonConvert.SerializeObject(configs, Formatting.Indented)); + await Task.Run(() => File.WriteAllText(filePath, JsonConvert.SerializeObject(configs, Formatting.Indented))); } finally { @@ -208,11 +208,9 @@ namespace NadekoBot.Classes [JsonIgnore] private bool exclusiveSelfAssignedRoles = false; - public bool ExclusiveSelfAssignedRoles - { + public bool ExclusiveSelfAssignedRoles { get { return exclusiveSelfAssignedRoles; } - set - { + set { exclusiveSelfAssignedRoles = value; if (!SpecificConfigurations.Instantiated) return; OnPropertyChanged(); diff --git a/docs/Commands List.md b/docs/Commands List.md index 58f97fcb..aec52aa2 100644 --- a/docs/Commands List.md +++ b/docs/Commands List.md @@ -14,9 +14,9 @@ Command and aliases | Description | Usage ----------------|--------------|------- `.grdel` | Toggles automatic deletion of greet and bye messages. **Needs Manage Server Permissions.**| `.grdel` `.greet` | Toggles anouncements on the current channel when someone joins the server. **Needs Manage Server Permissions.**| `.greet` -`.greetmsg` | Sets a new join announcement message. Type %user% if you want to mention the new member. Using it with no message will show the current greet message. **Needs Manage Server Permissions.**| `.greetmsg Welcome to the server, %user%.` +`.greetmsg` | Sets a new join announcement message. Type %user% if you want to mention the new member. Using it with no message will show the current greet message. **Needs Manage Server Permissions.**| `.greetmsg Welcome, %user%.` `.bye` | Toggles anouncements on the current channel when someone leaves the server. | `.bye` -`.byemsg` | Sets a new leave announcement message. Type %user% if you want to mention the new member. Using it with no message will show the current bye message. **Needs Manage Server Permissions.**| `.byemsg %user% has left the server.` +`.byemsg` | Sets a new leave announcement message. Type %user% if you want to mention the new member. Using it with no message will show the current bye message. **Needs Manage Server Permissions.**| `.byemsg %user% has left.` `.byepm` | Toggles whether the good bye messages will be sent in a PM or in the text channel. **Needs Manage Server Permissions.**| `.byepm` `.greetpm` | Toggles whether the greet messages will be sent in a PM or in the text channel. **Needs Manage Server Permissions.**| `.greetpm` `.spmom` | Toggles whether mentions of other offline users on your server will send a pm to them. **Needs Manage Server Permissions.**| `.spmom` @@ -73,7 +73,7 @@ Command and aliases | Description | Usage `.settopic`, `.st` | Sets a topic on the current channel. **Needs Manage Channel Permissions.** | `.st My new topic` `.setchanlname`, `.schn` | Changed the name of the current channel. **Needs Manage Channel Permissions.**| `.schn NewName` `.heap` | Shows allocated memory - **Bot Owner Only!** | `.heap` -`.prune`, `.clr` | `.prune` removes all nadeko's messages in the last 100 messages.`.prune X` removes last X messages from the channel (up to 100)`.prune @Someone` removes all Someone's messages in the last 100 messages.`.prune @Someone X` removes last X 'Someone's' messages in the channel. | `.prune` or `.prune 5` or `.prune @Someone` or `.prune @Someone X` +`.prune`, `.clr` | `.prune` removes all nadeko's messages in the last 100 messages.`.prune X` removes last X messages from the channel (up to 100)`.prune @Someone` removes all Someone's messages in the last 100 messages.`.prune @Someone X` removes last X 'Someone's' messages in the channel. **Needs Manage Messages Permissions**| `.prune` or `.prune 5` or `.prune @Someone` or `.prune @Someone X` `.die` | Shuts the bot down and notifies users about the restart. **Bot Owner Only!** | `.die` `.setname`, `.newnm` | Give the bot a new name. **Bot Owner Only!** | `.newnm BotName` `.newavatar`, `.setavatar` | Sets a new avatar image for the NadekoBot. Argument is a direct link to an image. **Bot Owner Only!** | `.setavatar http://i.imgur.com/xTG3a1I.jpg` @@ -168,7 +168,7 @@ Command and aliases | Description | Usage `$flip` | Flips coin(s) - heads or tails, and shows an image. | `$flip` or `$flip 3` `$betflip`, `$bf` | Bet to guess will the result be heads or tails. Guessing award you double flowers you've bet. | `$bf 5 heads` or `$bf 3 t` `$roll` | Rolls 0-100. If you supply a number [x] it rolls up to 30 normal dice. If you split 2 numbers with letter d (xdy) it will roll x dice from 1 to y. | `$roll` or `$roll 7` or `$roll 3d5` -`$rolluo` | Rolls 0-100. If you supply a number [x] it rolls up to 30 normal dice (unordered). If you split 2 numbers with letter d (xdy) it will roll x dice from 1 to y. | `$roll` or `$roll` 7 or `$roll 3d5` +`$rolluo` | Rolls 0-100. If you supply a number [x] it rolls up to 30 normal dice (unordered). If you split 2 numbers with letter d (xdy) it will roll x dice from 1 to y. | `$rolluo` or `$rolluo 7` or `$rolluo 3d5` `$nroll` | Rolls in a given range. | `$nroll 5` (rolls 0-5) or `$nroll 5-15` `$race` | Starts a new animal race. | `$race` `$joinrace`, `$jr` | Joins a new race. You can specify an amount of flowers for betting (optional). You will get YourBet*(participants-1) back if you win. | `$jr` or `$jr 5` @@ -189,7 +189,7 @@ Command and aliases | Description | Usage `>typestart` | Starts a typing contest. | `>typestart` `>typestop` | Stops a typing contest on the current channel. | `>typestop` `>typeadd` | Adds a new article to the typing contest. Owner only. | `>typeadd wordswords` -`>poll` | Creates a poll, only person who has manage server permission can do it. | `>poll Question?;Answer1;Answ 2;A_3` +`>poll` | Creates a poll, only person who has manage server permission can do it. **Needs Manage Server Permissions**| `>poll Question?;Answer1;Answ 2;A_3` `>pollend` | Stops active poll on this server and prints the results in this channel. | `>pollend` `>pick` | Picks a flower planted in this channel. | `>pick` `>plant` | Spend a flower to plant it in this channel. (If bot is restarted or crashes, flower will be lost) | `>plant` @@ -218,14 +218,14 @@ Command and aliases | Description | Usage `!!half` | Sets the music volume to 50%. | `!!half` `!!shuffle`, `!!sh` | Shuffles the current playlist. | `!!sh` `!!playlist`, `!!pl` | Queues up to 500 songs from a youtube playlist specified by a link, or keywords. | `!!pl playlist link or name` -`!!soundcloudpl`, `!!scpl` | Queue a soundcloud playlist using a link. | `!!scpl https://soundcloud.com/saratology/sets/symphony` +`!!soundcloudpl`, `!!scpl` | Queue a soundcloud playlist using a link. | `!!scpl soundcloudseturl` `!!localplaylst`, `!!lopl` | Queues all songs from a directory. **Bot Owner Only!** | `!!lopl C:/music/classical` `!!radio`, `!!ra` | Queues a radio stream from a link. It can be a direct mp3 radio stream, .m3u, .pls .asx or .xspf (Usage Video: ) | `!!ra radio link here` `!!local`, `!!lo` | Queues a local file by specifying a full path. **Bot Owner Only!** | `!!lo C:/music/mysong.mp3` `!!move`, `!!mv` | Moves the bot to your voice channel. (works only if music is already playing) | `!!mv` `!!remove`, `!!rm` | Remove a song by its # in the queue, or 'all' to remove whole queue. | `!!rm 5` -`!!movesong`, `!!ms` | Moves a song from one position to another. | `!! ms` 5>3 -`!!setmaxqueue`, `!!smq` | Sets a maximum queue size. Supply 0 or no argument to have no limit. | `!!smq` 50 or `!!smq` +`!!movesong`, `!!ms` | Moves a song from one position to another. | `!! ms 5>3` +`!!setmaxqueue`, `!!smq` | Sets a maximum queue size. Supply 0 or no argument to have no limit. | `!!smq 50` or `!!smq` `!!cleanup` | Cleans up hanging voice connections. **Bot Owner Only!** | `!!cleanup` `!!reptcursong`, `!!rcs` | Toggles repeat of current song. | `!!rcs` `!!rpeatplaylst`, `!!rpl` | Toggles repeat of all songs in the queue (every song that finishes is added to the end of the queue). | `!!rpl` @@ -255,7 +255,7 @@ Command and aliases | Description | Usage `~wowjoke` | Get one of Kwoth's penultimate WoW jokes. | `~wowjoke` `~calculate`, `~calc` | Evaluate a mathematical expression. | `~calc 1+1` `~osu` | Shows osu stats for a player. | `~osu Name` or `~osu Name taiko` -`~osu b` | Shows information about an osu beatmap. |`~osu b` https://osu.ppy.sh/s/127712 +`~osu b` | Shows information about an osu beatmap. |`~osu b https://osu.ppy.sh/s/127712` `~osu top5` | Displays a user's top 5 plays. |`~osu top5 Name` `~pokemon`, `~poke` | Searches for a pokemon. | `~poke Sylveon` `~pokemonability`, `~pokeab` | Searches for a pokemon ability. | `~pokeab "water gun"`