kowalski-sw/Middleware.js

9 lines
243 B
JavaScript
Raw Normal View History

2024-07-28 13:31:24 -03:00
module.exports = (isOnSpamWatch) => {
return async (ctx, next) => {
if (await isOnSpamWatch(ctx.from.id)) {
console.log(`User ${ctx.from.id} is banned on SpamWatch. Blocking command.`);
return;
}
await next();
};
};