static void Main() { botClient = new TelegramBotClient(""); data = new DataRepo(""); keyboards = new Keyboards(data, data.GetCurrentEvents()); Console.WriteLine("Starting..."); var me = botClient.GetMeAsync().Result; Console.WriteLine( $"Hello, World! I am user {me.Id} and my name is {me.FirstName}." ); botClient.OnMessage += Bot_OnMessage; botClient.OnCallbackQuery += BotClient_OnCallbackQuery; botClient.StartReceiving(); Console.WriteLine("Press any key to exit"); //Console.ReadKey(); while (true) { } botClient.StopReceiving(); }
private void SetButtons(DataRepo data) { Egg[] eggs2 = data.GetEggs(CURRENT_EVENT[1], 2); eggbuttons2 = SetEggKeyboard(eggs2); Egg[] eggs5 = data.GetEggs(CURRENT_EVENT[2], 5); eggbuttons5 = SetEggKeyboard(eggs5); Egg[] eggs7 = data.GetEggs(CURRENT_EVENT[3], 7); eggbuttons7 = SetEggKeyboard(eggs7); Egg[] eggs10 = data.GetEggs(CURRENT_EVENT[4], 10); eggbuttons10 = SetEggKeyboard(eggs10); Raid[] raids1 = data.GetRaids(CURRENT_EVENT[0], 1); raidbuttons1 = SetRaidKeyboard(raids1); Raid[] raids2 = data.GetRaids(CURRENT_EVENT[0], 2); raidbuttons2 = SetRaidKeyboard(raids2); Raid[] raids3 = data.GetRaids(CURRENT_EVENT[0], 3); raidbuttons3 = SetRaidKeyboard(raids3); Raid[] raids4 = data.GetRaids(CURRENT_EVENT[0], 4); raidbuttons4 = SetRaidKeyboard(raids4); Raid[] raids5 = data.GetRaids(CURRENT_EVENT[0], 5); raidbuttons5 = SetRaidKeyboard(raids5); }
public Keyboards(DataRepo data, string[] currentEvent) { CURRENT_EVENT = currentEvent; optionbuttons = new InlineKeyboardButton[][] { new InlineKeyboardButton[] { InlineKeyboardButton.WithCallbackData("Stats", "stats") }, new InlineKeyboardButton[] { InlineKeyboardButton.WithCallbackData("Enter Eggs", "eggs menu 0") }, new InlineKeyboardButton[] { InlineKeyboardButton.WithCallbackData("Enter Raids", "raid menu 0") } }; eggmenu = new InlineKeyboardButton[][] { new InlineKeyboardButton[] { InlineKeyboardButton.WithCallbackData("2km", "eggs menu 2"), InlineKeyboardButton.WithCallbackData("5km", "eggs menu 5"), InlineKeyboardButton.WithCallbackData("7km", "eggs menu 7"), InlineKeyboardButton.WithCallbackData("10km", "eggs menu 10") }, }; eggconfirmmenu = new InlineKeyboardButton[][] { new InlineKeyboardButton[] { InlineKeyboardButton.WithCallbackData("Cancel", "eggs confirm cancel"), InlineKeyboardButton.WithCallbackData("Done", "eggs confirm yes"), }, }; raidconfirmmenu = new InlineKeyboardButton[][] { new InlineKeyboardButton[] { InlineKeyboardButton.WithCallbackData("No", "raid confirm 0"), InlineKeyboardButton.WithCallbackData("Yes!", "raid confirm 1"), }, }; raidmenu = new InlineKeyboardButton[][] { new InlineKeyboardButton[] { InlineKeyboardButton.WithCallbackData("1*", "raid menu 1"), InlineKeyboardButton.WithCallbackData("2*", "raid menu 2"), InlineKeyboardButton.WithCallbackData("3*", "raid menu 3"), InlineKeyboardButton.WithCallbackData("4*", "raid menu 4"), InlineKeyboardButton.WithCallbackData("5*", "raid menu 5") }, }; SetButtons(data); }