コード例 #1
0
        public static QueryHandler Parse(this CallbackQuery query, TelegramBotClient owner)
        {
            QueryHandler result;
            var          queryData = RequestData.Parse(query.Data);

            if (queryData.IsParseError)
            {
                return(new NotValidDataMessage(query, owner));
            }

            if (nucleoData.ContainsKey(queryData.Action))
            {
                result = QueryHandler.InitializeMessage(nucleoData[queryData.Action], query, owner);
            }
            else
            {
                result = new MissingInfoForBuildMessage(queryData.Action, query, owner);
            }

            result.Data = queryData;
            return(result);
        }