This repository has been archived by the owner on Nov 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the "rank" command to allow speedrunners to pull their specific stats in the general categories. The new command has the form: rank <playername> <category> <type> playername = name in the speedrun sheet category = 3star, 4star, 5star, or Torment (defaults to 4star) type = overall or no-csb (defaults to overall)
- Loading branch information
Showing
4 changed files
with
401 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
const {Command} = require('discord.js-commando'); | ||
const path = require('path'); | ||
speedrankPath = path.join(__dirname, | ||
'..', '..', 'utilities', 'speedrank-utils.js'); | ||
const speedrankUtils = require('../../utilities/speedrank-utils.js'); | ||
|
||
module.exports = class ReplyCommand extends Command { | ||
/** constructor for looking up soulbreaks. | ||
* @param {Object} client: discord.js-commando client. | ||
**/ | ||
constructor(client) { | ||
super(client, { | ||
name: 'rank', | ||
group: 'misc', | ||
memberName: 'speedrank', | ||
description: 'Looks up all the entries for a given speedrunner in a specified leaderboard' + | ||
' from the FFRecordKeeper Discord Speedrun challenge leaderboard' + | ||
' (https://docs.google.com/spreadsheets/d/11gTjAkpm4D3uoxnYCN7ZfbiVnKyi7tmm9Vp9HvTkGpw).', | ||
examples: ['rank EverythingIsGravy 5star', 'top 10 no-csb', 'top 5 cod', 'top 3 Maliris'], | ||
args: [ | ||
{ | ||
key: 'name', | ||
prompt: 'Enter the speedrunner you want to query.' + | ||
' Make sure you use the name as it appears in the spreadsheet.', | ||
type: 'string', | ||
default: 'EverythingIsGravy', | ||
}, | ||
{ | ||
key: 'category', | ||
prompt: 'Enter the name of the category you want to look up.' + | ||
' (Can be "5star", "4star", "3star", or "Torment" ' + | ||
' on the chart. The default is "4star")', | ||
type: 'string', | ||
default: '4star', | ||
}, | ||
{ | ||
key: 'secondaryCategory', | ||
prompt: 'Specify if you want the overall or no-csb ranking' + | ||
' no-csb does not apply to Torment' + | ||
' (defaults to "overall".)', | ||
type: 'string', | ||
default: 'overall', | ||
}, | ||
], | ||
aliases: ['speedrank'], | ||
}); | ||
} | ||
|
||
/** trigger to run upon invocation. | ||
* @param {Object} msg: discord.js-commando message. | ||
* @param {Array} args: args from the user input. | ||
* @return {Method} msg.say: string | ||
**/ | ||
run(msg, args) { | ||
console.log('Im in ur msg'); | ||
const {name, category, secondaryCategory} = args; | ||
return speedrankUtils.speedrank(msg, name, category, secondaryCategory) | ||
.catch( (err) => { | ||
console.log('error in speedrank command:', err); | ||
}); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.