Update bot.js
This commit is contained in:
parent
cb080fa7ed
commit
fb8771109a
14
bot.js
14
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(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user