コード例 #1
0
        public static void GetPips(this ITelegram ctx, string msg, DoubleResponse callback, TimeSpan expiration)
        {
            var commands = new List <string>()
            {
                "5", "10", "15", "20", "30", "40", "50"
            };

            ctx.GetChoice(msg,
                          commands, (string s) =>
            {
                double outVal = 0;
                if (double.TryParse(s, out outVal))
                {
                    callback(outVal);
                }
                else
                {
                    callback(double.NaN);
                }
            }, expiration);
        }