Closed suntong closed 5 years ago
Hi @suntong, you don't need slimbot.startPolling()
if you don't expect people to interact with your bot.
Your bot could be failing because it was not added to an existing chat group or channel.
Thank you Edison.
Could you try above code with a good chat group please?
I've double-checked that my chat group ID was right. In fact, if I wrap slimbot.sendMessage()
into the on meesge event, and add slimbot.startPolling()
, then everything is fine. It is only when stripping them out when the problem exist.
Could you give it a try at your end please? Thx.
Hi Edison,
Would you able to duplicate the problem at your end as well, or you are thinking that it's still at me end? Thx
Hi @suntong, sorry for the late reply. I had the wrong impression that slimbot.startPolling()
is not needed to start sending messages. Sorry about that.
sorry for responding late. I've been out of town and just get back.
Thanks for the confirmation.
Just FTR, slimbot.sendFile works fine without the slimbot.startPolling(). So would it possible for you to create a version of sendMessage that does not depends of the slimbot.startPolling()? thx.
I'll start looking into that @suntong. Thanks for the suggestion!
@suntong, I just tested slimbot and slimbot.sendMessage
works without slimbot.startPolling()
. I successfully sent a message to myself through the bot without polling.
Oh, then I must have missed something important. Would you able to share your working code somewhere, like gist? Thanks!
Once again, my simple script and its error message is posted in the first message, @edisonchee
Oh ---,
having upgraded slimbot from 0.8.1 to 0.8.6, the very script posted in the first message is now working. Thanks @edisonchee!
Hi,
Can I run
slimbot.sendMessage
alone? Doesslimbot.sendMessage
need theslimbot.startPolling();
to be working? Ref: https://github.com/edisonchee/slimbot/wiki#getting-startedFor e.g., I have this simple script:
If I ran it, would it work? How come I got the following?
All that I want is to use
slimbot.sendMessage
alone without theslimbot.startPolling()
, because I want to send Telegram Message in another chat bot.Thx