--- title: Telegram 通知 --- ###### tags: `Third Party Application` <!-- ###### tags: `Golang` --> # Telegram 通知 主要參考文章: --- https://jtxiao.com/main/posts/telegram-bot推送通知tg-bot入门/ 獲取用戶id: --- https://api.telegram.org/bot5055903920:AAGtUPWOQm2q7U83ZIQm_vn6R9JA4h9bTu8/getUpdates botOOXX的部分換上自己的token 獲取群組id: --- https://zhuanlan.zhihu.com/p/146062288 python example --- ``` def notification(message): # notification print('開始通知') token = '1234567:AAGtUAfeOQm2q7U8uudIQm_vk6R9JA4h9bTu4' chatId = 1712741222 noticeObject = {'chat_id': chatId, 'text': message} noticeResponse = requests.post( "https://api.telegram.org/bot" + token + "/sendMessage", data=noticeObject) print('已發送通知,內容: ' + noticeResponse.text) ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up