mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-23 10:02:05 +02:00
More uniform group names
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class GradeCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'grade',
|
||||
aliases: ['grade-calculator', 'grade-calc'],
|
||||
group: 'edit-number',
|
||||
memberName: 'grade',
|
||||
description: 'Determines your grade on an assignment on an 100-point scale.',
|
||||
args: [
|
||||
{
|
||||
key: 'earned',
|
||||
label: 'points earned',
|
||||
prompt: 'How many points did you get?',
|
||||
type: 'integer',
|
||||
min: 0
|
||||
},
|
||||
{
|
||||
key: 'total',
|
||||
label: 'total points',
|
||||
prompt: 'How many points are available to recieve?',
|
||||
type: 'integer',
|
||||
min: 0
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { earned, total }) {
|
||||
const score = Math.round((earned / total) * 100);
|
||||
return msg.reply(`Your score is a **${score}%**${score >= 70 ? '! Nice job!' : '... Too bad...'}`);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user