mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-06 22:16:29 +03:00
general code refactor and bug fixes
This commit is contained in:
parent
4d838e5af3
commit
04facc3de2
15 changed files with 197 additions and 132 deletions
|
@ -21,9 +21,10 @@ public static class Boyfriend {
|
|||
}
|
||||
|
||||
private static async Task Init() {
|
||||
Client.Log += Log;
|
||||
var token = (await File.ReadAllTextAsync("token.txt")).Trim();
|
||||
|
||||
Client.Log += Log;
|
||||
|
||||
await Client.LoginAsync(TokenType.Bot, token);
|
||||
await Client.StartAsync();
|
||||
await Client.SetActivityAsync(new Game("Retrospecter - Expurgation", ActivityType.Listening));
|
||||
|
@ -35,6 +36,7 @@ public static class Boyfriend {
|
|||
|
||||
private static Task Log(LogMessage msg) {
|
||||
Console.WriteLine(msg.ToString());
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
|
@ -56,13 +58,16 @@ public static class Boyfriend {
|
|||
|
||||
public static void ResetGuildConfig(IGuild guild) {
|
||||
GuildConfigDictionary.Remove(guild.Id);
|
||||
|
||||
var config = new GuildConfig(guild.Id);
|
||||
config.Validate();
|
||||
|
||||
GuildConfigDictionary.Add(guild.Id, config);
|
||||
}
|
||||
|
||||
public static GuildConfig GetGuildConfig(IGuild guild) {
|
||||
Messages.Culture = new CultureInfo("ru");
|
||||
|
||||
var config = GuildConfigDictionary.ContainsKey(guild.Id) ? GuildConfigDictionary[guild.Id] :
|
||||
new GuildConfig(guild.Id);
|
||||
config.Validate();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue