Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit a8be242

Browse files
committed
Create template for master branch
1 parent 8e1282c commit a8be242

File tree

5 files changed

+49
-0
lines changed

5 files changed

+49
-0
lines changed

Diff for: .gitignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Don't track content of these folders
2+
.idea/*
3+
cmake-build-debug/*
4+
5+
# Compiled source #
6+
###################
7+
8+
# Packages #
9+
############
10+
# it's better to unpack these files and commit the raw source
11+
# git has its own built in compression methods
12+
#*.7z
13+
#*.dmg

Diff for: .gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "thirdparty/DisCPP"]
2+
path = thirdparty/DisCPP
3+
url = https://github.com/DisCPP/DisCPP.git

Diff for: CMakeLists.txt

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
cmake_minimum_required (VERSION 3.6)
2+
3+
project ("DisC++ CMake Bot Template")
4+
5+
add_subdirectory(thirdparty/DisCPP)
6+
7+
add_executable (main "src/main.cpp")
8+
9+
set_target_properties(main PROPERTIES CXX_STANDARD 17 CXX_EXTENSIONS OFF)
10+
target_include_directories(main PUBLIC include)
11+
12+
file(GLOB_RECURSE source_list src/*.cpp)
13+
target_sources(main PRIVATE ${source_list})
14+
15+
target_link_libraries(main PRIVATE discpp)

Diff for: src/main.cpp

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <discpp/client.h>
2+
#include <discpp/context.h>
3+
#include <discpp/command_handler.h>
4+
#include <discpp/client_config.h>
5+
6+
int main(int argc, const char* argv[]) {
7+
auto* config = new discpp::ClientConfig({"!"});
8+
discpp::Client bot{ "TOKEN_HERE", config }; // Token, config
9+
10+
// I would recommend creating a class for the commands, you can check that in the examples folder
11+
// But, you can still register a command like you did before
12+
discpp::Command ping_command("ping", "Quick example of a command", {}, [](discpp::Context ctx) {
13+
ctx.Send("pong!");
14+
}, {});
15+
16+
return bot.Run();
17+
}

Diff for: thirdparty/DisCPP

Submodule DisCPP added at 2160e2e

0 commit comments

Comments
 (0)