X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=turbot%2Fpuzzle.py;h=08e86218738bbfba6cdeff598ded4acdfb758cec;hb=5e7ee7c20f71996cedd04586d7139250c6704c0d;hp=f2816acb5b42b5903c3587060bc03680e706d670;hpb=ee51d944119832b3272bf0bbd330066d6dd5d658;p=turbot diff --git a/turbot/puzzle.py b/turbot/puzzle.py index f2816ac..08e8621 100644 --- a/turbot/puzzle.py +++ b/turbot/puzzle.py @@ -242,11 +242,21 @@ def puzzle_channel_topic(puzzle): def puzzle_channel_name(puzzle): """Compute the channel name for a puzzle""" + round = '' + if 'rounds' in puzzle: + round = '-' + puzzle_id_from_name(puzzle['rounds'][0]) + + meta = '' + if puzzle.get('type', 'plain') == 'meta': + meta = '-m' + # Note: We don't use puzzle['puzzle_id'] here because we're keeping # that as a persistent identifier in the database. Instead we # create a new ID-like identifier from the current name. - channel_name = "{}-{}".format( + channel_name = "{}{}{}-{}".format( puzzle['hunt_id'], + round, + meta, puzzle_id_from_name(puzzle['name']) )