mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-17 21:40:51 +02:00
Grade Command
This commit is contained in:
+4
-4
@@ -1,13 +1,13 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { above100, above92, above88, above80, below80 } = require('../../assets/json/final-grade-calculator');
|
||||
|
||||
module.exports = class FinalGradeCalculatorCommand extends Command {
|
||||
module.exports = class FinalGradeCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'final-grade-calculator',
|
||||
aliases: ['final-grade', 'roger-hub'],
|
||||
name: 'final-grade',
|
||||
aliases: ['final-grade-calculator', 'final-grade-calc', 'roger-hub'],
|
||||
group: 'number-edit',
|
||||
memberName: 'final-grade-calculator',
|
||||
memberName: 'final-grade',
|
||||
description: 'Determines the grade you need to make on your final to get your desired course grade.',
|
||||
args: [
|
||||
{
|
||||
@@ -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: 'number-edit',
|
||||
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