Skip to content

Commit cc882a1

Browse files
committed
Disable random challenge on server
1 parent 4fdbfe6 commit cc882a1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ With your GitHub account visit https://github.com/hyperchessbot/hyperbot , then
88

99
Create a BOT account if you do not already have one. To create one use an account that has not played any games yet, log into this account, then visit https://hypereasy.herokuapp.com/auth/lichess/bot , approve oauth and then on the page you are taken to click on 'Request upgrade to bot'.
1010

11-
Create an API access token with your BOT account at https://lichess.org/account/oauth/token ( should have scopes Read incoming challenges / Create, accept, decline challenges / Play games with the bot API )
11+
Create an API access token with your BOT account at https://lichess.org/account/oauth/token/create?scopes[]=challenge:read&scopes[]=challenge:write&scopes[]=bot:play&description=Hyper%20Bot%20TOKEN ( should have scopes Read incoming challenges / Create, accept, decline challenges / Play games with the bot API )
1212

1313
Sign up to Heroku https://signup.heroku.com/ , if you have not already.
1414

server.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,12 @@ function challengeBot(bot){
938938

939939
function challengeRandomBot(){
940940
return new Promise(resolve=>{
941+
if(disableChallengeRandom){
942+
resolve(`Challenging random bot is disabled.`)
943+
944+
return
945+
}
946+
941947
lichessUtils.getOnlineBots().then(bots=>{
942948
bots = bots.filter(bot=>bot!=lichessBotName)
943949
if(bots.length > 0){

0 commit comments

Comments
 (0)