Add argument for if the user is imposter or not

This commit is contained in:
Dragon Fire
2021-02-12 16:10:00 -05:00
parent c985c46c2a
commit b2e15503e5
2 changed files with 12 additions and 4 deletions
+11 -3
View File
@@ -48,18 +48,26 @@ module.exports = class EjectCommand extends Command {
prompt: 'Which user would you like to edit the avatar of?',
type: 'user',
default: msg => msg.author
},
{
key: 'imposter',
prompt: 'Is the user an imposter?',
type: 'boolean',
default: ''
}
]
});
}
async run(msg, { user }) {
async run(msg, { user, imposter }) {
const avatarURL = user.displayAvatarURL({ format: 'png', size: 512 });
try {
const { body } = await request.get(avatarURL);
const avatar = await loadImage(body);
const random = MersenneTwister19937.seed(user.id);
const imposter = bool()(random);
if (imposter === '') {
const random = MersenneTwister19937.seed(user.id);
imposter = bool()(random);
}
const text = `${user.username} was${imposter ? ' ' : ' not '}An Imposter.`;
const encoder = new GIFEncoder(320, 180);
const canvas = createCanvas(320, 180);
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "129.5.0",
"version": "129.5.1",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {