diff --git a/bot.js b/bot.js index 7671701..87c753d 100644 --- a/bot.js +++ b/bot.js @@ -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(() => {