Merge pull request #3 from tuna2134/main
Browse files- main.py +15 -13
- requirements.txt +1 -1
main.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
from PIL import Image, ImageDraw, ImageFont, ImageEnhance
|
2 |
from pilmoji import Pilmoji
|
3 |
-
from
|
|
|
4 |
import textwrap
|
5 |
import requests
|
6 |
import warnings
|
@@ -102,18 +103,19 @@ def gen(name, tag, id, content, icon):
|
|
102 |
file.seek(0)
|
103 |
return file
|
104 |
|
105 |
-
app =
|
106 |
|
107 |
-
@app.
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
|
|
117 |
|
118 |
if __name__ == "__main__":
|
119 |
-
app.run(host="0.0.0.0", port=3000)
|
|
|
1 |
from PIL import Image, ImageDraw, ImageFont, ImageEnhance
|
2 |
from pilmoji import Pilmoji
|
3 |
+
from fastapi import FastAPI
|
4 |
+
from fastapi.responses import Response
|
5 |
import textwrap
|
6 |
import requests
|
7 |
import warnings
|
|
|
103 |
file.seek(0)
|
104 |
return file
|
105 |
|
106 |
+
app = FastAPI()
|
107 |
|
108 |
+
@app.get("/", responses={
|
109 |
+
200: {
|
110 |
+
"content": {"image/png": {}}
|
111 |
+
}
|
112 |
+
})
|
113 |
+
def main(
|
114 |
+
name: str = "εη‘γ", tag: str = "0000", id: str = "0000000000000000000",
|
115 |
+
content: str = "γγγ―γγΉγγ§γ", icon: str = "https://cdn.discordapp.com/embed/avatars/0.png"
|
116 |
+
):
|
117 |
+
res = gen(name, tag, id, content, icon)
|
118 |
+
return Response(content=res, media_type="image/png")
|
119 |
|
120 |
if __name__ == "__main__":
|
121 |
+
app.run(host="0.0.0.0", port=3000)
|
requirements.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
pillow==9.4.0
|
2 |
pilmoji==2.0.2
|
3 |
-
|
4 |
requests==2.28.2
|
5 |
gunicorn==20.1.0
|
|
|
1 |
pillow==9.4.0
|
2 |
pilmoji==2.0.2
|
3 |
+
fastapi==0.92.0
|
4 |
requests==2.28.2
|
5 |
gunicorn==20.1.0
|