Fix crash on pre-release versions and enable update checks for pre-releases

This commit is contained in:
KnugiHK
2026-01-24 17:20:07 +08:00
parent f920ca82b4
commit eab98ba0d6
2 changed files with 19 additions and 14 deletions

View File

@@ -274,6 +274,10 @@ def setup_argument_parser() -> ArgumentParser:
"--check-update", dest="check_update", default=False, action='store_true',
help="Check for updates (require Internet access)"
)
misc_group.add_argument(
"--check-update-pre", dest="check_update_pre", default=False, action='store_true',
help="Check for updates including pre-releases (require Internet access)"
)
misc_group.add_argument(
"--assume-first-as-me", dest="assume_first_as_me", default=False, action='store_true',
help="Assume the first message in a chat as sent by me (must be used together with -e)"
@@ -775,8 +779,8 @@ def main():
setup_logging(logging.INFO)
# Check for updates
if args.check_update:
exit(check_update())
if args.check_update or args.check_update_pre:
exit(check_update(args.check_update_pre))
# Validate arguments
validate_args(parser, args)