添加环境变量检查以确认协议
此更改引入了一种新的方式来通过检查特定的环境变量是否被设置来确认最终用户许可协议(EULA)和隐私政策。如果 `EULA_AGREE` 或 `PRIVACY_AGREE` 与各自的新哈希值匹配,则认为这些协议已被确认,用户将不会被再次提示确认。此外,提示消息也已更新,告知用户这一新选项。
This commit is contained in:
8
bot.py
8
bot.py
@@ -205,6 +205,9 @@ def check_eula():
|
||||
if eula_new_hash == confirmed_content:
|
||||
eula_confirmed = True
|
||||
eula_updated = False
|
||||
if eula_new_hash == os.getenv("EULA_AGREE"):
|
||||
eula_confirmed = True
|
||||
eula_updated = False
|
||||
|
||||
# 检查隐私条款确认文件是否存在
|
||||
if privacy_confirm_file.exists():
|
||||
@@ -213,11 +216,14 @@ def check_eula():
|
||||
if privacy_new_hash == confirmed_content:
|
||||
privacy_confirmed = True
|
||||
privacy_updated = False
|
||||
if privacy_new_hash == os.getenv("PRIVACY_AGREE"):
|
||||
privacy_confirmed = True
|
||||
privacy_updated = False
|
||||
|
||||
# 如果EULA或隐私条款有更新,提示用户重新确认
|
||||
if eula_updated or privacy_updated:
|
||||
print("EULA或隐私条款内容已更新,请在阅读后重新确认,继续运行视为同意更新后的以上两款协议")
|
||||
print('输入"同意"或"confirmed"继续运行')
|
||||
print(f'输入"同意"或"confirmed"或设置环境变量"EULA_AGREE={eula_new_hash}"和"PRIVACY_AGREE={privacy_new_hash}"继续运行')
|
||||
while True:
|
||||
user_input = input().strip().lower()
|
||||
if user_input in ['同意', 'confirmed']:
|
||||
|
||||
Reference in New Issue
Block a user