mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:26:21 +02:00
Add NAME_RATER_EMOJI_NAME env var
This commit is contained in:
@@ -27,6 +27,7 @@ LOADING_EMOJI_ID=
|
||||
MEGA_EVOLVE_EMOJI_ID=
|
||||
MEGA_EVOLVE_EMOJI_NAME=
|
||||
NAME_RATER_EMOJI_ID=
|
||||
NAME_RATER_EMOJI_NAME=
|
||||
|
||||
# API Keys, IDs, and Secrets
|
||||
ANILIST_USERNAME=
|
||||
|
||||
@@ -27,7 +27,7 @@ Just read `LICENSE.md`. Give credit if you use any part of this monster, thanks.
|
||||
* `MOCKING_EMOJI_ID` and `MOCKING_EMOJI_NAME` are for **mocking**. Defaults to nothing, it just won't be there.
|
||||
* `PORTAL_EMOJI_ID` and `PORTAL_EMOJI_NAME` are for **portal-send**. Defaults to "PORTAL".
|
||||
* `MEGA_EVOLVE_EMOJI_ID` and `MEGA_EVOLVE_EMOJI_NAME` are for **pokedex**. Defaults to "MEGA".
|
||||
* `NAME_RATER_EMOJI_ID` is for **name-rater**. Defaults to nothing, it just won't be there.
|
||||
* `NAME_RATER_EMOJI_ID` and `NAME_RATER_EMOJI_NAME` are for **name-rater**. Defaults to nothing, it just won't be there.
|
||||
|
||||
#### API Keys, IDs, and Secrets
|
||||
* `ANILIST_USERNAME` is your username for [Anilist](https://anilist.co/home). Optional, defaults to "dragonfire535".
|
||||
|
||||
@@ -2,7 +2,7 @@ const Command = require('../../framework/Command');
|
||||
const { User } = require('discord.js');
|
||||
const { MersenneTwister19937, integer } = require('random-js');
|
||||
const texts = require('../../assets/json/name-rater');
|
||||
const { NAME_RATER_EMOJI_ID } = process.env;
|
||||
const { NAME_RATER_EMOJI_ID, NAME_RATER_EMOJI_NAME } = process.env;
|
||||
|
||||
module.exports = class NameRaterCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -51,11 +51,11 @@ module.exports = class NameRaterCommand extends Command {
|
||||
run(msg, { name }) {
|
||||
if (name instanceof User) name = name.username;
|
||||
if (name.toLowerCase() === this.client.user.username.toLowerCase()) {
|
||||
return msg.say(`<:nameRater:${NAME_RATER_EMOJI_ID}> Yes, ${name}! What a perfect name! I'm speechless!`);
|
||||
return msg.say(`<:${NAME_RATER_EMOJI_NAME}:${NAME_RATER_EMOJI_ID}> Yes, ${name}! What a perfect name! I'm speechless!`);
|
||||
}
|
||||
const random = MersenneTwister19937.seed(this.stringToSeed(name.toLowerCase()));
|
||||
const quality = integer(0, texts.length - 1)(random);
|
||||
return msg.say(`<:nameRater:${NAME_RATER_EMOJI_ID}> ${texts[quality].replace(/{{name}}/gi, name)}`);
|
||||
return msg.say(`<:${NAME_RATER_EMOJI_NAME}:${NAME_RATER_EMOJI_ID}> ${texts[quality].replace(/{{name}}/gi, name)}`);
|
||||
}
|
||||
|
||||
stringToSeed(str) {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "146.0.0",
|
||||
"version": "147.0.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"private": true,
|
||||
|
||||
Reference in New Issue
Block a user