소스 검색

Create Darkside

Bot WhatsApp
pull/3748/head
DpmX996eBCMsi 3 달 전
committed by GitHub
부모
커밋
2d4e39a017
No known key found for this signature in database GPG 키 ID: B5690EEEBB952194
1개의 변경된 파일25개의 추가작업 그리고 0개의 파일을 삭제
  1. +25
    -0
      Darkside

+ 25
- 0
Darkside 파일 보기

@@ -0,0 +1,25 @@


```python
from flask import Flask, request
from twilio.twiml.messaging_response import MessagingResponse

app = Flask(__name__)

@app.route("/whatsapp", methods=['POST'])
def whatsapp_bot():
incoming_msg = request.values.get('Body', '').lower()
resp = MessagingResponse()
msg = resp.message()

if 'bonjour' in incoming_msg:
msg.body("Bonjour ! Comment puis-je t'aider ?")
elif 'aurevoir' in incoming_msg:
msg.body("Au revoir ! Passe une excellente journée !")
else:
msg.body("Désolé, je ne comprends pas cette commande. Essaye encore.")

return str(resp)

if __name__ == "__main__":
app.run(sage est reçu, le bot !

불러오는 중...
취소
저장