From 926bebb122ba4226b65088bd0d2f964c8d9e9f8c Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Wed, 31 May 2023 18:37:27 -0700 Subject: change ai level from 2 => 3 --- src/api/index.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index b201aba..ae9b26a 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -24,7 +24,6 @@ const sendNextMove = (gameId: number, move: string): Promise => .then((r): BotMoveResponse => { const body = r.data as BotMoveResponse; if (r.status === 200) { - console.log(body); return body; } throw new Error( @@ -40,18 +39,15 @@ router.post('/move', async (req, res) => { for (const update of updateMessages) { if (update.bot_turn) { - console.log(update); - const move = aiMove(update.fen); + const move = aiMove(update.fen, 3); const moveFrom = Object.keys(move)[0]; const moveTo = move[moveFrom]; - try { - await sendNextMove(update.game_id, moveFrom + moveTo); - } catch (e) { - console.log(e); - } + + await sendNextMove(update.game_id, moveFrom + moveTo); } } + res.status(200).send('OK'); }); -- cgit v1.3