strfry-policies/replyGuy.ts

20 lines
323 B
TypeScript
Raw Permalink Normal View History

2024-09-15 15:51:23 -06:00
import { Policy } from '../types.ts';
const replyGuy: Policy<RegExp> = ({ event: { id, content } }, regex) => {
if (regex?.test(content)) {
return {
id,
action: 'reject',
msg: 'blocked: Reply Guy',
};
}
return {
id,
action: 'accept',
msg: '',
};
};
export default replyGuy;