{"size": 692, "ext": "js", "max_stars_repo_path": "package/functions/funcs/lowestRole.js", "max_stars_repo_name": "kayke981/aoi.js-light", "max_stars_repo_stars_event_min_datetime": "2021-05-11T20:38:10.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-08T16:25:12.000Z", "max_issues_repo_path": "package/functions/funcs/lowestRole.js", "max_issues_repo_name": "kayke981/aoi.js-light", "max_issues_repo_issues_event_min_datetime": "2021-05-12T00:25:20.000Z", "max_issues_repo_issues_event_max_datetime": "2021-06-03T00:46:54.000Z", "max_forks_repo_path": "package/functions/funcs/lowestRole.js", "max_forks_repo_name": "kayke981/aoi.js-light", "max_forks_repo_forks_event_min_datetime": "2021-05-26T16:21:43.000Z", "max_forks_repo_forks_event_max_datetime": "2021-05-26T16:21:43.000Z"}
{"max_stars_count": 5, "max_issues_count": 2, "max_forks_count": 1, "avg_line_length": 36.4210526316, "max_line_length": 156, "alphanum_fraction": 0.5578034682}
module.exports = async d => {
    const code = d.command.code

    const inside = d.unpack()

    if (inside.inside) {
        const member = await d.message.guild.members.fetch(inside.inside).catch(err => {})

        if (!member) throw new Error(`:x: Invalid user ID in \`$lowestRole${inside}\``)

        else return {
            code: code.replaceLast(`$lowestRole${inside}`, (member.roles.cache.sort((x, y) => x.position - y.position).array().slice(1)[0] || "").id || "")
        }
    } else {
        return {
            code: code.replaceLast(`$lowestRole`, (d.message.member.roles.cache.sort((x, y) => x.position - y.position).array().slice(1)[0] || "").id || "")
        }
    }
}