+@app.route('/rot', methods = ['POST'])
+def rot_route():
+ """Implements the /rot slash command for Slack replying in Slack
+
+ The format of this command is as follows:
+
+ /rot [count|*] String to be rotated
+
+ The optional count indicates an amount to rotate each character in the
+ string. If the count is '*' or is not present, then the string will
+ be rotated through all possible 25 values.
+
+ The result of the rotation is provided as a message in Slack. If the
+ slash command was issued in a direct message, the response is made by
+ using the "response_url" from the request. This allows the bot to reply
+ in a direct message that it is not a member of. Otherwise, if the slash
+ command was issued in a channel, the bot will reply in that channel."""
+
+ if not slack_is_valid_request(request):
+ return make_response("invalid request", 403)
+
+ text = request.form.get('text')
+
+ reply = rot(text)
+
+ slack_send_reply(request, reply)
+
+ return ""
+
+