示例#1
0
 private static async Task <bool> TestThingsDisguisedAsync(long userbotId)
 {
     var done = true;
     var bot  = GlobalVariables.Bots[userbotId];
     var replyMarkupObject = new ReplyMarkupObject(ReplyMarkupEnum.REMOVE);
     var text = new Language(new Dictionary <string, string>
     {
         { "en", "ciao test" },
         { "it", "ciao test" }
     });
     await bot.SendTextMessageAsync(5651789, text, ChatType.Private,
                                    "", default, replyMarkupObject, "@ArmeF97");
示例#2
0
 internal void AddWorkCompleted(long idUser, long botId, bool sendMessageConfirmationChoice,
                                TelegramBotAbstract telegramBotAbstract, string lang, string username)
 {
     d[idUser][botId].Item1.WorkCompleted += async result =>
     {
         var crashed = true;
         try
         {
             if (d[idUser][botId].Item1.GetState() == AnswerTelegram.State.ANSWERED &&
                 d[idUser][botId].Item1.GetAlreadyProcessedAnswer() == false)
             {
                 if (sendMessageConfirmationChoice)
                 {
                     var replyMarkup   = new ReplyMarkupObject(ReplyMarkupEnum.REMOVE);
                     var languageReply = new Language(new Dictionary <string, string>
                     {
                         { "en", "You chose [" + result + "]" },
                         { "it", "Hai scelto [" + result + "]" }
                     });
                     await telegramBotAbstract.SendTextMessageAsync(idUser,
                                                                    languageReply,
                                                                    ChatType.Private, lang, default, replyMarkup, username);