Skip to content

Commit

Permalink
Added default lap duration
Browse files Browse the repository at this point in the history
  • Loading branch information
raphdcst committed Jun 17, 2024
1 parent 908e55f commit 7f28a2a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/commands/create-game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default new app.Command({

const [game, player] = await app.createGame(author, max_players, lap_duration)

return message.channel.send(`New game created (\`${game}\`) by player \`${player}\`, with the following parameters : \n Max number of players : ${max_players} \n Lap duration : ${lap_duration}s`)
return message.channel.send(`New game created (\`${game}\`) by player \`${player}\`, with the following parameters : \n Max number of players : ${max_players} \n Lap duration : ${lap_duration ? lap_duration : 120}s`)
// return message.channel.send(`New game created (\`${id}\`) with the following options : ${message.args.lap} mins and ${message.args.template}`)
}
})
4 changes: 2 additions & 2 deletions src/namespaces/lg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export async function createGame(user: app.User, max_players: number, lap_durati
gameId: genId(5),
created_at: Date.now(),
max_players: max_players,
lap_duration: lap_duration,
lap_duration: lap_duration ? lap_duration : 120,
players: { 1: author }
}).returning('*')

Expand All @@ -92,6 +92,6 @@ export async function createGame(user: app.User, max_players: number, lap_durati
} catch (err: any) {

createLogger.error(`An error occured during the game insertion : `, err)
return err
return err
}
}

0 comments on commit 7f28a2a

Please sign in to comment.