Home>

I want that every time the bot is turned on, the specific embed message will change, i.e. from the text Hello will be the text Bye .

Here's more details:

bot.on ('ready', ()=>{
    console.log (`Logged in as $ {bot.user.tag}!`);
    bot.user.setActivity ('YouTube', {type: 'WATCHING'});
    let rolesEmbed= new Discord.MessageEmbed ()
        .setColor ('RANDOM')
        .setTitle ('Server Roles:')
        .setDescription ('<@ & 681170806721740811>-Ore. Cannot be obtained. \ n <@ & 711577815992107049>-Technical Administrator who adds new updates to the server. Monitors the status of bots and server. Cannot be obtained. \ n <@ & 686650357648195679>-One of main server administrators, monitors chats, order, helpers and moderators. Cannot be obtained. \ n <@ & 688469231930572958>-Server Youtuber, important person, it is difficult to get it, because Ore gives it only to those whom he trusts! \ n < @ & 681200931764961306>-Server moderation, monitors the order in chats, voice channels. You can get it only if you are a moderator on the Ruda channel. \ N <@ & 704666508869238835>-Moderation assistants, help new participants master the server. Keep track of voice channels and chat. Can be obtained if you <@ & 682296084194000896>and help the server \ n <@ & 698484824897486849>-The mutant role prohibits chatting. This role is given for breaking the rules, so you better do not break! \ n <@ & 726167503226667089>-WITH channel donor ** Ore ** Awarded for sponsoring the channel. (Please send proofs to <@ & 681200931764961306>, <@ & 704666508869238835>, <@ & 686650357648195679>or <@ & 711577815992107049>) \ n <@ & 682296084194000896>-This role is given for the total number of n28528 typed in the chat! >-This role is issued when you have written 10 ideas with an average of 10 likes. \ N <@ & 711585878241181756>-Issued automatically when you log into the server ')
        .setTimestamp ()
    let server= ('servo ID');
    let channel= ('channel ID');
    let message= channel.fetchMessage ('message ID');
    message.edit (rolesEmbed);
});

But I had an error.

$ {message.guild.owner.user.username} # $ {message.guild.owner.user.discriminator}, true) Please help me how to add not the owner, but the deputy and add other people

Nelakrev2021-02-23 18:29:44
  • Answer # 1

    You are trying to define guild, channel and message as a String without using discord methods.

    bot.on ('ready', ()=>{
        console.log (`Logged in as $ {bot.user.tag}!`);
        bot.user.setActivity ('YouTube', {type: 'WATCHING'});
        let rolesEmbed= new Discord.MessageEmbed ()
            .setColor ('RANDOM')
            .setTitle ('Server Roles:')
            .setDescription ('<@ & 681170806721740811>-Ore. Cannot be obtained. \ n <@ & 711577815992107049>-Technical Administrator who adds new updates to the server. Monitors the status of bots and server. Cannot be obtained. \ n <@ & 686650357648195679>-One of main server administrators, monitors chats, order, helpers and moderators. Cannot be obtained. \ n <@ & 688469231930572958>-Server Youtuber, important person, it is difficult to get it, because Ore gives it only to those whom he trusts! \ n < @ & 681200931764961306>-Server moderation, monitors the order in chats, voice channels. You can get it only if you are a moderator on the Ruda channel. \ N <@ & 704666508869238835>-Moderation assistants, help new participants master the server. Keep track of voice channels and chat. Can be obtained if you <@ & 682296084194000896>and help the server \ n <@ & 698484824897486849>-The mutant role prohibits chatting. This role is given for breaking the rules, so you better do not break! \ n <@ & 726167503226667089>-WITH channel donor ** Ore ** Awarded for sponsoring the channel. (Please send proofs to <@ & 681200931764961306>, <@ & 704666508869238835>, <@ & 686650357648195679>or <@ & 711577815992107049>) \ n <@ & 682296084194000896>-This role is given for the total number of n28528 typed in the chat! >-This role is issued when you have written 10 ideas with an average of 10 likes. \ N <@ & 711585878241181756>-Issued automatically when you log into the server ')
            .setTimestamp ()
        let server= bot.guilds.cache.get ('Serv ID');
        if (! server) console.log ('Can't get server')
        let channel= server.channels.cache.get ('channel ID');
        if (! channel) console.log ('Can't get channel')
        let message= channel.messages.fetch ('message ID');
        if (! message) console.log ('Cant receive message')
        message.edit (rolesEmbed);
    });