mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-07 23:05:04 +02:00
Use BigInt for correct ship math
This commit is contained in:
@@ -50,7 +50,8 @@ module.exports = class ShipCommand extends Command {
|
||||
|
||||
async run(msg, { first, second }) {
|
||||
if (first.id === second.id) return msg.reply('Shipping someone with themselves would be pretty weird.');
|
||||
const random = MersenneTwister19937.seed(Math.abs(first.id - second.id));
|
||||
const calculated = Math.abs(Number.parseInt(BigInt(first.id) - BigInt(second.id), 10));
|
||||
const random = MersenneTwister19937.seed(calculated);
|
||||
const level = integer(0, 100)(random);
|
||||
const firstAvatarURL = first.displayAvatarURL({ format: 'png', size: 512 });
|
||||
const secondAvatarURL = second.displayAvatarURL({ format: 'png', size: 512 });
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "113.0.4",
|
||||
"version": "113.0.5",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user