Skip to content

Commit c86730f

Browse files
author
wimo7083
committed
advertise this guy
1 parent 1d86bf7 commit c86730f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

pybot/endpoints/slack/messages.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff 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

2223
def 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+
3039
async 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'}

0 commit comments

Comments
 (0)