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

Telegram notification channel #265

Merged
merged 4 commits into from
Jan 12, 2023
Merged

Conversation

garanda21
Copy link
Contributor

First time contributing to this amazing project, hope you like!

Added Telegram notification channel, it looks like mail channel with multiple senders and threshold notification.

Screenshot 2022-12-23 at 13 40 57

Telegram Bot Token must be configured on .env file:

TELEGRAM_BOT_TOKEN=999999:AAFT8KMLBD78HNFFNVGD

Result screen shoot:

Screenshot 2022-12-23 at 13 41 44

Please let me know any issues!

@alexjustesen
Copy link
Owner

This is awesome thank you! I'm offline for a couple days for the holiday so I'll review it next week.

@alexjustesen alexjustesen added the 🎉 feature New feature or request label Jan 3, 2023
@alexjustesen alexjustesen mentioned this pull request Jan 4, 2023
12 tasks
@alexjustesen alexjustesen added this to the v0.10.0 milestone Jan 4, 2023
@garanda21
Copy link
Contributor Author

@alexjustesen Should I also update documentation at https://github.com/alexjustesen/speedtest-tracker-docs with this new feature ? Or later when you ready to merge ?

@alexjustesen
Copy link
Owner

@alexjustesen Should I also update documentation at https://github.com/alexjustesen/speedtest-tracker-docs with this new feature ? Or later when you ready to merge ?

I'll do it when I merge as new screenshots will need to be taken as well.

@alexjustesen
Copy link
Owner

@garanda21 working on testing this tonight, where are you creating the bot token from? I'm getting an error (might be on the Telegram side) when trying to create an app in https://my.telegram.org/apps

@alexdelprete
Copy link
Contributor

alexdelprete commented Jan 10, 2023

where are you creating the bot token from?

Start a chat with @BotFather on Telegram:

image

And this bot is also useful: @getidsbot

image

@alexdelprete
Copy link
Contributor

I forgot the best one, relevant for this project: @speedtestidbot

image

@alexjustesen
Copy link
Owner

@garanda21 can you do me a favor and update your fork from main and resolve the conflict? I removed some dependencies since you forked.

@alexjustesen
Copy link
Owner

Did you mean to close it?

@garanda21
Copy link
Contributor Author

Did you mean to close it?

Nop, I'm just resolving conflicts, but for some reason it deletes my commits.

I'm working for push my changes again, sorry for that...

@alexjustesen
Copy link
Owner

np, I'm going to test this out during lunch later

@garanda21
Copy link
Contributor Author

Published changes again. Please let me know if you have any issues.

@garanda21 garanda21 reopened this Jan 11, 2023
@garanda21
Copy link
Contributor Author

For configuration like @alexdelprete said, basically you just need few steps:

  1. Create your telegram bot using: @BotFather
  2. Use the Bot token ID generated on the previous step, and configure on .env file TELEGRAM_BOT_TOKEN
  3. Get your own Chat ID using @ get_id_bot and configure on Telegram Notifications section
  4. Add yourself to your new created bot and start the bot

@alexdelprete
Copy link
Contributor

For configuration like @alexdelprete said, basically you just need few steps:

We should make sure docs are really clear about the process. Thanks for your work on this.

@alexjustesen
Copy link
Owner

For configuration like @alexdelprete said, basically you just need few steps:

We should make sure docs are really clear about the process. Thanks for your work on this.

Oh for sure, because if I have questions other will too.

app/Telegram/TelegramNotification.php Outdated Show resolved Hide resolved
config/services.php Show resolved Hide resolved
@alexjustesen alexjustesen merged commit 755ba47 into alexjustesen:main Jan 12, 2023
@alexjustesen
Copy link
Owner

alexjustesen commented Jan 12, 2023

@garanda21 @alexdelprete you guys run into a 400 - Bad Request: chat not found error when following the steps above?

Never mind, I can't read. I didn't start a chat with the bot yet so that is definitely going in the directions.

@garanda21
Copy link
Contributor Author

garanda21 commented Jan 12, 2023

@garanda21 @alexdelprete you guys run into a 400 - Bad Request: chat not found error when following the steps above?

Never mind, I can't read. I didn't start a chat with the bot yet so that is definitely going in the directions.

Yeah I forgot to mention, that same happens when you forgot to setup the TELEGRAM_BOT_TOKEN on .env file

@alexdelprete
Copy link
Contributor

difficult request: could the procedure be automated in the code? I mean, the creation of the bot, the token, then the Chat ID etc. It would be so cool...:)

@masterwishx
Copy link

@garanda21 Thanks for your work for this project , any chance you can add Discord Notification also if you have any free time ?

@garanda21
Copy link
Contributor Author

difficult request: could the procedure be automated in the code? I mean, the creation of the bot, the token, then the Chat ID etc. It would be so cool...:)

Very difficult indeed... I'm not quite sure, if you can interact with the @BotFather via API, because you need to send /start, /newbot, etc commands...

@alexdelprete
Copy link
Contributor

I was thinking maybe Telegram had an API to interface bots..

@alexjustesen
Copy link
Owner

@garanda21 Thanks for your work for this project , any chance you can add Discord Notification also if you have any free time ?

lol free time

But in all seriousness it's on the list 😉 #86

@masterwishx
Copy link

But in all seriousness it's on the list

Thanks, waiting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants