small improvements
This commit is contained in:
parent
6dcc8dfc01
commit
c08498af54
@ -11,7 +11,7 @@ namespace NadekoBot
|
||||
{
|
||||
public class NadekoStats
|
||||
{
|
||||
public string BotVersion = "0.8-beta13";
|
||||
public string BotVersion = "NadekoBot 0.8-beta13";
|
||||
|
||||
private static readonly NadekoStats _instance = new NadekoStats();
|
||||
public static NadekoStats Instance => _instance;
|
||||
@ -49,7 +49,7 @@ namespace NadekoBot
|
||||
|
||||
public void LoadStats() {
|
||||
var sb = new System.Text.StringBuilder();
|
||||
sb.AppendLine("`Author: Kwoth`");
|
||||
sb.AppendLine("`Author: Kwoth` `Library: Discord.Net`");
|
||||
//$"\nDiscord.Net version: {DiscordConfig.LibVersion}" +
|
||||
//$"\nRuntime: {_client.GetRuntime()}" +
|
||||
sb.AppendLine($"`Bot Version: {BotVersion}`");
|
||||
|
@ -667,13 +667,16 @@ namespace NadekoBot.Modules {
|
||||
}
|
||||
|
||||
public void SaveParseToDb<T>(string where) where T : IDataModel {
|
||||
var data = File.ReadAllText(where);
|
||||
var arr = JObject.Parse(data)["results"] as JArray;
|
||||
var objects = new List<T>();
|
||||
foreach (JObject obj in arr) {
|
||||
objects.Add(obj.ToObject<T>());
|
||||
try {
|
||||
var data = File.ReadAllText(where);
|
||||
var arr = JObject.Parse(data)["results"] as JArray;
|
||||
var objects = new List<T>();
|
||||
foreach (JObject obj in arr) {
|
||||
objects.Add(obj.ToObject<T>());
|
||||
}
|
||||
Classes.DBHandler.Instance.InsertMany(objects);
|
||||
}
|
||||
Classes.DBHandler.Instance.InsertMany(objects);
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user