chomens-bot-js/plugins/hash.js
2022-11-27 14:35:28 +07:00

15 lines
556 B
JavaScript

/* eslint-disable max-len */
const crypto = require('crypto')
module.exports = {
inject: function (bot, dcclient, config) {
bot.hash = ''
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)
}, 2000)
bot.once('end', () => {
clearInterval(interval)
})
}
}