Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
使用LINE Notify TOKEN建立自己的Line BOT
import requests
def lineNotifyMessage(token, msg):
headers = {
"Authorization": "Bearer " + token,
"Content-Type" : "application/x-www-form-urlencoded"
}
payload = {'message': msg}
r = requests.post("https://notify-api.line.me/api/notify", headers = headers, params = payload)
return r.status_code
# 修改為你要傳送的訊息內容
message = 'Hello World'
# 修改為你的權杖內容
token = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
lineNotifyMessage(token, message)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment