const { Telegraf } = require('telegraf') const bot = new Telegraf(process.env.BOT_TOKEN) const { UserModel, BlockModel } = global.config module.exports = async (ctx) => { let user = await UserModel.findByPk(ctx.from.id) if(!ctx.message.reply_to_message) return await ctx.reply(`Только на пересланное сообщение.`) let blocked = ctx.message.reply_to_message.from.id 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(`Пользователь заблокирован.`) }