Marcus
Marcus
DIAdiscord.js - Imagine an app
Created by Marcus on 3/12/2024 in #djs-questions
sending a message to a channel a user cannot see
// display embed
const embed = new EmbedBuilder()
.setTitle("Promotion")
.setDescription(`${username} promoted from ${prev_rank} to ${rank} by ${promoter} (${promoterUnique})`)
.setColor(0x33cc33)
.setTimestamp()
.setFooter({text: "UU Rank Bot", iconURL: "https://cdn.discordapp.com/attachments/1213574659111657613/1213574740875153408/overwatch.png?"})

interaction.reply({embeds: [embed]});
// var channel = interaction.guild.channels.cache.get('1213626882189430895');

try{
const channel = await client.channels.fetch(promotionLogs);
await channel.send({ embeds: [embed] });
console.log(`CHANNEL: ${channel}`);
}catch (error) {
console.error("Error sending message: ", error);
};
// display embed
const embed = new EmbedBuilder()
.setTitle("Promotion")
.setDescription(`${username} promoted from ${prev_rank} to ${rank} by ${promoter} (${promoterUnique})`)
.setColor(0x33cc33)
.setTimestamp()
.setFooter({text: "UU Rank Bot", iconURL: "https://cdn.discordapp.com/attachments/1213574659111657613/1213574740875153408/overwatch.png?"})

interaction.reply({embeds: [embed]});
// var channel = interaction.guild.channels.cache.get('1213626882189430895');

try{
const channel = await client.channels.fetch(promotionLogs);
await channel.send({ embeds: [embed] });
console.log(`CHANNEL: ${channel}`);
}catch (error) {
console.error("Error sending message: ", error);
};
4 replies
DIAdiscord.js - Imagine an app
Created by Marcus on 3/12/2024 in #djs-questions
sending a message to a channel a user cannot see
4 replies