Update componentBuilders.js

button update
This commit is contained in:
VinceC
2024-11-24 01:27:14 -06:00
parent 049420e8e5
commit 82354dcfea

View File

@@ -1,20 +1,23 @@
// src/utils/componentBuilders.js
const { ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');
function createMatchActionRow(matchId) {
return new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setLabel('View Match Details')
.setStyle(ButtonStyle.Link)
.setURL(`https://www.vrbattles.gg/matches/${matchId}`),
new ButtonBuilder()
.setLabel('Join VRBattles Discord')
.setStyle(ButtonStyle.Link)
.setURL('https://discord.gg/j3DKVATPGQ')
);
function createMatchActionRow(gameName) {
// Encode the game name for the URL
const encodedGameName = encodeURIComponent(gameName);
const matchhubUrl = `https://www.vrbattles.gg/games/${encodedGameName}`;
return new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setLabel('View Matchhub')
.setStyle(ButtonStyle.Link)
.setURL(matchhubUrl),
new ButtonBuilder()
.setLabel('Join VRBattles Discord')
.setStyle(ButtonStyle.Link)
.setURL('https://discord.gg/j3DKVATPGQ')
);
}
module.exports = {
createMatchActionRow
};
createMatchActionRow
};