Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Commit

Permalink
added about project command & text
Browse files Browse the repository at this point in the history
  • Loading branch information
b1tflyyyy committed Apr 24, 2024
1 parent f9a4b72 commit 59e503b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions source/view/handlers/message_handler/message_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ void AMessage_Handler::Bind_Commands()
{
TG_Bot.getApi().sendMessage(message->chat->id, AMessage_Reply::Get_Help_Msg());
});
TG_Bot.getEvents().onCommand(SMessage_Commands::About_Project.data(), [this](TgBot::Message::Ptr message) -> void
{
TG_Bot.getApi().sendMessage(message->chat->id, AMessage_Reply::Get_Info_About_Project());
});
}

// ---------------------------------------------------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion source/view/texts/message_commands/message_commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ constinit std::string_view SMessage_Commands::Profile{ "profile" };
constinit std::string_view SMessage_Commands::Programmer_Game{ "pr_game" };
constinit std::string_view SMessage_Commands::Math_Game{ "math_game" };
constinit std::string_view SMessage_Commands::Answer{ "answer" };
constinit std::string_view SMessage_Commands::Help{ "help" };
constinit std::string_view SMessage_Commands::Help{ "help" };
constinit std::string_view SMessage_Commands::About_Project{ "about_project" };
1 change: 1 addition & 0 deletions source/view/texts/message_commands/message_commands.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ struct SMessage_Commands
constinit static std::string_view Math_Game;
constinit static std::string_view Answer;
constinit static std::string_view Help;
constinit static std::string_view About_Project;
};
8 changes: 7 additions & 1 deletion source/view/texts/message_reply/message_reply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,11 @@ std::string AMessage_Reply::Get_Incorrect_Answer_Msg(std::int64_t score, std::st
// ---------------------------------------------------------------------------------------------------------------------
std::string AMessage_Reply::Get_Help_Msg()
{
return std::format("Привіт Арбуз, це блок з поясненням деяких ігрових механік {}\n\n1) Як відповідати на задачі ?\nВсе дуже просто пишеш команду /answer і через пробіл відповідь, наприклад: /answer 25\n\n2) Як вирішити гру pr_game, погугли про оператори &(AND) |(OR)\n\nЯкщо в тебе виникли проблеми, пиши власнику бота: https://t.me/hellowolrd36", DETAIL);
return std::format("Привіт Арбуз, це блок з поясненням деяких ігрових механік {}\n\n1) Як відповідати на задачі ?\nВсе дуже просто пишеш команду /answer і через пробіл відповідь, наприклад: /answer 25\n\n2) Як вирішити гру pr_game, погугли про оператори &(AND) |(OR)\n\nЯкщо в тебе виникли проблеми, пиши власнику бота: @hellowolrd36", DETAIL);
}

// ---------------------------------------------------------------------------------------------------------------------
std::string AMessage_Reply::Get_Info_About_Project()
{
return std::format("Інформація про цей проект{}\n\nЦе Open-Source проект ліцензований під MIT ліцензією.\nПосилання на код проекту: https://github.com/The-B1T-Foundation/tg_arbuz-bot\nПровідний розробник проекту: https://github.com/b1tflyyyy\n\nСвої побажання щодо функціоналу надсилайте до @hellowolrd36 або на пошту [email protected]", BOOKS);
}
1 change: 1 addition & 0 deletions source/view/texts/message_reply/message_reply.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ class AMessage_Reply
static std::string Get_Correct_Answer_Msg(std::int64_t score);
static std::string Get_Incorrect_Answer_Msg(std::int64_t score, std::string_view correct_answer);
static std::string Get_Help_Msg();
static std::string Get_Info_About_Project();
};

0 comments on commit 59e503b

Please sign in to comment.