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,13 +1,16 @@
// src/utils/componentBuilders.js
const { ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');
function createMatchActionRow(matchId) {
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 Match Details')
.setLabel('View Matchhub')
.setStyle(ButtonStyle.Link)
.setURL(`https://www.vrbattles.gg/matches/${matchId}`),
.setURL(matchhubUrl),
new ButtonBuilder()
.setLabel('Join VRBattles Discord')
.setStyle(ButtonStyle.Link)