LoginSignup
0
0

More than 3 years have passed since last update.

PythonからLINEBotにメッセージを送りたい

Posted at

久しぶりにPythonをしたくなり
このページを参考にLINEBotを作っています。

私がやったこと
1、ターミナルに 

pip install requests

を送りました。

2,PythonでLINEにメッセージを送る準備
”””
token = "私のを入力"
payload = {"massage": "Hello World"}
url = "http://notify-api.line.me/api/notify"
headers = {"Authorizatino": "Bearer" + token}
res = requests.post(url, data=payload, headers=headers)
print(res)
”””

これをすると

Process finished with exit code 0

このように表示されて、ラインにはメッセージは来ませんでした。
(この文章は正常に送信したっていう意味らしい)

3.コマンドに

python test.py

を入力して

Response[200]

が帰ってきたら成功とありますが

python: can't open file 'test.py': [Errno 2] No such file or directory

と表示されています。

まだラインにメッセージは来ません。
なんでか…今日一日で調べれるかな…

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0