Skip to content

Commit de38ded

Browse files
Add no-ai moderation reaction
1 parent bb422f4 commit de38ded

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ If a placeholder is channel-specific and the channel isn’t in the map, the `de
176176
| `faq` | FAQ_ASSISTANT | Answer the reacted message with the Cloudflare FAQ assistant. |
177177
| `error-log-to-thread-please` | REPOST_TO_THREAD_AND_DELETE | Move error log to thread, delete from channel. |
178178
| `no-screenshot` | SLACK_POST | Advise against code screenshots; link to guidelines. |
179+
| `no-ai` | SLACK_POST | Point to the AI usage guidelines. |
179180
| `shameless-rules` | DELETE_MESSAGE | Enforce shameless-promo rules; DM author. |
180181
| `jobs-rules` | DELETE_MESSAGE | Enforce job-posting rules; DM author. |
181182
| `ask-ai` | ASK_AI | Generate and post an AI reply in the thread. |

automator/src/config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ reactions:
119119
120120
Follow <{link}|these recommendations> to make it easier to help you.
121121
122+
- reaction: no-ai
123+
type: SLACK_POST
124+
message: >
125+
Please don't use AI to answer this question. See our AI usage guidelines:
126+
https://datatalks.club/docs/general/guidelines/ai-usage/
127+
122128
- reaction: shameless-rules
123129
type: DELETE_MESSAGE
124130
message: |

automator/tests/test_reactions_e2e.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747
ASKING_FOR_HELP_URL = (
4848
'https://datatalks.club/docs/general/guidelines/asking-for-help/'
4949
)
50+
AI_USAGE_GUIDELINES_URL = (
51+
'https://datatalks.club/docs/general/guidelines/ai-usage/'
52+
)
5053

5154

5255
def reaction_event(reaction, channel=CH_DE, ts='1700000000.000100', user='UMOD'):
@@ -96,6 +99,18 @@ def test_no_screenshot_resolves_link_per_channel(self, mock_slack):
9699
self.assertIn(expected_url, posted)
97100

98101

102+
class TestNoAiRouting(unittest.TestCase):
103+
"""no-ai posts the AI usage guidelines in the thread."""
104+
105+
@patch('automator_lambda_function.slack')
106+
def test_no_ai_posts_guidelines(self, mock_slack):
107+
deliver(reaction_event('no-ai'))
108+
109+
mock_slack.post_message_thread.assert_called_once()
110+
posted = mock_slack.post_message_thread.call_args[0][1]
111+
self.assertIn(AI_USAGE_GUIDELINES_URL, posted)
112+
113+
99114
class TestBeSpecificRouting(unittest.TestCase):
100115
"""be-specific points course channels to course guidance and others to general guidance."""
101116

0 commit comments

Comments
 (0)