Пример #1
0
 public async void SendMessageAsync(string message, ReplyKeyboardMarkup markup = null)
 {
     if (!string.IsNullOrEmpty(message) && !string.IsNullOrEmpty(this._chatID))
     {
         var obj = new
         {
             chat_id      = this._chatID,
             text         = message,
             reply_markup = markup != null?markup.ToJson() : ""
         };
         await RequestAsync("sendMessage", obj);
     }
 }
Пример #2
0
        /// <summary>
        /// Dizi ve film(ler) için kulanılacak.
        /// </summary>
        /// <returns></returns>
        private ReplyKeyboardMarkup KeyboardButtons()
        {
            var rmu = new ReplyKeyboardMarkup();

            rmu.Keyboard =
                new KeyboardButton[][]
            {
                new KeyboardButton[]
                {
                    new KeyboardButton()
                    {
                        Text = "The Best", CallbackData = TmdbApiUrl.Section.TheBest
                    },
                    new KeyboardButton()
                    {
                        Text = "Trending", CallbackData = TmdbApiUrl.Section.Trending
                    },
                    new KeyboardButton()
                    {
                        Text = "TopRated", CallbackData = TmdbApiUrl.Section.TopRated
                    },
                    new KeyboardButton()
                    {
                        Text = "Upcoming", CallbackData = TmdbApiUrl.Section.Upcoming
                    }
                },
                new KeyboardButton[]
                {
                    new KeyboardButton()
                    {
                        Text = "Action", CallbackData = TmdbApiUrl.Section.Action
                    },
                    new KeyboardButton()
                    {
                        Text = "Crime", CallbackData = TmdbApiUrl.Section.Crime
                    },
                    new KeyboardButton()
                    {
                        Text = "Comedy", CallbackData = TmdbApiUrl.Section.Comedy
                    },
                    new KeyboardButton()
                    {
                        Text = "History", CallbackData = TmdbApiUrl.Section.History
                    }
                },
                new KeyboardButton[]
                {
                    new KeyboardButton()
                    {
                        Text = "Horror", CallbackData = TmdbApiUrl.Section.Horror
                    },
                    new KeyboardButton()
                    {
                        Text = "Mystery", CallbackData = TmdbApiUrl.Section.Mystery
                    },
                    new KeyboardButton()
                    {
                        Text = "Romance", CallbackData = TmdbApiUrl.Section.Romance
                    },
                    new KeyboardButton()
                    {
                        Text = "Thriller", CallbackData = TmdbApiUrl.Section.Thriller
                    }
                }
            };

            return(rmu);
        }