void OnCommands(string text, Color color) { if (text[0] == kCommandPrefix) { Command.Base command; string[] args = text.Trim().Remove(0, 1).Split(' '); if (commands.TryGetValue(args[0], out command) != false) { var context = new Command.Context(this, text, args); try { command.Invoke(context); } catch (System.Exception e) { context.Output(e.ToString()); } Append(context.output, color); } else { Append("コマンドが見つかりません", color); } } }