From 6a385fd172358e27fec671d622116f2157c87090 Mon Sep 17 00:00:00 2001 From: yym68686 Date: Thu, 7 Dec 2023 21:50:23 +0800 Subject: [PATCH] Change the environment variable name ADMIN to ADMIN_LIST --- config.py | 2 +- utils/decorators.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config.py b/config.py index d34f7eeb..6604bc3a 100644 --- a/config.py +++ b/config.py @@ -36,7 +36,7 @@ claudeBot = claudebot(api_key=f"{ClaudeAPI}") whitelist = os.environ.get('whitelist', None) -ADMIN = os.environ.get('ADMIN', None) +ADMIN_LIST = os.environ.get('ADMIN_LIST', None) if whitelist: whitelist = [int(id) for id in whitelist.split(",")] diff --git a/utils/decorators.py b/utils/decorators.py index 4e1a36cd..64265eff 100644 --- a/utils/decorators.py +++ b/utils/decorators.py @@ -19,9 +19,9 @@ async def wrapper(*args, **kwargs): # 判断是否是管理员 def AdminAuthorization(func): async def wrapper(*args, **kwargs): - if config.ADMIN == None: + if config.ADMIN_LIST == None: return await func(*args, **kwargs) - if (args[0].effective_chat.id not in config.ADMIN): + if (args[0].effective_chat.id not in config.ADMIN_LIST): message = ( f"`Hi, {args[0].effective_user.username}!`\n\n" f"id: `{args[0].effective_user.id}`\n\n"