-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
103 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ DISCORD_CLIENT_ID= | |
|
||
# Faceit Api Token | ||
FACEIT_TOKEN= | ||
|
||
# Steam Api Token | ||
STEAM_TOKEN= | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
const { ActionRowBuilder } = require('discord.js') | ||
const CommandsStats = require('../../database/commandsStats') | ||
const { updateButtons } = require('../../functions/customType') | ||
const { sendCardWithInfo, getMatchItems } = require('../../commands/last') | ||
const { getCardByUserType } = require('../../templates/loadingCard') | ||
const { getStats } = require('../../functions/apiHandler') | ||
|
||
/** | ||
* Update last stats graph. | ||
*/ | ||
module.exports = { | ||
name: 'uLPS', | ||
async execute(interaction, json, newUser = false) { | ||
CommandsStats.create('last', 'button - player', interaction) | ||
const componentsLength = interaction.message.components.length | ||
// get the 2 last components | ||
const components = interaction.message.components.slice(componentsLength - 2, componentsLength) | ||
|
||
getCardByUserType(newUser, interaction) | ||
|
||
const { | ||
playerDatas, | ||
steamDatas | ||
} = await getStats({ | ||
playerParam: { id: json.type.playerId }, | ||
matchNumber: 1, | ||
checkElo: 0, | ||
}) | ||
|
||
const matchItems = await getMatchItems(interaction, playerDatas, steamDatas, json.selectedMatchStats, json.matchId, json.game) | ||
const buttons = await updateButtons(components, json.type) | ||
|
||
return { | ||
...matchItems, | ||
components: [ | ||
new ActionRowBuilder().addComponents(buttons) | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters