Skip to content

Commit

Permalink
Change the environment variable name ADMIN to ADMIN_LIST
Browse files Browse the repository at this point in the history
  • Loading branch information
yym68686 committed Dec 7, 2023
1 parent a01263e commit 6a385fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(",")]

Expand Down
4 changes: 2 additions & 2 deletions utils/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6a385fd

Please sign in to comment.