File tree Expand file tree Collapse file tree 2 files changed +7
-14
lines changed
Expand file tree Collapse file tree 2 files changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -61,14 +61,7 @@ else()
6161
6262 FetchContent_GetProperties(libdpp)
6363 if (NOT libdpp_POPULATED)
64- FetchContent_Populate(libdpp)
65- target_include_directories (${BOT_NAME} PUBLIC
66- ${libdpp_SOURCE_DIR} /include
67- )
68- add_subdirectory (
69- ${libdpp_SOURCE_DIR}
70- ${libdpp_BINARY_DIR}
71- EXCLUDE_FROM_ALL )
64+ FetchContent_MakeAvailable(libdpp)
7265 endif ()
7366
7467 target_link_libraries (${BOT_NAME} dpp)
Original file line number Diff line number Diff line change 11#include < templatebot/templatebot.h>
2- #include < sstream>
32
43/* When you invite the bot, be sure to invite it with the
54 * scopes 'bot' and 'applications.commands', e.g.
87
98using json = nlohmann::json;
109
11- int main (int argc, char const *argv[])
12- {
10+ int main (int argc, char const *argv[]) {
1311 json configdocument;
1412 std::ifstream configfile (" ../config.json" );
1513 configfile >> configdocument;
1614
17- /* Setup the bot */
18- dpp::cluster bot (configdocument[" token" ]);
15+ const std::string BOT_TOKEN = configdocument[" token" ];
16+
17+ /* Set up the bot */
18+ dpp::cluster bot (BOT_TOKEN);
1919
2020 /* Output simple log messages to stdout */
2121 bot.on_log (dpp::utility::cout_logger ());
@@ -29,7 +29,7 @@ int main(int argc, char const *argv[])
2929
3030 /* Register slash command here in on_ready */
3131 bot.on_ready ([&bot](const dpp::ready_t & event) {
32- /* Wrap command registration in run_once to make sure it doesnt run on every full reconnection */
32+ /* Wrap command registration in run_once to make sure it doesn't run on every full reconnection */
3333 if (dpp::run_once<struct register_bot_commands >()) {
3434 bot.global_command_create (dpp::slashcommand (" ping" , " Ping pong!" , bot.me .id ));
3535 }
You can’t perform that action at this time.
0 commit comments