C++ library for Discord
Note: Sleepy Discord is pronounced as CP Discord, like the letters C and P. Actually, that's a joke. Sleepy should be pronounced the way you would normally pronounce sleepy.
📝 Getting Started
📝 How to make a Basic Text Bot
If you like to edit them, please check out the docs branch or click on the 📝.
OS | Windows | Ubuntu |
---|---|---|
Master | ||
Develop |
Just for the novelty of using a C++ library for Discord. I would also love for this thing to work on many things like consoles and maybe some microcontrollers.
#include "sleepy_discord/websocketpp_websocket.h"
class MyClientClass : public SleepyDiscord::DiscordClient {
public:
using SleepyDiscord::DiscordClient::DiscordClient;
void onMessage(SleepyDiscord::Message message) override {
if (message.startsWith("whcg hello"))
sendMessage(message.channelID, "Hello " + message.author.username);
}
};
int main() {
MyClientClass client("token", 2);
client.run();
}
Input: Message received
whcg hello
Possible Output: Message sent
Hello Sleepy Flower Girl
More complex examples:
- Rock Paper Scissors
- Unofficial Discord 3DS Client
- WebAssembly Client (Work In Progress)
Yes, and for now I don't plan on making 0.0 versions backwards compatible with 1.0 versions or later.
Sleepy Discord doesn't require you to use any libraries, so that you can use any library you wish or your own code. However, Sleepy Discord provides native support for a few libraries and it is recommend you use those instead of writing your own.
For the cutting edge of Sleepy Discord, check out the develop branch. Please use the develop branch with caution because it may not even be able to compile or it is 100% not tested at all. Other then that, the branch is used for code that may not work. Also check to see if it's not behind the master branch, unless you want to use an older version of Sleepy Discord.