/// <summary> /// Initialize everything that needs to be initialized once we're logged in. /// </summary> /// <param name="login">The status of the login</param> /// <param name="message">Error message on failure, MOTD on success.</param> public void RegisterCommand(string name, Cogbot.Actions.Command live) { string orginalName = name; name = name.Replace(" ", "").ToLower(); while (name.EndsWith(".")) { name = name.Substring(0, name.Length - 1); } Monitor.Enter(Commands); live.TheBotClient = this; CommandInstance prev; if (!Commands.TryGetValue(name, out prev)) { CommandInstance command = new CommandInstance(live); Commands.Add(name, command); command.Name = orginalName; if (command.IsStateFul) { live.TheBotClient = this; command.WithBotClient = live; } } else { if (prev.CmdType != live.GetType()) { RegisterCommand("!" + orginalName, live); } } Monitor.Exit(Commands); }