Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulk Messages Esp8266 - Subscriber Data not being saved #297

Open
Oseihie opened this issue Sep 28, 2022 · 1 comment
Open

Bulk Messages Esp8266 - Subscriber Data not being saved #297

Oseihie opened this issue Sep 28, 2022 · 1 comment

Comments

@Oseihie
Copy link

Oseihie commented Sep 28, 2022

Hello @Bolukan and everyone,

I am trying the Bulk Messages example for the Esp8266. I flashed the code to the Esp8266 with no problem and was able to establish a communication between my bot from telegram and Esp8266.
After sending /start on telegram, i get a response with the commands and it is expected that the chat_id and name from telegram is saved in the json file. But when I send the request to see all subscribers, I get a response of null.

I have taken a look at the code but I cannot find what the issue might be.
Does anyone have an idea?

@SebouhArmenakian
Copy link

Replacing between //users.getOrCreateMember(chat_id, from_name); and subscribedUsersFile.close(); will solve the issue:-

if ((usersDoc.isNull()) && (subscribedUsersFile))
{
subscribedUsersFile.print("{"" + chat_id + "":" + """ + from_name + ""}" );
}
else
{
serializeJson(users, subscribedUsersFile);
users = usersDoc.as();
}

#232

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants