Kaynağa Gözat

Create Darkside

Bot WhatsApp
pull/3748/head
DpmX996eBCMsi 3 ay önce
committed by GitHub
ebeveyn
işleme
2d4e39a017
Veri tabanında bu imza için bilinen anahtar bulunamadı GPG Anahtar Kimliği: B5690EEEBB952194
1 değiştirilmiş dosya ile 25 ekleme ve 0 silme
  1. +25
    -0
      Darkside

+ 25
- 0
Darkside Dosyayı Görüntüle

@@ -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 !

Yükleniyor…
İptal
Kaydet