Skip to content

How do I make the bot react to another bot #402

Answered by NekoCyan
ImFangy asked this question in Q&A
Discussion options

You must be logged in to vote

Here is example code.

const sleep = (ms) => new Promise(res => setTimeout(res, ms));

client.on('messageCreate', async message => {
    if (!message.guild) return;
    if (message.author.id == "THAT_BOT_ID") {
        if (message.embeds[0].?description.toLowerCase().includes("please react with")) {
            await sleep(2000); // Make sure the bot has react Emoji to its Message.
            await message.react("RAW_EMOJI");
        }
    }
});

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@ImFangy
Comment options

Comment options

You must be logged in to vote
1 reply
@aiko-chan-ai
Comment options

Answer selected by aiko-chan-ai
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants