Tomato6966 / Musicium

An advanced Discord Music Bot with a Dashboard, using distube.js.org having an interactive button & menu system and many features! Supported Features: Spotify • YouTube • SoundCloud • Live Stream • Audio Filtering • DJ Roles • Autoplay • Autoresume • Dashboard + Live Queue • ...
https://musicium.eu
GNU General Public License v2.0
299 stars 310 forks source link

adding delay for user messages #136

Closed Araci-co closed 2 years ago

Araci-co commented 2 years ago
    if(message.channel.id != textChannel.id) return;
    //Delete the message once it got sent into the channel, bot messages after 5 seconds, user messages instantly!
    if (message.author.id === client.user.id) {
      setTimeout(()=>{
        if (!message.deleted) {
          message.delete().catch((e) => {
            console.log(e)
          })
        }
      }, 3000)
    } else {
      if (!message.deleted) {
        message.delete().catch((e) => {
          console.log(e)
        })
      }
    }
if(message.author.bot) return;

distubeEven.js line 1124 to 1139 @Tomato6966 @ I want to delete user messages after 3s like bot messages. What should I do?

Tomato6966 commented 2 years ago
    if(message.channel.id != textChannel.id) return;
    //Delete the message once it got sent into the channel, bot messages after 5 seconds, user messages instantly!
    if (message.author.id === client.user.id) {
      setTimeout(()=>{
        if (!message.deleted) {
          message.delete().catch((e) => {
            console.log(e)
          })
        }
      }, 3000)
    } else {
         setTimeout(()=>{
   if (!message.deleted) {
        message.delete().catch((e) => {
          console.log(e)
        })
      }
      }, 3000)
    }
if(message.author.bot) return;
Tomato6966 commented 2 years ago

something like that