Started creating structure of bot interface
This commit is contained in:
parent
879a7981cd
commit
602e9b62d8
8 changed files with 122 additions and 0 deletions
7
modules/bot/front/include/KeyboardFactory.hpp
Normal file
7
modules/bot/front/include/KeyboardFactory.hpp
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#include <tgbot/tgbot.h>
|
||||
|
||||
class KeyboardFactory {
|
||||
public:
|
||||
/// Create keyboard for main menu
|
||||
static TgBot::InlineKeyboardMarkup::Ptr createMainMenu();
|
||||
};
|
||||
14
modules/bot/front/include/constants.hpp
Normal file
14
modules/bot/front/include/constants.hpp
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace BotConstants {
|
||||
namespace Button {
|
||||
const std::string FIND_ANIME = "Найти аниме";
|
||||
const std::string MY_TITLES = "Мои тайтлы";
|
||||
}
|
||||
namespace Callback {
|
||||
const std::string FIND_ANIME = "action:find_anime";
|
||||
const std::string MY_TITLES = "navigation:my_titles";
|
||||
}
|
||||
}
|
||||
26
modules/bot/front/include/front.hpp
Normal file
26
modules/bot/front/include/front.hpp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#include <csignal>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <exception>
|
||||
#include <string>
|
||||
|
||||
#include <tgbot/tgbot.h>
|
||||
|
||||
class AnimeBot {
|
||||
private:
|
||||
std::string token;
|
||||
TgBot::Bot bot;
|
||||
|
||||
public:
|
||||
/// Init Bot
|
||||
AnimeBot(const std::string& token);
|
||||
|
||||
/// Main menu
|
||||
void setupHandlers();
|
||||
|
||||
/// Get TgBot::Bot
|
||||
TgBot::Bot& getBot();
|
||||
|
||||
/// Function creates main menu and sends it to user with chatId
|
||||
void sendMainMenu(int64_t chatId);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue