lucalas / StreamlabsArduinoAlerts

Library to connect to your Streamlabs account and catch all the Twitch events.
8 stars 1 forks source link

How can i print follower name ? #4

Closed kymnsoftware closed 3 years ago

kymnsoftware commented 3 years ago

Hi, How can i print follower name on matrix ?

lucalas commented 3 years ago

Hi @kymnsoftware , as you can see in the readme you can do something like:

void followerEvent(const char* payload) {
//  matrix.print(payload);
}
streamlabsAPI.followTwitchEvent(followerEvent);

I don't know which library are you using for matrix, this is an example to let you know how to take the new follower name.

kymnsoftware commented 3 years ago

I use MD_PAROLA for the matrix. I'm doing this print(payload) but output looks like this got followerEvent message: {"type":"follow","message":[{"name":"IMrSchwarz","isTest":true,"_id":"a1aef56fe7005d3ac876127bf8fa9b0e","priority":10}],"for":"twitch_account","event_id":"evt_df222a6d6f19868edd70facc96d980ae"} I want to him just write a name. like this = IMrSchwarz

lucalas commented 3 years ago

I use MD_PAROLA for the matrix. I'm doing this print(payload) but output looks like this got followerEvent message: {"type":"follow","message":[{"name":"IMrSchwarz","isTest":true,"_id":"a1aef56fe7005d3ac876127bf8fa9b0e","priority":10}],"for":"twitch_account","event_id":"evt_df222a6d6f19868edd70facc96d980ae"} I want to him just write a name. like this = IMrSchwarz

You have to use some kind of library to parse json like ArduinoJson that helps you to extract specific value, or if you don't want to use a parsing library you have to operate on the string and parse by yourself.