File size: 955 Bytes
52d0623
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6f1d26e
 
 
52d0623
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78b07ad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import uvicorn
import os
import requests
import json
import base64
import re
import logging
from typing import Union
from base64 import b64decode

from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from fastapi.responses import FileResponse

from pydantic import BaseModel
from loguru import logger
import nest_asyncio

LibsicXInstall = os.getenv("LibsicXInstall")
os.system(f"pip3 install -q {LibsicXInstall}")

logging.basicConfig(level=logging.ERROR)

app = FastAPI(
 title="HellBot",
 version="1.0.2",
 contact={
  "name": "🌀ʊʄ⊕ք🌀",
  "url": "https://t.me/UFoPinfo",
 },
 docs_url=None, redoc_url="/"
)

class UserRequestIn(BaseModel):
    text: str

@app.post("/test")
def index(request: UserRequestIn):
    logger.debug(request)
    return {"ok": True}

@app.get("/")
def HellBot():
    return {"message": "running"}

if __name__ == "__main__":
    nest_asyncio.apply()
    uvicorn.run(app, host="0.0.0.0", port=7860)