File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ def create_endpoints(plugin):
1717 plugin .on_message (".*\<\!channel\>" , here_bad )
1818 plugin .on_message (".*@here" , here_bad )
1919 plugin .on_message (".*@channel" , here_bad )
20+ plugin .on_message (".*\!pybot" , advertise_pybot )
2021
2122
2223def not_bot_message (event : Message ):
@@ -27,6 +28,14 @@ def not_bot_delete(event: Message):
2728 return 'previous_message' not in event or 'bot_id' not in event ['previous_message' ]
2829
2930
31+ def advertise_pybot (event : Message , app : SirBot ):
32+ BOT_URL = 'https://github.com/OperationCode/operationcode-pybot'
33+ response = {'channel' : event ['channel' ],
34+ 'text' : f'OC-Community-Bot is a communit led project to assist operation code.'
35+ f'\n < { BOT_URL } | source> ' }
36+ await app .plugins ["slack" ].api .query (methods .CHAT_POST_MESSAGE , data = response )
37+
38+
3039async def here_bad (event : Message , app : SirBot ):
3140 response = {'channel' : event ['channel' ],
3241 'text' : f'<@{ event ["user" ]} > - you are a very bad person for using that command' }
You can’t perform that action at this time.
0 commit comments