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