https://github.com/yourWaifu/sleepy-discord
C++ library for the Discord chat client.
https://github.com/yourWaifu/sleepy-discord
c-plus-plus cpp discord discord-library hacktoberfest library
Last synced: about 1 month ago
JSON representation
C++ library for the Discord chat client.
- Host: GitHub
- URL: https://github.com/yourWaifu/sleepy-discord
- Owner: yourWaifu
- License: mit
- Created: 2016-08-02T05:57:38.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-02-22T01:07:11.000Z (about 2 months ago)
- Last Synced: 2025-03-06T22:30:47.461Z (about 1 month ago)
- Topics: c-plus-plus, cpp, discord, discord-library, hacktoberfest, library
- Language: C++
- Homepage: https://yourWaifu.github.io/sleepy-discord/
- Size: 52.2 MB
- Stars: 704
- Watchers: 22
- Forks: 93
- Open Issues: 92
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
- discord-api-libs - sleepy-discord - C++ library for the Discord chat client. (Libraries / C++)
- awesome-discord - Sleepy Discord
README
# Sleepy Discord
C++ library for Discord[](https://discord.gg/5VDrVfK)
# [Documentation](https://yourwaifu.dev/sleepy-discord/docs/)
[Getting Started](https://yourwaifu.dev/sleepy-discord/docs/)If you like to edit them, [please check out the docs repo](https://github.com/yourWaifu/sleepy-discord-docs).
## Build Status
| Build | Windows MSVC | Ubuntu GCC | Ubuntu Clang | Docs |
| ------ | ------- | ------ | ----- | ---- |
| Master | [](https://dev.azure.com/wuhao64/sleepy-discord/_build/?definitionId=2) | [](https://travis-ci.org/yourWaifu/sleepy-discord) | [](https://github.com/yourWaifu/sleepy-discord/actions/workflows/ccpp.yml) | N/A |
| Develop | [](https://dev.azure.com/wuhao64/sleepy-discord/_build/latest?definitionId=2) | [](https://travis-ci.org/yourWaifu/sleepy-discord) | [](https://github.com/yourWaifu/sleepy-discord/actions/workflows/ccpp.yml) | [](https://github.com/yourWaifu/sleepy-discord/actions/workflows/documentation.yml)# Why?
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.# Example
```cpp
#include "sleepy_discord/sleepy_discord.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", SleepyDiscord::USER_CONTROLED_THREADS);
client.setIntents(SleepyDiscord::Intent::SERVER_MESSAGES);
client.run();
}
```
Input: Message received
```
whcg hello
```
Possible Output: Message sent
```
Hello Sleepy Flower Girl
```More complex examples:
- [Rock Paper Scissors](https://github.com/yourWaifu/sleepy-discord/blob/master/examples/rock-paper-scissors/main.cpp)
- [Unofficial Discord 3DS Client](https://github.com/yourWaifu/Unofficial-Discord-3DS-Client)
- [WebAssembly Client](https://github.com/yourWaifu/sleepy-discord/tree/master/examples/wasm_example) (Work In Progress)
# Will Updating the library break my bot?Yes, and for now I don't plan on making 0.0 versions backwards compatible with 1.0 versions or later.
# Requirements
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.* [OpenSSL](https://www.openssl.org/)
* [cpr](https://github.com/whoshuu/cpr)
* [ASIO](https://think-async.com/Asio/)# Develop Branch
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.