functional queue

This commit is contained in:
2022-01-31 12:46:44 -06:00
parent 588365e558
commit aa0fffdc94
10 changed files with 272 additions and 37 deletions

12
dist/api.js vendored
View File

@@ -38,9 +38,11 @@ const https_1 = __importDefault(require("https"));
//while names cant have spaces, the name slot in ogtitle could be shown as "No Player Name" which has spaces
const uniteApiRegex = {
//$1 = name, $2 = id
ogtitle: /Unite API - ([\w\d ]+) \((.*)\)/,
ogtitle: /unite api - ([\w\d ]+) \((.*)\)/i,
//$1 = level, $2 = rank, $3 = elo, $4 = battles, $5 = wins, $6 = win rate
ogdescription: /Pokémon Unite : Lv.(\d+) (\w+) \((\d+)\)\n Battles : (\d+)\n Wins : (\d+)\n Win Rate : (\d+)%/,
ogdescription: /pokémon unite : lv\.(\d+) (\w+) \((\d+)\)\n battles : (\d+)\n Wins : (\d+)\n win rate : (\d+)%/i,
//for non-masters (no elo)
//ogdescription: /pokémon unite : lv\.(\d+) (\w+): class (\d+) *\n battles : (\d+) *\n wins : (\d+) *\n win rate : (\d+)%/i,
};
/*
og:title
@@ -152,12 +154,12 @@ exports.getPlayer = getPlayer;
function getPlayerInteraction(interaction) {
return __awaiter(this, void 0, void 0, function* () {
let username = interaction.options.getString('username', true);
interaction.deferReply();
yield interaction.deferReply();
let data = yield getPlayer(username);
if (data === null)
yield interaction.reply('Unable to find user');
yield interaction.editReply('Unable to find user');
else
yield interaction.reply('```\n' + JSON.stringify(data, null, 2) + '\n```');
yield interaction.editReply('```\n' + JSON.stringify(data, null, 2) + '\n```');
});
}
exports.getPlayerInteraction = getPlayerInteraction;