yourWaifu / sleepy-discord

C++ library for the Discord chat client. Please use Rust for new bots
https://yourWaifu.github.io/sleepy-discord/
MIT License
707 stars 92 forks source link

handle_transport_init received error: TLS handshake failed #188

Closed dankmolot closed 3 years ago

dankmolot commented 3 years ago

I created a project for this guide and in the source i used this example:

#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.run();
}

But when you run the compiled file, this error is displayed cyclically:

[2020-11-12 06:05:12] [connect] Successful connection
[2020-11-12 06:05:12] [error] handle_transport_init received error: TLS handshake failed
[2020-11-12 06:05:12] [info] asio async_shutdown error: asio.ssl:336462231 (shutdown while in init)
disconnect
yourWaifu commented 3 years ago

Can you try the develop version of this library?

dankmolot commented 3 years ago

On the develop branch works.

[2020-11-13 09:27:58] [connect] Successful connection
[2020-11-13 09:27:58] [connect] WebSocket Connection 162.159.133.234:443 v-2 "WebSocket++/0.8.2" /?v=6 101

And here is a screenshot which shows that the bot works: Thanks!