You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to write a simple script which just sends a message to an hardcoded chatID and exits. However, if I just exit after the sendMessage() call the message won't be sent in time; instead, if i time.Sleep a little the message is sent. Of course, this is a really bad solution, so i was wondering what is the proper way to wait for the message to be sent. I noticed a SendingState field for the type Message, although it just stays as messageSendingStatePending forever and is not really helpful.
Also, this is probably unrelated but if i call DestroyInstance() (e.g. as done in the SIGTERM handler in the sendText example) it doesn't seem to work and exists with error code 2 and a goroutine dump. I'm not really good with goroutines so you tell me.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to write a simple script which just sends a message to an hardcoded chatID and exits. However, if I just exit after the
sendMessage()call the message won't be sent in time; instead, if itime.Sleepa little the message is sent. Of course, this is a really bad solution, so i was wondering what is the proper way to wait for the message to be sent. I noticed aSendingStatefield for the typeMessage, although it just stays asmessageSendingStatePendingforever and is not really helpful.Also, this is probably unrelated but if i call
DestroyInstance()(e.g. as done in theSIGTERMhandler in the sendText example) it doesn't seem to work and exists with error code 2 and a goroutine dump. I'm not really good with goroutines so you tell me.Beta Was this translation helpful? Give feedback.
All reactions