Mirror of https://github.com/roostorg/osprey
github.com/roostorg/osprey
1Import(
2 rules=[
3 'models/base.sml',
4 'models/post.sml',
5 ]
6)
7
8ContainsHello = Rule(
9 when_all=[
10 EventType == 'create_post',
11 TextContains(text=PostText, phrase='hello')
12 ],
13 description='Post contains the word "hello"',
14)
15
16WhenRules(
17 rules_any=[ContainsHello],
18 then=[
19 BanUser(entity=UserId, comment='User said "hello"'),
20 LabelAdd(entity=UserId, label='meow'),
21 ],
22)