Added MyTitles page passing
This commit is contained in:
parent
45ce5da0ac
commit
45a1df4cbb
8 changed files with 110 additions and 1 deletions
|
|
@ -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);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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Чего будем делать?";
|
||||
|
|
|
|||
13
modules/bot/front/include/handlers.hpp
Normal file
13
modules/bot/front/include/handlers.hpp
Normal 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);
|
||||
};
|
||||
8
modules/bot/front/include/structs.hpp
Normal file
8
modules/bot/front/include/structs.hpp
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
struct Title {
|
||||
int64_t id;
|
||||
std::string name;
|
||||
std::string description;
|
||||
int64_t num;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue