1
votes

So I do have this simple function here, where my bot sends a message to a specific channel after 10 secs. I want to somehow make my bot not only send the message, but also automatically edit the (SEND_MESSAGES) channel permissions to @everyone

setTimeout(function() {
      client.channels.cache.get(`823225045231992892`).send('You cant send messages from now!')
    }, 10000);
1

1 Answers

0
votes

Here you can get more information about how you can change permissions.

    setTimeout(() => {
      var channel = client.channels.cache.get(`823225045231992892`) 
      
        channel.send("You cant send messages from now!");
        channel.overwritePermissions(
          [
            {
              id: channel.guild.id,
              deny: ["SEND_MESSAGES"],
            },
          ],
          "Deny access to send messages"
        );
    }, 10000);