Compare commits

...

5 Commits

Author SHA1 Message Date
8e506ecd22 default 2025-01-20 15:07:30 +05:00
830f2129b4 cmake update 2025-01-20 15:07:18 +05:00
63d325e715 readme update 2025-01-20 15:03:03 +05:00
64a43c9358 cmake update 2025-01-20 15:02:08 +05:00
fd81f46315 readme update 2025-01-20 15:01:44 +05:00
3 changed files with 23 additions and 17 deletions

View File

@ -60,5 +60,4 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_FLAGS "-march=native -O2 -pipe")
#set(CMAKE_CXX_FLAGS "-O0 -pipe")
set(CMAKE_CXX_FLAGS "-march=native -O2 -pipe")

View File

@ -1,20 +1,27 @@
# Sparkle
Library for creating discord bots
# ToDo
- [x] Websocket support
- [x] Minimal discord api support
- [x] Selfbot support
- [x] Easy to use
- [ ] Support json extraction from server response
- [ ] Optimised for high loads
- [ ] Full api support
- [ ] Fixes for known bugs
- [ ] Windows support
- [ ] Sharding
# How to build
Library for creating Discord bots.
## How to Build
### Required Libraries
- `curl`
- `ixwebsocket`
### Build Instructions
```sh
git clone http://applejack.ygg/fluttershy/sparkle.git
mkdir sparkle/build && cd sparkle/build
cmake .. && make -j$(nproc)
./sparkle -t <BOT_TOKEN>
```
# ToDo
- [x] Websocket support
- [x] Minimal discord api support
- [x] Selfbot support
- [x] Easy to use
- [x] Support json extraction from server response
- [ ] Optimised for high loads (not tested)
- [ ] Full api support
- [ ] Fixes for known bugs
- [ ] Windows support
- [ ] Sharding

View File

@ -3,10 +3,10 @@
int main(int argc, char* argv[]) {
if (argc != 3) return -1;
WebSocket* bot = &WebSocket::getInstance(argv[2], GatewayIntents::AllIntents);
bot->on(GatewayEvents::READY, [](const Discord<Message, User>a) {
bot->on(GatewayEvents::READY, [](const Discord<Message, User>& a) {
cout << DiscordEndpoints::details::latest << endl;
});
bot->on(GatewayEvents::MESSAGE_CREATE, [](const Discord<Message, User, Author> msg) {
bot->on(GatewayEvents::MESSAGE_CREATE, [](const Discord<Message, User, Author>& msg) {
g(0, msg.net)->send("939957962972229634", j("content", g(2, msg.net)->content()));
});
bot->start();