20 lines
323 B
TypeScript
20 lines
323 B
TypeScript
|
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;
|