{"size": 942, "ext": "js", "max_stars_repo_path": "modules/config/cycle.js", "max_stars_repo_name": "TridentSecurity/Trident-Selfbot", "max_stars_repo_stars_event_min_datetime": "2021-02-24T06:16:22.000Z", "max_stars_repo_stars_event_max_datetime": "2021-05-17T16:38:23.000Z", "max_issues_repo_path": "modules/config/cycle.js", "max_issues_repo_name": "TridentSecurity/Trident-Selfbot", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "modules/config/cycle.js", "max_forks_repo_name": "TridentSecurity/Trident-Selfbot", "max_forks_repo_forks_event_min_datetime": "2021-03-15T15:12:21.000Z", "max_forks_repo_forks_event_max_datetime": "2021-03-15T15:12:21.000Z"}
{"max_stars_count": 3, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 28.5454545455, "max_line_length": 120, "alphanum_fraction": 0.6125265393}
let interval;
let i = 0;
module.exports.run = async (client, msg, args, config) => {

    if(config.cycle === "not set") return msg.reply('You have to set a cycle message in the config file first!')
    if(!interval) {
        msg.channel.send('starting cycle.')
        interval = setInterval(async function() { cycle(config, client, ["STREAMING", "PLAYING", "LISTENING"]) }, 7000)
        return;
    }

    clearInterval(interval)
    interval = null;
    msg.channel.send('Turned off cycle.')
    

}

async function cycle(config, client, arguments) {

    if(i >= 3) i = 0;
    await client.user.setActivity(config.cycle, { type: arguments[i] })
    i++
}

module.exports.help = {
    name:"cycle",
    usage:"*cycle",
    group: "config",
    example:"*cycle",
    ownerOnly: true,
    desc:"Cycles your status between Streaming, Watching and Listening. Custom message can be set in the config file.",
} 