fix: improve match notification handling and embed display

This commit is contained in:
VinceC
2024-11-29 04:34:55 -06:00
parent 3651537c1f
commit 426bdaceb7
2 changed files with 32 additions and 6 deletions

View File

@@ -151,10 +151,14 @@ class EmbedBuilders {
const matchDateTime = new Date(matchData.match_date);
const formattedDateTime = matchDateTime.toLocaleString();
// Format team size to be "4v4" regardless of input format
const teamSize = matchData.team_size.toString().replace(/[^0-9]/g, ''); // Keep only numbers
const formattedTeamSize = `${teamSize}v${teamSize}`;
return new EmbedBuilder()
.setColor('#00ff00') // Green for new match requests
.setTitle(`🎮 New ${matchData.game_name} Match`)
.setDescription(`${matchData.team_size}v${matchData.team_size} Match in ${matchData.region} Region`)
.setDescription(`${formattedTeamSize} Match in ${matchData.region} Region`)
.addFields(
{
name: '⏰ Starting',
@@ -165,6 +169,11 @@ class EmbedBuilders {
name: '📊 Status',
value: matchData.status,
inline: true
},
{
name: '🎲 Match Type',
value: matchData.match_type,
inline: true
}
)
.setTimestamp()