{"size": 843, "ext": "js", "max_stars_repo_path": "commands/utility/remind.js", "max_stars_repo_name": "Day-Codes/fast-bot", "max_stars_repo_stars_event_min_datetime": "2020-11-12T08:41:56.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-05T11:22:28.000Z", "max_issues_repo_path": "commands/utility/remind.js", "max_issues_repo_name": "jacktotonchi/fast-bot", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "commands/utility/remind.js", "max_forks_repo_name": "jacktotonchi/fast-bot", "max_forks_repo_forks_event_min_datetime": "2021-05-03T23:56:58.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-13T01:09:26.000Z"}
{"max_stars_count": 9, "max_issues_count": null, "max_forks_count": 5, "avg_line_length": 22.7837837838, "max_line_length": 80, "alphanum_fraction": 0.6097271649}
const Command = require('../../structs/Command')
const ms = require('ms')

module.exports = class extends (
	Command
) {
	constructor(...args) {
		super(...args, {
			name: 'remind',
			aliases: ['reminder', 'setreminder', 'timer'],
			description:
				'Remind yourself about something in a certain in a certain amount of time.',
			category: ['Utility'],
			usage: 'remind <thing> <duration>',
		})
	}

	run(message, args) {
		const person = message.member
		const time = args.pop()
		const reminder = args.join(' ')

		if (!time) {
			message.react('👎')
			return message.channel.send(
				'Please specify in how long you would like to be reminded!'
			)
		}

		person.send(`Don't forget to **"${reminder}"** in **${ms(ms(time))}**`)

		setTimeout(() => {
			person.send(`It's that time! Make sure to **"${reminder}"**`)
		}, ms(time))
	}
}
