0
votes

Hey I was wondering if it was possible to have a bot send a message after 10 messages within a channel. Like can you record the amount of messages in the channel, and then when that reaches a specific amount, such as 10 more messages, then output a message to the channel?

1
you could use a counter that increases on each message and resets after you send a message. Show your code. What issue are you facing ?Dhananjai Pai
Message event should help you discord.js.org/#/docs/main/stable/class/…Cursed

1 Answers

1
votes

You can do it easily:

let counter = 0;
client.on("message", () => {
    if(++counter === 10){
        message.channel.send("10 messages were sent!");
        counter = 0;
    }
});

(client is your Discord.js Client instance)