This commit is contained in:
Freddy Boulton 2024-01-18 20:49:51 -05:00 committed by GitHub
parent 02791f1a83
commit 1fc8a94138
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 3 deletions

View File

@ -0,0 +1,6 @@
---
"gradio": patch
"gradio_client": patch
---
feat:fix lint

View File

@ -841,13 +841,18 @@ class Client:
metadata={"tags": ["gradio-discord-bot"]},
)
with open(str(Path(__file__).parent / "templates" / "discord_chat.py"),encoding="utf-8") as f:
with open(
str(Path(__file__).parent / "templates" / "discord_chat.py"),
encoding="utf-8",
) as f:
app = f.read()
app = app.replace("<<app-src>>", self.src)
app = app.replace("<<api-name>>", api_names[0][0])
app = app.replace("<<command-name>>", api_names[0][1])
with tempfile.NamedTemporaryFile(mode="w", delete=False,encoding="utf-8") as app_file:
with tempfile.NamedTemporaryFile(
mode="w", delete=False, encoding="utf-8"
) as app_file:
with tempfile.NamedTemporaryFile(mode="w", delete=False) as requirements:
app_file.write(app)
requirements.write("\n".join(["discord.py==2.3.1"]))

View File

@ -1,7 +1,6 @@
from __future__ import annotations
import inspect
import json
import re
import types
import typing