November Update
A variety of bot updates, verify setup, and match request info
This commit is contained in:
20
src/utils/componentBuilders.js
Normal file
20
src/utils/componentBuilders.js
Normal file
@@ -0,0 +1,20 @@
|
||||
// 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')
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
createMatchActionRow
|
||||
};
|
||||
43
src/utils/embedBuilders.js
Normal file
43
src/utils/embedBuilders.js
Normal file
@@ -0,0 +1,43 @@
|
||||
// src/utils/embedBuilders.js
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
function createMatchRequestEmbed(matchData) {
|
||||
const matchDateTime = new Date(matchData.match_date);
|
||||
const formattedDateTime = matchDateTime.toLocaleString();
|
||||
|
||||
return new EmbedBuilder()
|
||||
.setColor('#00ff00')
|
||||
.setTitle('🎮 New Match Request')
|
||||
.setDescription(`A new match has been requested for ${matchData.game_name}`)
|
||||
.addFields(
|
||||
{
|
||||
name: 'Game Details',
|
||||
value: [
|
||||
`🎮 **Game:** ${matchData.game_name}`,
|
||||
`📋 **Match Type:** ${matchData.match_type}`,
|
||||
`👥 **Team Size:** ${matchData.team_size}v${matchData.team_size}`,
|
||||
].join('\n'),
|
||||
inline: false
|
||||
},
|
||||
{
|
||||
name: 'Match Settings',
|
||||
value: [
|
||||
`🌍 **Region:** ${matchData.region}`,
|
||||
`🎯 **Class:** ${matchData.match_class}`,
|
||||
`📅 **Date & Time:** ${formattedDateTime}`,
|
||||
].join('\n'),
|
||||
inline: false
|
||||
},
|
||||
{
|
||||
name: 'Status',
|
||||
value: `📊 **Current Status:** ${matchData.status}`,
|
||||
inline: false
|
||||
}
|
||||
)
|
||||
.setTimestamp()
|
||||
.setFooter({ text: `Match Request ID: ${matchData.game_id}` });
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
createMatchRequestEmbed
|
||||
};
|
||||
Reference in New Issue
Block a user