From 9e158b53b0de7cdbae9b12459e87601cfb7769ac Mon Sep 17 00:00:00 2001 From: Kwoth Date: Sun, 21 Aug 2016 00:47:39 +0200 Subject: [PATCH] Now properly loading youtubeapikey from credentials --- src/NadekoBot/Modules/Searches/Searches.cs | 3 +-- src/NadekoBot/NadekoBot.cs | 2 +- src/NadekoBot/Services/Impl/BotCredentials.cs | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/NadekoBot/Modules/Searches/Searches.cs b/src/NadekoBot/Modules/Searches/Searches.cs index ed3d1015..76d4bdb8 100644 --- a/src/NadekoBot/Modules/Searches/Searches.cs +++ b/src/NadekoBot/Modules/Searches/Searches.cs @@ -60,8 +60,7 @@ $@"🌍 **Weather for** 【{obj["target"]}】 await channel.SendMessageAsync("No results found for that query."); return; } - var shortUrl = await result.ShortenUrl().ConfigureAwait(false); - await channel.SendMessageAsync(shortUrl).ConfigureAwait(false); + await channel.SendMessageAsync(result).ConfigureAwait(false); } [LocalizedCommand, LocalizedDescription, LocalizedSummary] diff --git a/src/NadekoBot/NadekoBot.cs b/src/NadekoBot/NadekoBot.cs index 9131238e..f5719829 100644 --- a/src/NadekoBot/NadekoBot.cs +++ b/src/NadekoBot/NadekoBot.cs @@ -101,7 +101,7 @@ namespace NadekoBot } else if (!t.IsSuccess && t.Error != CommandError.UnknownCommand) { - _log.Warn("Command errored!\n\tFull Message: {0}\n\tError:{1}", imsg.Content, t.Error); + _log.Warn("Command errored!\n\tFull Message: {0}\n\tError:{1}", imsg.Content, t.ErrorReason); } }); diff --git a/src/NadekoBot/Services/Impl/BotCredentials.cs b/src/NadekoBot/Services/Impl/BotCredentials.cs index 2f4b5f6a..081c0555 100644 --- a/src/NadekoBot/Services/Impl/BotCredentials.cs +++ b/src/NadekoBot/Services/Impl/BotCredentials.cs @@ -34,6 +34,7 @@ namespace NadekoBot.Services.Impl Token = cm.Token; OwnerIds = cm.OwnerIds; LoLApiKey = cm.LoLApiKey; + GoogleApiKey = cm.GoogleApiKey; } else _log.Fatal("credentials.json is missing. Failed to start."); @@ -43,6 +44,7 @@ namespace NadekoBot.Services.Impl public string Token { get; set; } public ulong[] OwnerIds { get; set; } public string LoLApiKey { get; set; } + public string GoogleApiKey { get; set; } } public bool IsOwner(IUser u) => OwnerIds.Contains(u.Id);