Exemplo n.º 1
0
        public async Task <RuntimeResult> Calculate([Remainder] string input)
        {
            Result result;
            var    calc = new CalculationTree(input);

            try
            {
                result = calc.Calculate();
            } catch (Exception ex)
            {
                return(new BotResult($"Failed: {ex.Message}\r\n```\n{string.Join("\n", calc.CalcLog)}\n```"));
            }
            await ReplyAsync($"Answer: **{result}**\r\n```\n{string.Join("\n", calc.CalcLog)}\n```");

            return(new BotResult());
        }
Exemplo n.º 2
0
 public void Initialize()
 {
     tree = new CalculationTree();
 }