discord-timeout-js

1.0.3 • Public • Published
const timeout = require('discord-timeout-js')
const ms = require('ms')

const member = message.mentions.members.first() || message.guild.members.cache.get(args[0])

        let time = args[1];
        if(!member) return message.reply(`Try to mention or give me a member id.`);
        if(!time) return message.reply(`Try to give a valid time.`);

        if(member && time) {
            let ti = ['d', "m", "h", "s"];
            if (!ti.some(c => message.content.endsWith(c))) {
                return message.reply(`Try to give a valid time.`)

            }
            if (ti.some(c => message.content.endsWith(c))) {
                const timee = ms(args[1])
                if (timee <= 9999) return msg.channel.send(`Try to give more than 10s`)
                if (timee > 2332800000) return msg.channel.send(`Try to give less than 10d`)
                timeout(member, client.token, message, ms(time)).then(a=>{message.channel.send(`${member} has been timeout for ${time}`)})
        }
        }

if you need help, come on my discord : 999.Frost#0999

Readme

Keywords

Package Sidebar

Install

npm i discord-timeout-js

Weekly Downloads

21

Version

1.0.3

License

ISC

Unpacked Size

2.62 kB

Total Files

3

Last publish

Collaborators

  • 999.frost