diff --git a/NadekoBot/Classes/Music/StreamRequest.cs b/NadekoBot/Classes/Music/StreamRequest.cs index 5bee59b7..627579ed 100644 --- a/NadekoBot/Classes/Music/StreamRequest.cs +++ b/NadekoBot/Classes/Music/StreamRequest.cs @@ -258,7 +258,8 @@ namespace NadekoBot.Classes.Music { // prebuffering wait stuff start int bufferAttempts = 0; int waitPerAttempt = 500; - while (!prebufferingComplete && bufferAttempts++ < 15) { + int toAttemptTimes = parent.RadioLink ? 4 : 8; + while (!prebufferingComplete && bufferAttempts++ < toAttemptTimes) { await Task.Delay(waitPerAttempt); } if (prebufferingComplete) { diff --git a/NadekoBot/Classes/SearchHelper.cs b/NadekoBot/Classes/SearchHelper.cs index a148563d..3bb93987 100644 --- a/NadekoBot/Classes/SearchHelper.cs +++ b/NadekoBot/Classes/SearchHelper.cs @@ -208,9 +208,9 @@ namespace NadekoBot.Classes { } public static async Task ShortenUrl(string url) { - if (NadekoBot.GoogleAPIKey == null || NadekoBot.GoogleAPIKey == "") return url; + if (NadekoBot.creds.GoogleAPIKey == null || NadekoBot.creds.GoogleAPIKey == "") return url; try { - var httpWebRequest = (HttpWebRequest)WebRequest.Create("https://www.googleapis.com/urlshortener/v1/url?key=" + NadekoBot.GoogleAPIKey); + var httpWebRequest = (HttpWebRequest)WebRequest.Create("https://www.googleapis.com/urlshortener/v1/url?key=" + NadekoBot.creds.GoogleAPIKey); httpWebRequest.ContentType = "application/json"; httpWebRequest.Method = "POST"; @@ -225,7 +225,7 @@ namespace NadekoBot.Classes { string MATCH_PATTERN = @"""id"": ?""(?.+)"""; return Regex.Match(responseText, MATCH_PATTERN).Groups["id"].Value; } - } catch (Exception ex) { Console.WriteLine(ex.ToString()); return ""; } + } catch (Exception ex) { Console.WriteLine(ex.ToString()); return url; } } } } diff --git a/NadekoBot/Modules/Administration.cs b/NadekoBot/Modules/Administration.cs index dfdce1c3..873f11a4 100644 --- a/NadekoBot/Modules/Administration.cs +++ b/NadekoBot/Modules/Administration.cs @@ -36,7 +36,8 @@ namespace NadekoBot.Modules { .Parameter("user_name", ParameterType.Required) .Parameter("role_name", ParameterType.Unparsed) .Do(async e => { - if (!e.User.ServerPermissions.ManageRoles) return; + if (!e.User.ServerPermissions.ManageRoles || + string.IsNullOrWhiteSpace(e.GetArg("role_name"))) return; var usr = e.Server.FindUsers(e.GetArg("user_name")).FirstOrDefault(); if (usr == null) { await e.Send("You failed to supply a valid username"); @@ -61,9 +62,10 @@ namespace NadekoBot.Modules { cgb.CreateCommand(".rr").Alias(".removerole") .Description("Removes a role from a given user.\n**Usage**: .rr @User Admin") .Parameter("user_name", ParameterType.Required) - .Parameter("role_name", ParameterType.Required) + .Parameter("role_name", ParameterType.Unparsed) .Do(async e => { - if (!e.User.ServerPermissions.ManageRoles) return; + if (!e.User.ServerPermissions.ManageRoles || + string.IsNullOrWhiteSpace("role_name")) return; var usr = e.Server.FindUsers(e.GetArg("user_name")).FirstOrDefault(); if (usr == null) {