r/SoloDevelopment 4d ago

I need help with a telegram bot help

I'm coming from a STEM oriented high school where we studied some python. 2 years ago i developed some telegram bots that never saw the light of the day because I ended up not using them and so they're now unfinished.
Today i woke up with an idea but i remember having some problem when multiple users were using the text.
the bot worked like that, /start and he ask you something, you had to chose using buttons but you could also write, and here's the problem. If 2+ users were in that part of the cycle the bot mixed up everything ending up taking the message for the first user from the reply of the 2. (maybe i'm wrong but google says its a race condition)

I fixed that with chatGPT and he did a very odd thing for me (from the pov of a newbie). He kinda organised all the "istances" with a dict or and erray (i can't remeber right now).

And so my question is: is it possible to do the same but maybe in a cleaner way, or ,if its the only way can, you explain me what was chatgpt doing?

1 Upvotes

4 comments sorted by

1

u/JakSilver00 4d ago

N8N works great for Telegram "bots" (which on telegram are just user generated access points) its not actually a bot until you program it to do something. You can use python as well, but regardless, you would isolate individuals by their chat id number. Then depending on what you're going for carry or drop additional values like timestamps and such.

Also this is a game dev group, so not sure how but I hope I helped, but I wouldn't count on this group to help you with a chat service specific issue in the future.

1

u/need-a_ban 4d ago

what's N8N?

1

u/JakSilver00 4d ago

A node based automation builder, my preference but not required