feat: add initial experimental Twitch Eventsub support (#5837)

Co-authored-by: nerix <nerixdev@outlook.de>
This commit is contained in:
pajlada
2025-02-02 17:03:24 +01:00
committed by GitHub
parent f9f7d47b43
commit 0f8a29fdb9
130 changed files with 19656 additions and 8 deletions
+13
View File
@@ -0,0 +1,13 @@
import logging
import subprocess
log = logging.getLogger(__name__)
def format_code(code: str) -> str:
proc = subprocess.Popen(["clang-format", "-"], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
outs, errs = proc.communicate(input=code.encode(), timeout=2)
if errs is not None:
log.warning(f"Error formatting code: {errs.decode()}")
return outs.decode()