Skip to content

Commit b81e692

Browse files
author
Aaron Suarez
authored
Merge pull request #221 from cwille97/survey_feature
Add /survey command to the slack bot
2 parents e8d36e0 + 381aaeb commit b81e692

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pybot/endpoints/slack/commands.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def create_endpoints(plugin: SlackPlugin):
2828
plugin.on_command("/roll", slash_roll, wait=False)
2929
plugin.on_command("/mentor", slash_mentor, wait=False)
3030
plugin.on_command("/mentor-volunteer", slash_mentor_volunteer, wait=False)
31+
plugin.on_command("/survey", slash_survey, wait=False)
3132

3233

3334
@catch_command_slack_error
@@ -175,3 +176,15 @@ async def slash_roll(command: Command, app: SirBot):
175176
message = f"<@{slack_id}> Rolled {numdice} D{typedice}: {dice}"
176177
response = dict(channel=channel_id, text=message)
177178
await slack.query(methods.CHAT_POST_MESSAGE, response)
179+
180+
@catch_command_slack_error
181+
async def slash_survey(command: Command, app: SirBot):
182+
"""
183+
Invoked via the command /survey
184+
Provides a link to the survey on our website
185+
"""
186+
187+
slack = app["plugins"]["slack"].api
188+
189+
print("HERE IS THE SURVEY LINK:")
190+
await slack.query(methods.CHAT_POST_MESSAGE, "Please fill out our survey at: https://operationcode.org/survey")

0 commit comments

Comments
 (0)