public static void Save(Config parameters, MarkovChainString markovChain, Action <string> output) { output?.Invoke($"Saving '{parameters.Save}'"); var saveBehaviour = new SaveBehaviour(markovChain, parameters.Save); saveBehaviour.Process(); output?.Invoke($"Saved to '{parameters.Save}'"); }
private void SaveCallback(IrcMessageEventArgs message) { var brainFile = GetBrainFile(message); var saver = new SaveBehaviour(_markovChainString, brainFile); saver.Process(); var reply = message.CreateReply($"Saved brain '{brainFile}'"); Bot.SendMessage(reply); }