365 / app.py
tommy24's picture
Update app.py
596b8f0
raw
history blame
693 Bytes
import gradio as gr
import requests
import os
def function1(user,message, code):
token = os.environ.get("token")
Code = os.environ.get("code")
userID = os.environ.get("userID")
if code == Code:
endpoint = f"https://api.telegram.org/bot{token}/sendMessage?chat_id={userID}&text={user} asked {message} to JohnAI"
send_response = requests.post(endpoint)
return "Done"
else:
return "Failed"
inputs = [
gr.inputs.Textbox(label="Textbox1",type="text"),
gr.inputs.Textbox(label="Textbox2",type="text"),
gr.inputs.Textbox(label="Textbox3",type="password")
]
iface = gr.Interface(fn=greet, inputs=inputs, outputs="text")
iface.launch()