|
|
|
@ -153,7 +153,7 @@ class EnvService:
|
|
|
|
|
print(
|
|
|
|
|
"TRANSLATOR_ROLES is not defined properly in the environment file!"
|
|
|
|
|
"Please copy your server's role and put it into TRANSLATOR in the .env file."
|
|
|
|
|
'For example a line should look like: `TRANSLATOR="Translate"`'
|
|
|
|
|
'For example a line should look like: `TRANSLATOR_ROLES="Translate"`'
|
|
|
|
|
)
|
|
|
|
|
print("Defaulting to allowing all users to use Translator commands...")
|
|
|
|
|
return [None]
|
|
|
|
@ -165,6 +165,32 @@ class EnvService:
|
|
|
|
|
)
|
|
|
|
|
return translator_roles
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
def get_search_roles():
|
|
|
|
|
# DALLE_ROLES is a comma separated list of string roles
|
|
|
|
|
# It can also just be one role
|
|
|
|
|
# Read these allowed roles and return as a list of strings
|
|
|
|
|
try:
|
|
|
|
|
search_roles = os.getenv("SEARCH_ROLES")
|
|
|
|
|
except Exception:
|
|
|
|
|
search_roles = None
|
|
|
|
|
|
|
|
|
|
if search_roles is None:
|
|
|
|
|
print(
|
|
|
|
|
"SEARCH_ROLES is not defined properly in the environment file!"
|
|
|
|
|
"Please copy your server's role and put it into SEARCH in the .env file."
|
|
|
|
|
'For example a line should look like: `SEARCH_ROLES="Translate"`'
|
|
|
|
|
)
|
|
|
|
|
print("Defaulting to allowing all users to use Search commands...")
|
|
|
|
|
return [None]
|
|
|
|
|
|
|
|
|
|
search_roles = (
|
|
|
|
|
search_roles.lower().split(",")
|
|
|
|
|
if "," in search_roles
|
|
|
|
|
else [search_roles.lower()]
|
|
|
|
|
)
|
|
|
|
|
return search_roles
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
def get_gpt_roles():
|
|
|
|
|
# GPT_ROLES is a comma separated list of string roles
|
|
|
|
|