<commit_before>const Command = require("../types/Command");
const CreatureModel = require("../models/Creature");
const Discord = require("discord.js");
const TIMEOUT = 15000;
module.exports = class RandomCR extends Command{
	constructor(client){
		super(client, {
			name: "randomcr",
			help: "Fetches random creatures by CR.",
			category: "5e",
			helpArgs: "<Challenge Rating>",
			elevation: 0
		});

		this._menuLoop = async function(options, menuMessage, querier, page = 0){
			let toSend = [];
			toSend.push("Please say the number corresponding to the creature you meant.");
			toSend.push(`This search will be automatically cancelled in ${TIMEOUT/1000} seconds.\n`);
			for(let i = 10 * page; i < options.length && i < (10 * page) + 10; i++){
				toSend.push(`${i + 1}. ${options[i].name}`);
			}

			if(0 < page || 10 * page + 10 < options.length){
				toSend.push("");
			}
			if(0 < page){
				toSend.push("Reply with `back` to go back a page.");
			}
			if(10 * page + 10 < options.length){
				toSend.push("Reply with `next` to go forward a page.");
			}
			menuMessage  = await menuMessage.edit(toSend);
			let filter = (m) => {
				// Listen only for the querier's commands.
				// Return true if the value is in the content range OR<commit_msg>Make up for Discord.js bug<commit_after>const Command = require("../types/Command");
const CreatureModel = require("../models/Creature");
const Discord = require("discord.js");
const TIMEOUT = 15000;
module.exports = class RandomCR extends Command{
	constructor(client){
		super(client, {
			name: "randomcr",
			help: "Fetches random creatures by CR.",
			category: "5e",
			helpArgs: "<Challenge Rating>",
			elevation: 0
		});

		this._menuLoop = async function(options, menuMessage, querier, page = 0){
			let toSend = [];
			toSend.push("Please say the number corresponding to the creature you meant.");
			toSend.push(`This search will be automatically cancelled in ${TIMEOUT/1000} seconds.\n`);
			for(let i = 10 * page; i < options.length && i < (10 * page) + 10; i++){
				toSend.push(`${i + 1}. ${options[i].name}`);
			}

			if(0 < page || 10 * page + 10 < options.length){
				toSend.push("");
			}
			if(0 < page){
				toSend.push("Reply with `back` to go back a page.");
			}
			if(10 * page + 10 < options.length){
				toSend.push("Reply with `next` to go forward a page.");
			}
			menuMessage  = await menuMessage.edit(toSend.join("\n"));
			let filter = (m) => {
				// Listen only for the querier's commands.
				// Return true if the value is in the content range OR
{'fraction_non_alphanumeric': 0.15737833594976453, 'fraction_numerical': 0.022762951334379906, 'mean_word_length': 3.36472602739726, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4078450', 'n_tokens_mistral': 958, 'n_tokens_neox': 797, 'n_words': 259}