mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-23 18:05:01 +02:00
Grade Command
This commit is contained in:
@@ -15,7 +15,7 @@ Xiao is a Discord bot coded in JavaScript with
|
|||||||
The bot is no longer available for invite. You can self-host the bot, or use her
|
The bot is no longer available for invite. You can self-host the bot, or use her
|
||||||
on the [home server](https://discord.gg/sbMe32W).
|
on the [home server](https://discord.gg/sbMe32W).
|
||||||
|
|
||||||
## Commands (316)
|
## Commands (317)
|
||||||
### Utility:
|
### Utility:
|
||||||
|
|
||||||
* **eval:** Executes JavaScript code.
|
* **eval:** Executes JavaScript code.
|
||||||
@@ -343,7 +343,8 @@ on the [home server](https://discord.gg/sbMe32W).
|
|||||||
|
|
||||||
* **character-count:** Responds with the character count of text.
|
* **character-count:** Responds with the character count of text.
|
||||||
* **currency:** Converts currency from one currency to another.
|
* **currency:** Converts currency from one currency to another.
|
||||||
* **final-grade-calculator:** Determines the grade you need to make on your final to get your desired course grade.
|
* **grade:** Determines your grade on an assignment on an 100-point scale.
|
||||||
|
* **final-grade:** Determines the grade you need to make on your final to get your desired course grade.
|
||||||
* **gravity:** Determines weight on another planet.
|
* **gravity:** Determines weight on another planet.
|
||||||
* **math:** Evaluates a math expression.
|
* **math:** Evaluates a math expression.
|
||||||
* **prime:** Determines if a number is a prime number.
|
* **prime:** Determines if a number is a prime number.
|
||||||
|
|||||||
+4
-4
@@ -1,13 +1,13 @@
|
|||||||
const Command = require('../../structures/Command');
|
const Command = require('../../structures/Command');
|
||||||
const { above100, above92, above88, above80, below80 } = require('../../assets/json/final-grade-calculator');
|
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) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'final-grade-calculator',
|
name: 'final-grade',
|
||||||
aliases: ['final-grade', 'roger-hub'],
|
aliases: ['final-grade-calculator', 'final-grade-calc', 'roger-hub'],
|
||||||
group: 'number-edit',
|
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.',
|
description: 'Determines the grade you need to make on your final to get your desired course grade.',
|
||||||
args: [
|
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...'}`);
|
||||||
|
}
|
||||||
|
};
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "91.10.4",
|
"version": "91.11.0",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user