Skip to content

Yuhanun/DPP

Repository files navigation

DPP

A C++ Library interfacing Discord API, or should i say... C++ Discord API Wrapper.

Dependencies

Installation

  • vcpkg install nlohmann-json

  • vcpkg install cpprestsdk

  • vcpkg install boost

  • git clone https://www.github.com/yuhanun/DPP

  • cd DPP

  • mkdir build && cd build

  • vcpkg integrate install

  • cmake .. -DCMAKE_TOOLCHAIN_FILE=/use/what/integrate/install/gives

  • make

Example

#include "attachment.hpp"
#include "bot.hpp"
#include "context.hpp"
#include "embedbuilder.hpp"
#include "events.hpp"
#include "member.hpp"
#include "role.hpp"
#include "user.hpp"
#include "utils.hpp"
#include "emoji.hpp"
#include "message.hpp"

int main() {
    discord::Bot bot{ "tokenhere", ">" };

    bot.register_callback<discord::events::ready>([&bot]() {
        std::cout << "Ready!" << std::endl
                  << "Logged in as: " << bot.username << "#" << bot.discriminator
                  << std::endl
                  << "ID: " << bot.id << std::endl
                  << "-----------------------------" << std::endl;
    });

    bot.register_command("ping", "Ping?", {}, [](discord::Context ctx) {
        ctx.channel->send("pong!")
            .wait();
    }, {});

    return bot.run();
}

License

See LICENSE

About

A C++ Discord API wrapper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages