Send Telegram notification from Draytek

Thật chất ra cách này dùng SMS Provider, và Telegram chính là 1 SMS Provider

Đầu tiên tạo 1 SMS Provider trong Objects Setting >> SMS/Mail Service Object

https://api.telegram.org/bot<Token>/sendMessage?chat_id=-<BotID>&text=###txtMsg###

To create a chatbot on Telegram, you need to contact the BotFather, which is essentially a bot used to create other bots.

The command you need is /newbot which leads to the following steps to create your bot

Cách tạo Bot và lấy token

Lúc này BotFather sẽ provide cho bạn 1 Token. Replace <Token> bằng Token này.

Sau đó tìm cách nào đó để lấy được ID em Bot này. ID thường có format là -100... Và sau đó thay vào <BotID> ở trên . Vậy cuối cùng ta có

https://api.telegram.org/bot5991000400:AAXXqhmGXXFDdqLxU4pJJd8FKL5JY8VAWRY/sendMessage?chat_id=--1001930005500&text=###txtMsg###

Xong. Vậy là đã có provider

Về phần Quota thì cho số cao nhất có thể ( Đại khái đoán là limit bao nhiêu SMS được send. Vì nếu là SMS thật mà để quota cao cuối thánh nhìn bill nhảy lầu mất )

Tương tự Sending interval.

Giờ thì tạo Notification trong Objects Setting >> Notification Object

Cần cái nào thì check chọn cái đó. Ở đây mình test nên chọn Full 😀

Finally tạo Alert

Và thành quả là đây

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Up ↑

%d bloggers like this: