Open jmontane opened 9 years ago
Use callbacks. Something like:
send_document(receiver, FilePath1, function (params) local receiver = params[1] local text = params[2] send_msg(receiver, text, ok_cb, false) end, {receiver, text})
In #246 I've added a function to utils.lua to send messages in order in an easy way, when @yagop accept it (if he does, maybe my way is wrong xD) you will can send easily messages in order (including send files/images/...)
Thanks for quick replies,
I'm not a programmer guy, I was unable to achieve sort messages using callback functions. I think send_order_msg function can be a good improvement.
Your welcome!
send_order_msg
has been merged in a07b795, update your repo (./launch.sh update
) and you will can use it :smile:
To know how to use, see this:
https://github.com/yagop/telegram-bot/pull/246#issue-86152981
Hi,
I'm working in a own plugin. This plugin sends severals messages: 3 text messages and 1 document in following sorting.
send_large_msg(receiver, Message1) send_large_msg(receiver, Message2) send_document(receiver, FilePath1, ok_cb, false) send_large_msg(receiver, Message3)
But user receives messages in following sorting
send_large_msg(receiver, Message1) send_large_msg(receiver, Message2) send_large_msg(receiver, Message3) send_document(receiver, FilePaht1, ok_cb, false)
Sometimes text messages are received unsorted, for instance,
send_large_msg(receiver, Message2) send_large_msg(receiver, Message1) send_large_msg(receiver, Message3) send_document(receiver, FilePaht1, ok_cb, false)
Is there any way to force messages to be delivered in desired sorting? Thanks in advance.