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 95 forks source link

onReady virtual prototype changed #96

Closed TylerTheFox closed 6 years ago

TylerTheFox commented 6 years ago

Why is onReady now

virtual void onReady (std::string* jsonMessage);

and not

virtual void onReady (Ready readyData );

as the prototype is listed here in the documentation

include

class MyDiscordClient : public SleepyDiscord::DiscordClient { public: void onReady(SleepyDiscord::Ready data) { client.addReaction("channel id", "message id", "%F0%9F%98%95"); } }

int main() { SleepyDiscord::DiscordClient client("token"); }

https://yourwaifu.github.io/sleepy-discord/documentation.html#addreaction

yourWaifu commented 6 years ago

issues isn't for asking questions, but I'll answer them anyway. It simplifies the library code on my end.

TylerTheFox commented 6 years ago

What? It's not really a question. The documentation is wrong as void onReady(SleepyDiscord::Ready data) is no longer the correct way to use onReady. The correct method of using onReady now is void onReady (std::string* jsonMessage); as void onReady (Ready readyData ); will NEVER be called.

It IS an issue.

yourWaifu commented 6 years ago

virtual void onReady (std::string* jsonMessage); is the old version and it's not in develop virtual void onReady (Ready readyData ); is the new version that's in devlop that's about to be merged soon.

https://github.com/yourWaifu/sleepy-discord/blob/develop/include/sleepy_discord/client.h#L248

TylerTheFox commented 6 years ago

It's also in master https://github.com/yourWaifu/sleepy-discord/blob/master/include/sleepy_discord/client.h#L238

yourWaifu commented 6 years ago

I'm aware that master is still using the old version because it's a breaking change, that's why it's in develop and not master. I have a list of changes that would break other's code that I plan on placing in the docs.

TylerTheFox commented 6 years ago

I saw the old message before you edited it clarifying its NOT in develop. I saw commits in master and thought you pushed over all the changes from develop. My mistake but it is confusing the documentation addresses stuff in the develop branch and not the current release branch (master).