first commit
This commit is contained in:
33
embeds/userStreaming.js
Normal file
33
embeds/userStreaming.js
Normal file
@ -0,0 +1,33 @@
|
||||
const { EmbedBuilder, ButtonBuilder, ActionRowBuilder } = require('discord.js');
|
||||
|
||||
function userStreamingEmbed(user, status) {
|
||||
|
||||
const username = user?.username || 'Unknown User';
|
||||
const avatarURL = user?.displayAvatarURL({ dynamic: true }) || null;
|
||||
const streamTitle = status?.details || 'No title available';
|
||||
const gameName = status?.name || 'No game available';
|
||||
const streamURL = status?.url || 'No URL available';
|
||||
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle('📡 Live Stream Alert!')
|
||||
.setDescription(`**${username}** Just went Live on Twitch!`)
|
||||
.addFields( { name: 'Stream Title', value: streamTitle, inline: false }, { name: 'Game / Category', value: gameName, inline: true } )
|
||||
.setColor('Green')
|
||||
.setTimestamp()
|
||||
.setFooter({ text: 'User Streaming Status' })
|
||||
.setThumbnail(avatarURL);
|
||||
|
||||
const streamButton = new ButtonBuilder()
|
||||
.setLabel('🎥 Watch Stream')
|
||||
.setURL(streamURL)
|
||||
.setStyle(5);
|
||||
|
||||
const row = new ActionRowBuilder()
|
||||
.addComponents(streamButton);
|
||||
return { embeds: [embed], components: [row] };
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
userStreamingEmbed
|
||||
};
|
||||
Reference in New Issue
Block a user