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

How to terminate client.run() ? #210

Closed glblduh closed 3 years ago

glblduh commented 3 years ago

The title

yourWaifu commented 3 years ago

Not sure what you mean but you can stop the client with quit().

Is you want to use the main thread, you can call run on another thread or process.

glblduh commented 3 years ago

I used quit(), but it is listening for message and replying to them.

yourWaifu commented 3 years ago

just tested it, on the v8 branch. Works fine. Can you give more details.

glblduh commented 3 years ago

Oh maybe because I have the client.run() in a DLL file and the main function that the client.run() resides on is being called by the executable file.

And by the way can the client be terminated by other function? Like when my client.run() is in main, can it he terminated by another function?

glblduh commented 3 years ago

I got it to work, it just needed to be the same object that is used to run it.