This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
from flask import Flask, request | |
from twilio.twiml.messaging_response import MessagingResponse | |
from dotenv import load_dotenv | |
import threading, time, random | |
# load Mantium credentials | |
load_dotenv() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, request | |
SLEEP_TIME = 5 | |
PROMPT_ID = "98b58a5d-12ff-4e64-868e-4dabf986eac7" | |
# Init Flask App | |
app = Flask(__name__) | |
@app.route('/') | |
def hello(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, request | |
# Init Flask App | |
app = Flask(__name__) | |
@app.route('/') | |
def hello(): | |
return "Welcome to Mantium WhatsApp Bot" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mantiumapi import prompt | |
from mantiumapi import client | |
from dotenv import load_dotenv | |
# load Mantium credentials | |
load_dotenv() | |
mantium_user = os.getenv("MANTIUM_USER") | |
mantium_password = os.getenv("MANTIUM_PASSWORD") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
CURRENCY_LIST = {"£": "pounds", "$": "dollars", "€": "euros"} | |
CURRENCY_PATTERN = fr"((?:[{''.join(CURRENCY_LIST.keys())}]+\d*)(?:\,*\d+)(?:\.\d+)?(?i:[km])*)|(\d+(?:\,*\d+)(?:\.\d+)?(?i:[km])*(?:[{''.join(CURRENCY_LIST.keys())}]+))|((?:[{''.join(CURRENCY_LIST.keys())}]+))" | |
def _currency_to_text(text: str) -> str: | |
clean = ( | |
lambda x: x.lower() | |
.replace(",", "") |
NewerOlder