made code work on < python3.12

This commit is contained in:
ctih1 2025-07-25 23:32:56 +03:00
parent 90d301c054
commit 375e5deaf2
4 changed files with 8 additions and 32 deletions

View file

@ -1,28 +0,0 @@
DISCORDBOTTOKEN=
BOTPREFIX="g."
PINGLINE="The Beretta fires fast and won't make you feel any better!"
BLACKLISTEDUSERS=
OWNERID=
USERTRAINENABLED="true"
SHOWMEMENABLED="true"
LOCALE=fi
NAME=goober
AUTOUPDATE="True"
SONG="Basket Case - Green Day"
CHECKSDISABLED="Frue"
REACT="True"
POSITIVEGIFS="https://media.discordapp.net/attachments/821047460151427135/1181371808566493184/jjpQGeno.gif, https://tenor.com/view/chill-guy-my-new-character-gif-2777893510283028272,https://tenor.com/view/goodnight-goodnight-friends-weezer-weezer-goodnight-gif-7322052181075806988"
SPLASHTEXT="
SS\
SS |
SSSSSS\ SSSSSS\ SSSSSS\ SSSSSSS\ SSSSSS\ SSSSSS\
SS __SS\ SS __SS\ SS __SS\ SS __SS\ SS __SS\ SS __SS\
SS / SS |SS / SS |SS / SS |SS | SS |SSSSSSSS |SS | \__|
SS | SS |SS | SS |SS | SS |SS | SS |SS ____|SS |
\SSSSSSS |\SSSSSS |\SSSSSS |SSSSSSS |\SSSSSSS\ SS |
\____SS | \______/ \______/ \_______/ \_______|\__|
SS\ SS |
\SSSSSS |
\______/
"

View file

@ -75,7 +75,10 @@ class Script:
self.script: str = "" self.script: str = ""
def add_line(self, content, indent: int = 0, newline: bool = True) -> None: def add_line(self, content, indent: int = 0, newline: bool = True) -> None:
self.script += f"{'\t' * indent}{content}{'\n' if newline else ''}" tabs = "\t" * indent
newline_content = "\n" if newline else ""
self.script += f"{tabs}{content}{newline_content}"
def process_name(key: str) -> str: def process_name(key: str) -> str:
@ -170,7 +173,7 @@ class GenerateScript:
args = find_args(self.primary_data[key]) args = find_args(self.primary_data[key])
self.script.add_line( self.script.add_line(
f"def {process_name(key)}({convert_args(','.join([*args, "lang:str|None=None" if self.uses_typing else "lang"]), args, "none")}):" f"def {process_name(key)}({convert_args(','.join([*args, 'lang:str|None=None' if self.uses_typing else 'lang']), args, 'none')}):"
) )
if self.generate_comments: if self.generate_comments:
self.script.add_line('"""', 1) self.script.add_line('"""', 1)

View file

@ -1,6 +1,6 @@
import json import json
import os import os
from typing import Dict, List, Literal, Mapping, Any, NotRequired, TypedDict from typing import Dict, List, Literal, Mapping, Any, TypedDict
from modules.keys import Language from modules.keys import Language
import logging import logging
import copy import copy

View file

@ -7,4 +7,5 @@ psutil
better_profanity better_profanity
python-dotenv python-dotenv
dotenv dotenv
pillow pillow
watchdog