tuna2134
commited on
Commit
Β·
4f9c946
1
Parent(s):
854f362
fix: fastapi
Browse files
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
|
@@ -113,20 +114,20 @@ def make(name, tag, id, content, icon):
|
|
113 |
return file
|
114 |
|
115 |
|
116 |
-
app =
|
117 |
|
118 |
|
119 |
-
@app.
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
)
|
129 |
-
return
|
130 |
|
131 |
|
132 |
if __name__ == "__main__":
|
|
|
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
|
|
|
114 |
return file
|
115 |
|
116 |
|
117 |
+
app = FastAPI()
|
118 |
|
119 |
|
120 |
+
@app.get("/", responses={
|
121 |
+
200: {
|
122 |
+
"content": {"image/png": {}}
|
123 |
+
}
|
124 |
+
})
|
125 |
+
def main(
|
126 |
+
name: str = "εη‘γ", tag: str = "0000", id: str = "0000000000000000000",
|
127 |
+
content: str = "γγγ―γγΉγγ§γ", icon: str = "https://cdn.discordapp.com/embed/avatars/0.png"
|
128 |
+
):
|
129 |
+
res = make(name, tag, id, content, icon)
|
130 |
+
return Response(content=res, media_type="image/png")
|
131 |
|
132 |
|
133 |
if __name__ == "__main__":
|