-
Hello everyone, I’m programming a gamebot with missions, it should run forever but the problem is when there are more than one users. if two or more users start the bot the username (tried to store it in a map with chat_id as a key) still remains the username of the last or the first one, so if the second starts a mission the bot doesn’t send the message to the second user but to the first (the obtained object is stored in the inventory of the wrogn username). the map variable is global.
|
Beta Was this translation helpful? Give feedback.
Answered by
MKRhere
Jun 9, 2023
Replies: 1 comment 2 replies
-
{ return ctx.chat.id } You're using the same chat ID for all players in a chat. Use |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I made a mistake. It is
ctx.from.id
(shorthand forctx.message.from.id
)