Skip to content

Commit

Permalink
Changed version number; cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
chamik committed Feb 4, 2021
1 parent a6bfc1b commit 8de9362
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion thorn/Config/pairs.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"INFO": "**Verze:** 2.0\n**Repozitář:** https://github.com/scp-cs/Thorn",
"INFO": "**Verze:** 2.1\n**Repozitář:** https://github.com/scp-cs/Thorn",

"WELCOME_CHANNEL_ID": "666672988883779585",
"NEWS_CHANNEL_ID": "537063810121334784",
Expand Down
6 changes: 2 additions & 4 deletions thorn/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,11 @@ private static async Task Main()
collection.AddSingleton<DataStorageService>();
collection.AddSingleton<UserAccountsService>();

// Quartz
collection.AddSingleton<IJobFactory, SingletonJobFactory>();
collection.AddSingleton<ISchedulerFactory, StdSchedulerFactory>();

collection.AddSingleton<ReminderJob>();
collection.AddSingleton(new JobSchedule(
typeof(ReminderJob),
"0 0 0 * * ?")); // Every day at midnight
collection.AddSingleton(new JobSchedule(typeof(ReminderJob), "0 0 0 * * ?")); // Every day at midnight
});

await hostBuilder.RunConsoleAsync();
Expand Down
2 changes: 1 addition & 1 deletion thorn/Reminder/ReminderJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public ReminderJob(ILogger<ReminderJob> logger, DiscordSocketClient client, Pair
_pairs = pairs;

_channel = client.GetChannel(ulong.Parse(pairs.GetString("GENERAL_CHANNEL_ID"))) as SocketTextChannel;
_daily = DataStorageService.GetDictionary<string>("Config/daily.json");
_daily = data.GetDictionary<string>("Config/daily.json");
}

public async Task Execute(IJobExecutionContext context)
Expand Down
2 changes: 1 addition & 1 deletion thorn/Services/DataStorageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public Task SaveAllUserAccounts(IEnumerable<UserAccount> accounts, string filePa
return Task.CompletedTask;
}

public static Dictionary<string, T> GetDictionary<T>(string path) =>
public Dictionary<string, T> GetDictionary<T>(string path) =>
JsonConvert.DeserializeObject<Dictionary<string, T>>(File.ReadAllText(path));

public static List<UserAccount> LoadUserAccounts(string filePath)
Expand Down

0 comments on commit 8de9362

Please sign in to comment.