Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FeatureRequest] Telegram support to Operation #442

Closed
soloam opened this issue Mar 2, 2018 · 4 comments
Closed

[FeatureRequest] Telegram support to Operation #442

soloam opened this issue Mar 2, 2018 · 4 comments
Assignees
Milestone

Comments

@soloam
Copy link

soloam commented Mar 2, 2018

Hi, it would be nice if MyController supported Telegram as notification, this allows to send all notifications to Telegram and having all information in one place.

Thank You for the great work

@soloam soloam changed the title Feature Request: Telegram support to Operation [FeatureRequest] Telegram support to Operation Mar 2, 2018
@jkandasa jkandasa self-assigned this Mar 3, 2018
@jkandasa jkandasa added this to the 1.3.0.Final milestone Jul 2, 2018
@jkandasa
Copy link
Member

jkandasa commented Jul 2, 2018

@soloam This feature is implemented in the SNAPSHOT version.

Add telegram bot token from your bot(BotFather) into MyController notifications settings.
I followed this link to setup a bot in my telegram account.
image

Valid token will be looking as follows after saved,
image

Create Operation to send telegram bot message, Here Channel username is important. The custom message can be empty.
image

@jl277013
Copy link

jl277013 commented Aug 6, 2018

I followed the example above. When I put in the Telegram token, the is bot, Firstname and Username automatically populated fine (FYI, this didn't work in Chrome but was ok in Edge). I put my Telegram username (is this the same as Channel username?) in the operation as the example above, I got the following error (I substituted my username with "telegram_username" below) from the MyController log:

2018-08-06 16:23:10,192 ERROR [mc-th-pool-6] [org.mycontroller.standalone.operation.TelegramBotUtils:59] Exception: Message(chatId=telegram_username, text=A message from MyController, parseMode=null, disableWebPagePreview=null, disableNotification=null, replyToMessageId=null)
java.lang.RuntimeException: Response(ok=false, result=null, errorCode=400, description=Bad Request: chat not found)

Any idea what is the issue?

@jkandasa
Copy link
Member

jkandasa commented Aug 7, 2018

@jl277013 can you follow this video

  • join your bot to a group, from 04:20 to 05:52
  • to get channel username(chat id), from 09:20 to 13:20.

And I do not see any problem with Chrome browser.

@jl277013
Copy link

jl277013 commented Aug 7, 2018

Thanks for the info! I enabled Allow Groups. I also enabled Group Privacy. I was mistakenly used the bot id from the rest api from the description above. After some digging, I found a page with the following excerpt:

"I dumped the error response and it was 403 "Forbidden: bot can't send messages to bots".
The solution was to go to Telegram and search for the bot called "userinfobot" with the questionmark as an avatar. Click start and it gives you your userid. Use that, and you will start receiving messages from your bot :-)"

When I got the id for my Telegram user, it worked!
Also, I tried Chrome again today and it seemed to be fine. I am not sure what happened here.
Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants