Update componentBuilders.js
button update
This commit is contained in:
@@ -1,13 +1,16 @@
|
|||||||
// src/utils/componentBuilders.js
|
|
||||||
const { ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.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()
|
return new ActionRowBuilder()
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new ButtonBuilder()
|
new ButtonBuilder()
|
||||||
.setLabel('View Match Details')
|
.setLabel('View Matchhub')
|
||||||
.setStyle(ButtonStyle.Link)
|
.setStyle(ButtonStyle.Link)
|
||||||
.setURL(`https://www.vrbattles.gg/matches/${matchId}`),
|
.setURL(matchhubUrl),
|
||||||
new ButtonBuilder()
|
new ButtonBuilder()
|
||||||
.setLabel('Join VRBattles Discord')
|
.setLabel('Join VRBattles Discord')
|
||||||
.setStyle(ButtonStyle.Link)
|
.setStyle(ButtonStyle.Link)
|
||||||
|
|||||||
Reference in New Issue
Block a user