From 5711e93321b7f874ed2226ef2107c5da7df267cf Mon Sep 17 00:00:00 2001 From: Dan Rosart Date: Sat, 3 Feb 2018 21:39:38 +0000 Subject: [PATCH] Make bot replies to puzzle and round creation requests contain links to the newly created thing, plus its containing thing. --- server/hubot-scripts/codex.coffee | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/hubot-scripts/codex.coffee b/server/hubot-scripts/codex.coffee index b0cdc01bc..c0b16f5d7 100644 --- a/server/hubot-scripts/codex.coffee +++ b/server/hubot-scripts/codex.coffee @@ -180,7 +180,9 @@ share.hubot.codex = (robot) -> round: round.object._id puzzle: puzzle._id who: who - msg.reply useful: true, "Okay, I added #{puzzle.name} to #{round.object.name}." + puzz_url = Meteor._relativeToSiteRootUrl "/puzzles/#{puzzle._id}" + round_url = Meteor._relativeToSiteRootUrl "/rounds/#{round.object._id}" + msg.reply {useful: true, bodyIsHtml: true}, "Okay, I added #{UI._escape puzzle.name} to #{UI._escape round.object.name}." msg.finish() # deletePuzzle @@ -230,7 +232,9 @@ share.hubot.codex = (robot) -> unless res msg.reply useful: true, "Something went wrong (couldn't add round to group)" return - msg.reply useful: true, "Okay, I created round \"#{rname}\" in #{group.object.name}." + round_url = Meteor._relativeToSiteRootUrl "/rounds/#{round._id}" + group_url = Meteor._relativeToSiteRootUrl "/roundgroups/#{group.object._id}" + msg.reply {useful: true, bodyIsHtml: true}, "Okay, I created round #{UI._escape rname} in #{UI._escape group.object.name}." msg.finish() # deleteRound