Compare commits

..

No commits in common. "8e506ecd2271b2f1124ec2bf83072acef6b775e6" and "c401269c4b8da307e09fbffa76f1a0f3f96e97d4" have entirely different histories.

3 changed files with 17 additions and 23 deletions

View File

@ -60,4 +60,5 @@ 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 "-march=native -O2 -pipe")
#set(CMAKE_CXX_FLAGS "-O0 -pipe")

View File

@ -1,27 +1,20 @@
# Sparkle
Library for creating Discord bots.
## How to Build
### Required Libraries
- `curl`
- `ixwebsocket`
### Build Instructions
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
```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();