Skip to content

Commit

Permalink
fix : roles-update (#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustDams authored Nov 6, 2023
1 parent 4ff80ff commit bdfda7a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion functions/roles.js
Original file line number Diff line number Diff line change
@@ -25,7 +25,12 @@ const setupRoles = async (client, user, guildId, remove) => {
user = user.flat().at(0)

const playerParam = { param: user.faceitId, faceitId: true }
const { playerDatas } = await getStats({ playerParam, game: defaultGame, matchNumber: 1 }).catch(() => null)
const stats = await getStats({ playerParam, game: defaultGame, matchNumber: 1 }).catch(() => null)

if (!stats) return

const playerDatas = stats.playerDatas

if (!playerDatas?.games[defaultGame]) return

const playerElo = playerDatas.games[defaultGame].faceit_elo

0 comments on commit bdfda7a

Please sign in to comment.