chomens-bot-js/plugins/hash.js
2022-10-30 07:43:37 +07:00

14 lines
561 B
JavaScript

/* eslint-disable max-len */
const crypto = require('crypto');
const config = require('../config');
module.exports = {
inject: function(bot) {
const interval = setInterval(() => {
bot.hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + config.keys.normalKey).digest('hex').substring(0, 16);
bot.ownerHash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + config.keys.ownerHashKey).digest('hex').substring(0, 16);
}, 5000);
bot.on('end', () => {
clearInterval(interval);
});
},
};