lichess-bot-devs / lichess-bot

A bridge between Lichess bots and chess engines
GNU Affero General Public License v3.0
772 stars 449 forks source link

First attempt to upgrade to bot account shows failure message #1029

Closed desparza22 closed 1 month ago

desparza22 commented 1 month ago

Describe the bug When you first run 'python lichess_bot.py -u', as described in the instructions for upgrading to a bot account, you get an error message saying that you don't have a bot account.

lichess_bot.py checks if you're a bot by checking if the upgrade succeeded: if args.u and not is_bot: is_bot = upgrade_account(li)

But the upgrade_account(li) will always return false when 'li' is 'lib.lichess.Lichess', because 'upgrade_account' returns 'False' if the upgrade request returns 'None', and the 'lib.lichess.Lichess' upgrade request always returns 'None' (at least according to its type annotation). This doesn't happen on retry because 'is_bot' is 'True', so the if statement above never calls 'upgrade_account'.

To Reproduce Steps to reproduce the behavior:

  1. Follow the steps for upgrading to bot account in README
  2. At the 'python lichess_bot.py -u' step, you get an error message `% python lichess-bot.py -u
    [10/05/24 08:14:15] INFO lichessbot.py:1185 . /|
    . // o\
    . || .) lichess-bot
    2024.9.19.1 on Darwin 22.6.0
    . //\
    . )
    ( Play on Lichess with a
    bot

                INFO     Checking engine configuration ...     lichess_bot.py:1188
                INFO     Engine configuration OK               lichess_bot.py:1191

    [10/05/24 08:14:16] INFO Welcome desparza-bot! lichess_bot.py:1201 ERROR desparza-bot is not a bot account. lichess_bot.py:1209 Please upgrade it to a bot account!`

Expected behavior A success or error message regarding the upgrade.

Desktop (please complete the following information):

MarkZH commented 1 month ago

Good catch. The linked PR should fix this issue. Thanks.