From 5f4af886271ab0ea5c9054d2347758d8d3c89700 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Fri, 19 Aug 2016 01:28:26 +0200 Subject: [PATCH] Fixed some stuff, updated discord.net --- .gitignore | 1 + discord.net | 2 +- src/NadekoBot/NadekoBot.cs | 2 +- src/NadekoBot/NuGet.Config | 6 +++++ src/NadekoBot/Services/Impl/BotCredentials.cs | 25 +++++++++++-------- src/NadekoBot/project.json | 3 +++ 6 files changed, 27 insertions(+), 12 deletions(-) create mode 100644 src/NadekoBot/NuGet.Config diff --git a/.gitignore b/.gitignore index 333fcdc5..862b63d6 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ obj/ *.userprefs **/src/NadekoBot/bin Tests/bin +src/NadekoBot/credentials.json # NuGet Packages *.nupkg diff --git a/discord.net b/discord.net index a76956c8..f531c634 160000 --- a/discord.net +++ b/discord.net @@ -1 +1 @@ -Subproject commit a76956c8ef516b3d5399fedc30b321043c86f112 +Subproject commit f531c634996960c64ddfe602a7b6eef63677d30c diff --git a/src/NadekoBot/NadekoBot.cs b/src/NadekoBot/NadekoBot.cs index c40ef836..42b0c927 100644 --- a/src/NadekoBot/NadekoBot.cs +++ b/src/NadekoBot/NadekoBot.cs @@ -57,7 +57,7 @@ namespace NadekoBot depMap.Add(Youtube); //connect - await Client.LoginAsync(TokenType.Bot, "MTE5Nzc3MDIxMzE5NTc3NjEw.CpdrFA.0rex01uCrn9dBTJOV2tXwMLo0wE"); + await Client.LoginAsync(TokenType.Bot, Credentials.Token); await Client.ConnectAsync(); _log.Info("Connected"); diff --git a/src/NadekoBot/NuGet.Config b/src/NadekoBot/NuGet.Config new file mode 100644 index 00000000..5d8e9c81 --- /dev/null +++ b/src/NadekoBot/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/NadekoBot/Services/Impl/BotCredentials.cs b/src/NadekoBot/Services/Impl/BotCredentials.cs index 09ebac3b..183e1e31 100644 --- a/src/NadekoBot/Services/Impl/BotCredentials.cs +++ b/src/NadekoBot/Services/Impl/BotCredentials.cs @@ -1,5 +1,7 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; +using System.IO; namespace NadekoBot.Services.Impl { @@ -8,18 +10,21 @@ namespace NadekoBot.Services.Impl { public string ClientId { get; } - public string GoogleApiKey { - get { - return ""; - } - } + public string GoogleApiKey { get; } public IEnumerable MashapeKey { get; } - public string Token { - get { - return ""; - } + public string Token { get; } + + + public BotCredentials() + { + var cm = JsonConvert.DeserializeObject(File.ReadAllText("./credentials.json")); + Token = cm.Token; + } + + private class CredentialsModel { + public string Token { get; set; } } } } diff --git a/src/NadekoBot/project.json b/src/NadekoBot/project.json index a4a1d026..e72bf3c9 100644 --- a/src/NadekoBot/project.json +++ b/src/NadekoBot/project.json @@ -1,5 +1,8 @@ { "version": "1.0.0-*", + "description": "General purposee Discord bot written in C#.", + "authors": [ "Kwoth" ], + "copyright": "Kwoth", "buildOptions": { "emitEntryPoint": true, "compile": {