Add a Plugin
For a list of plugins check out #📃plugin-list on the Discord++ Discord server
Add It to Your Project
- Download the Source
git submodule add <repository> [<path>]
is a nice way to havegit
still track the remote repositiories- After adding the submodules you want, use
git submodule update --init --recursive
to initialize them.
- After adding the submodules you want, use
- You could also download the plugin as
- Place them all in a subdirectory of your project. (I use
lib/
)
Add It to CMake
- Add
ADD_SUBDIRECTORY(<relative path>)
for Discord++ and each module, e.g.
cmake
add_subdirectory(lib/plugin-name)
- Add the plugin's equivalent of
discordpp-plugin-name
and each module to yourTARGET_LINK_LIBRARIES
command, e.g.
cmake
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ... discordpp-plugin-name)
Add It to Your Code
- Include the header file for the plugin, e.g.
cpp
#include <discordpp/plugin-name.hh>
- Add it to your bot object, e.g.
cpp
using DppBot = discordpp::PluginName<...discordpp::Bot...>;
If you're working from Echo or Build-A-Bot as a template you'll need to do this twice in include.hh
and once in extern.cc