From a7fc482ff7d32eb37024a11d760ec5f55e4454e7 Mon Sep 17 00:00:00 2001 From: samvaio Date: Wed, 28 Dec 2016 21:43:38 +0530 Subject: [PATCH 1/5] Songs Thumbnail fixed --- src/NadekoBot/Modules/Music/Classes/Song.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/NadekoBot/Modules/Music/Classes/Song.cs b/src/NadekoBot/Modules/Music/Classes/Song.cs index c7dfeaf0..4405f4e0 100644 --- a/src/NadekoBot/Modules/Music/Classes/Song.cs +++ b/src/NadekoBot/Modules/Music/Classes/Song.cs @@ -58,7 +58,7 @@ namespace NadekoBot.Modules.Music.Classes private string PrettyTotalTime { get { if (TotalTime == TimeSpan.Zero) - return "(?)"; + return "-"; else if (TotalTime == TimeSpan.MaxValue) return "∞"; else @@ -68,17 +68,18 @@ namespace NadekoBot.Modules.Music.Classes public string Thumbnail { get { - switch (SongInfo.ProviderType) + switch (SongInfo.Provider) { - case MusicType.Radio: + + case "YouTube": //todo have videoid in songinfo from the start var videoId = Regex.Match(SongInfo.Query, "<=v=[a-zA-Z0-9-]+(?=&)|(?<=[0-9])[^&\n]+|(?<=v=)[^&\n]+"); return $"https://img.youtube.com/vi/{ videoId }/0.jpg"; - case MusicType.Normal: + case "Radio Stream": return $"https://cdn.discordapp.com/attachments/155726317222887425/261850925063340032/1482522097_radio.png"; //test links - case MusicType.Local: + case "Local File": return $"https://cdn.discordapp.com/attachments/155726317222887425/261850914783100928/1482522077_music.png"; //test links - case MusicType.Soundcloud: + case "SoundCloud": return SongInfo.AlbumArt; default: return ""; From 0ef9e356e5fd4957b909ef695b68463500cc1f3f Mon Sep 17 00:00:00 2001 From: samvaio Date: Wed, 28 Dec 2016 21:46:36 +0530 Subject: [PATCH 2/5] Google Search fixed - All searches url now uses shorturl to fix the issue with links having more than 250+ characters - Title, Texts and terms trimmed to fit in embeds --- src/NadekoBot/Modules/Searches/Searches.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/NadekoBot/Modules/Searches/Searches.cs b/src/NadekoBot/Modules/Searches/Searches.cs index 20cd6361..83f55bfe 100644 --- a/src/NadekoBot/Modules/Searches/Searches.cs +++ b/src/NadekoBot/Modules/Searches/Searches.cs @@ -266,7 +266,7 @@ namespace NadekoBot.Modules.Searches var embed = new EmbedBuilder() .WithOkColor() - .WithAuthor(eab => eab.WithName("Search For: " + terms) + .WithAuthor(eab => eab.WithName("Search For: " + terms.TrimTo(50)) .WithUrl(fullQueryLink) .WithIconUrl("http://i.imgur.com/G46fm8J.png")) .WithTitle(umsg.Author.Mention) @@ -274,7 +274,8 @@ namespace NadekoBot.Modules.Searches string desc = ""; foreach (GoogleSearchResult res in results) { - desc += $"[{Format.Bold(res.Title)}]({res.Link})\n{res.Text}\n\n"; + var shortlinks = await NadekoBot.Google.ShortenUrl(res.Link).ConfigureAwait(false); + desc += $"[{Format.Bold(res.Title.TrimTo(70))}]({shortlinks})\n{res.Text.TrimTo(150)}\n\n"; } await channel.EmbedAsync(embed.WithDescription(desc).Build()).ConfigureAwait(false); } From c4354112c625dbf47bba1c886c387f1b6c477204 Mon Sep 17 00:00:00 2001 From: samvaio Date: Thu, 29 Dec 2016 12:04:12 +0530 Subject: [PATCH 3/5] Revert "Google Search fixed" This reverts commit 0ef9e356e5fd4957b909ef695b68463500cc1f3f. --- src/NadekoBot/Modules/Searches/Searches.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/NadekoBot/Modules/Searches/Searches.cs b/src/NadekoBot/Modules/Searches/Searches.cs index 83f55bfe..20cd6361 100644 --- a/src/NadekoBot/Modules/Searches/Searches.cs +++ b/src/NadekoBot/Modules/Searches/Searches.cs @@ -266,7 +266,7 @@ namespace NadekoBot.Modules.Searches var embed = new EmbedBuilder() .WithOkColor() - .WithAuthor(eab => eab.WithName("Search For: " + terms.TrimTo(50)) + .WithAuthor(eab => eab.WithName("Search For: " + terms) .WithUrl(fullQueryLink) .WithIconUrl("http://i.imgur.com/G46fm8J.png")) .WithTitle(umsg.Author.Mention) @@ -274,8 +274,7 @@ namespace NadekoBot.Modules.Searches string desc = ""; foreach (GoogleSearchResult res in results) { - var shortlinks = await NadekoBot.Google.ShortenUrl(res.Link).ConfigureAwait(false); - desc += $"[{Format.Bold(res.Title.TrimTo(70))}]({shortlinks})\n{res.Text.TrimTo(150)}\n\n"; + desc += $"[{Format.Bold(res.Title)}]({res.Link})\n{res.Text}\n\n"; } await channel.EmbedAsync(embed.WithDescription(desc).Build()).ConfigureAwait(false); } From b150bc9a85eeaef37a550a60f8c60d45d7e2829f Mon Sep 17 00:00:00 2001 From: samvaio Date: Thu, 29 Dec 2016 19:18:57 +0530 Subject: [PATCH 4/5] ups --- src/NadekoBot/Modules/Music/Classes/Song.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/NadekoBot/Modules/Music/Classes/Song.cs b/src/NadekoBot/Modules/Music/Classes/Song.cs index 4405f4e0..6a614eec 100644 --- a/src/NadekoBot/Modules/Music/Classes/Song.cs +++ b/src/NadekoBot/Modules/Music/Classes/Song.cs @@ -58,7 +58,7 @@ namespace NadekoBot.Modules.Music.Classes private string PrettyTotalTime { get { if (TotalTime == TimeSpan.Zero) - return "-"; + return "(?)"; else if (TotalTime == TimeSpan.MaxValue) return "∞"; else @@ -68,18 +68,17 @@ namespace NadekoBot.Modules.Music.Classes public string Thumbnail { get { - switch (SongInfo.Provider) + switch (SongInfo.ProviderType) { - - case "YouTube": + case MusicType.Radio: + return $"https://cdn.discordapp.com/attachments/155726317222887425/261850925063340032/1482522097_radio.png"; //test links + case MusicType.Normal: //todo have videoid in songinfo from the start var videoId = Regex.Match(SongInfo.Query, "<=v=[a-zA-Z0-9-]+(?=&)|(?<=[0-9])[^&\n]+|(?<=v=)[^&\n]+"); return $"https://img.youtube.com/vi/{ videoId }/0.jpg"; - case "Radio Stream": - return $"https://cdn.discordapp.com/attachments/155726317222887425/261850925063340032/1482522097_radio.png"; //test links - case "Local File": + case MusicType.Local: return $"https://cdn.discordapp.com/attachments/155726317222887425/261850914783100928/1482522077_music.png"; //test links - case "SoundCloud": + case MusicType.Soundcloud: return SongInfo.AlbumArt; default: return ""; From 1358b2b524a8fc69ffeec24a4a740ff316872c7b Mon Sep 17 00:00:00 2001 From: samvaio Date: Mon, 16 Jan 2017 19:31:43 +0530 Subject: [PATCH 5/5] Update Windows Guide.md --- docs/guides/Windows Guide.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/guides/Windows Guide.md b/docs/guides/Windows Guide.md index 1f996b1c..0d569909 100644 --- a/docs/guides/Windows Guide.md +++ b/docs/guides/Windows Guide.md @@ -16,8 +16,8 @@ ________________________________________________________________________________ ####Guide - Make sure you have installed both [Git][Git] and the [.NET Core SDK][.NET Core SDK]. - Create a **new folder** anywhere you like and name it `Nadeko`. -- Next, [Right-Click on this link](https://github.com/Kwoth/NadekoBotInstallerWin/raw/master/NadekoInstaller.bat) and select **Save link as** and save the file `NadekoInstaller.bat` inside the `Nadeko` folder that we created earlier. (**DO NOT** rename the file `NadekoInstaller.bat`) -- Once that's done, double-click on `NadekoInstaller.bat` to run it. +- Next, [Right-Click on this link](https://github.com/Kwoth/NadekoBotInstallerWin/raw/master/NadekoInstaller.bat) and select **Save link as** and save the file `NadekoInstaller.bat` inside the `Nadeko` folder that we created earlier. (Please **DO NOT** rename the file `NadekoInstaller.bat`.) +- Once that's done, right-click on `NadekoInstaller.bat` to run it as Administrator. - From the options, - Choose `1` to get the **most recent build**. - Choose `2` to get the **stable build**. @@ -58,7 +58,7 @@ ________________________________________________________________________________ - The bot should have been added to your server. ####Starting the bot -- Go to the `Nadeko` folder that we have created earlier, and run the `NadekoInstaller.bat` file. +- Go to the `Nadeko` folder that we have created earlier, and run the `NadekoInstaller.bat` file as Administrator. - From the options, - Choose `3` to **run the bot normally**. (with normal-run the bot will shutdown and will stay offline if it disconnects by the use of `.die` command until you manually run it again. Useful if you want to test the bot.) @@ -83,6 +83,16 @@ ________________________________________________________________________________ In order to have a functioning music module, you need to install ffmpeg and setup api keys. +#### Setting up `ffmpeg` using NadekoBot Client! +- Go to the `Nadeko` folder that we have created earlier, and run the `NadekoInstaller.bat` file as Administrator. +- From the options select `6` Install ffmpeg (for music) +- Next, **Press Any Key** if you are running as Administrator or just close and relaunch it as Administrator using mouse right-click. +- Wait for it to finish installing and backing up existing. +- Once done, you should see "ffmpeg Installation complete!". +- Next, **Press Any Key** to go back to NadekoBot Client. +- Press `3` to run the bot normally just to test music. (optional) +- `ffmpeg` installation for Music is now complete. + #### Manual `ffmpeg` setup - Create a folder named `ffmpeg` in your main Windows directory. We will use **C:\ffmpeg** (for our guide) - Download FFMPEG through the link https://ffmpeg.zeranoe.com/builds/ (download static build)