From: yamat0jp Date: Fri, 7 Sep 2018 12:24:28 +0000 (+0900) Subject: 裏技 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=6e0d5627faf76ac280c2fecd210fcfb22c302eb5;p=simple-tornado-bot%2Fsimple-tornado-bot.git 裏技 --- diff --git a/bot.py b/bot.py index 9d8ab56..838d936 100644 --- a/bot.py +++ b/bot.py @@ -55,9 +55,10 @@ class WebHookHandler(tornado.web.RequestHandler): return ans def post(self): + print(self.request.body) + ''' header = self.request.headers.get('X-Line-Signature','') body = json.load(self.request.body) - ''' hashid = hmac.new(header.get('X-Line-Signature'), body.decode('utf-8'), hashlib.sha256).digest() signature = base64.b64encode(hashid) @@ -74,8 +75,6 @@ class WebHookHandler(tornado.web.RequestHandler): TextSendMessage(text=self.main(event.Message.text)) ) ''' - event = body['Body'] - linebot.reply_message(event['replyToken'],text=self.main(event['message']['text'])) class DummyHandler(tornado.web.RequestHandler): def get(self):