Skip to content

Commit

Permalink
Merge pull request #8 from brainboxdotcc/revert-7-main
Browse files Browse the repository at this point in the history
Revert "Fixed typos, removed unnecessary stuff to stay up-to-date"
  • Loading branch information
braindigitalis authored Oct 9, 2023
2 parents e2c9b45 + b894171 commit 702b9cb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CMake template for a simple [D++](https://dpp.dev) bot. This template assumes th
cmake ..
make -j

If DPP is installed in a different location, you can specify the root directory to look in while running cmake
If DPP is installed in a different location you can specify the root directory to look in while running cmake

cmake .. -DDPP_ROOT_DIR=<your-path>

Expand Down
1 change: 1 addition & 0 deletions include/templatebot/templatebot.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <dpp/dpp.h>
#include <dpp/nlohmann/json.hpp>

// Place any forward declarations here
8 changes: 5 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
* https://discord.com/oauth2/authorize?client_id=940762342495518720&scope=bot+applications.commands&permissions=139586816064
*/

using json = nlohmann::json;

int main(int argc, char const *argv[])
{
dpp::json configdocument;
json configdocument;
std::ifstream configfile("../config.json");
configfile >> configdocument;

/* Set up the bot */
/* Setup the bot */
dpp::cluster bot(configdocument["token"]);

/* Output simple log messages to stdout */
Expand All @@ -27,7 +29,7 @@ int main(int argc, char const *argv[])

/* Register slash command here in on_ready */
bot.on_ready([&bot](const dpp::ready_t& event) {
/* Wrap command registration in run_once to make sure it doesn't run on every full reconnection */
/* Wrap command registration in run_once to make sure it doesnt run on every full reconnection */
if (dpp::run_once<struct register_bot_commands>()) {
bot.global_command_create(dpp::slashcommand("ping", "Ping pong!", bot.me.id));
}
Expand Down

0 comments on commit 702b9cb

Please sign in to comment.