0
votes

I've recently came upon an issue with Discord JavaScript (Node) that fails to send the second embed. I've used Embed Visualizer and it does as expected. I think there's an issue with the code itself. Code below.

let t = ":x:"
if (message.guild.users.find("name", "Paralyss").roles.find("name", "Paralyss")){
    let t = ":heavy_check_mark:"
}
let v = ":x:"
if(Date.now() - message.createdTimestamp < 5000){
    let v = ":heavy_check_mark:"
}
let time = Date.now() - message.createdTimestamp
try {
    message.member.guilds.channels.find(`name`, `mod-logs`).send({embed: {
        "color": 4886754,
        "author": {
            "name": "Command Ran",
            "icon_url": message.author.avatarURL
        },
        "fields": [
            {
                "name": "Status:"
                "value": `:heavy_check_mark:**Command Status**\n:heavy_check_mark:**Mod Status**\n${v}**${time}**\n${t}**Administrator**`,
                 "inline": true
            },
            {
                "name": "Command ran:",
                "value": "%**uptime**,
                "inline" true
            },
            {
                "name": "Uptime in server:",
                "value": `${client.uptime / 1000}`,
                "inline": true
            }
        ]
    }});
} catch (error) {
    console.log(error);
}

Console does not print anything.

1
What "second embed"? I only see embed once in your code. Maybe I am misunderstanding. - zero298
Sorry @zero298 I did not include the whole code, as the first part is working fluently. This embed is sent to a different channel after the "uptime" command is ran anywhere else. This part is the only one that's having issues. - Persik
Please do the following and say the results: see if a console.log works before the embed, see if the find channel function returns a channel by console.log-ing it, and please post any errors. Thank you! - Saddy
I see that you're using message.member.guilds.channels.find() but GuildMember.guilds is wrong (it should be GuildMember.guild). Try using message.guild.channels.find() instead - Federico Grandi
@FedericoGrandi can you put that as an answer instead of commenting it? - Persik

1 Answers

1
votes

I see that you're using message.member.guilds.channels.find() but GuildMember.guilds is wrong (it should be GuildMember.guild). Try using message.guild.channels.find() instead.