void OnInitialize(EventArgs e) { IRCCommands.Initialize(); Commands.ChatCommands.Add(new Command("tshockirc.manage", IRCReload, "ircreload")); Commands.ChatCommands.Add(new Command("tshockirc.manage", IRCRestart, "ircrestart")); string configPath = Path.Combine(TShock.SavePath, "tshockircconfig.json"); (Config = Config.Read(configPath)).Write(configPath); Connect(); }
void IRCReload(CommandArgs e) { string configPath = Path.Combine(TShock.SavePath, "tshockircconfig.json"); (Config = Config.Read(configPath)).Write(configPath); e.Player.SendSuccessMessage("Reloaded IRC config!"); }