Update bot.js

This commit is contained in:
Degradin 2025-01-05 01:19:16 +03:00
parent cb080fa7ed
commit fb8771109a

14
bot.js
View File

@ -1321,6 +1321,20 @@ bot.command('createpromocode', commands.createPromo)
bot.command('genpromo', commands.genPromo)
bot.command('ban', async (ctx) => {
const user = await UserModel.findByPk(ctx.from.id);
const [blocked] = ctx.message.text.split(' ').slice(1);
if(user.status != 'admin') return await ctx.reply(`Admin Only.`)
await BlockModel.create({
telegram_id: blocked,
isBlocked: true,
reason: `|AutoFastBlock|`,
time: Math.trunc(Date.now() / 1000 + 3600)
})
await bot.telegram.sendMessage(blocked, `Вы были заблокированы администратором ${user.username}.`)
return await ctx.reply(`Пользователь заблокирован.`)
});
///////////////////////////////////////Functions//////////////////////////////////////////////////////
setInterval(() => {