Added MyTitles page passing

This commit is contained in:
Kirill 2025-11-25 19:45:44 +03:00
parent 45ce5da0ac
commit 45a1df4cbb
8 changed files with 110 additions and 1 deletions

View file

@ -1,7 +1,11 @@
#include <tgbot/tgbot.h>
#include "structs.hpp"
class KeyboardFactory {
public:
/// Create keyboard for main menu
static TgBot::InlineKeyboardMarkup::Ptr createMainMenu();
/// Create keyboard for My_Titles
static TgBot::InlineKeyboardMarkup::Ptr createMyTitles(std::vector<Title> titles);
};

View file

@ -6,10 +6,14 @@ namespace BotConstants {
namespace Button {
const std::string FIND_ANIME = "Найти аниме";
const std::string MY_TITLES = "Мои тайтлы";
const std::string PREV = "<<Назад";
const std::string NEXT = "Следующий>>";
}
namespace Callback {
const std::string FIND_ANIME = "action:find_anime";
const std::string MY_TITLES = "navigation:my_titles";
const std::string LIST_PREV = "";
const std::string LIST_NEXT = "";
}
namespace Text {
const std::string MAIN_MENU = "Вас приветствует nyanimedb бот:)\nЧего будем делать?";

View file

@ -0,0 +1,13 @@
#include <tgbot/tgbot.h>
#include <string>
#include <structs.hpp>
struct HandlerResult {
std::string message;
TgBot::InlineKeyboardMarkup::Ptr keyboard;
};
class BotHandlers {
public:
static HandlerResult MyTitles(int64_t userId);
};

View file

@ -0,0 +1,8 @@
#pragma once
struct Title {
int64_t id;
std::string name;
std::string description;
int64_t num;
};