]> git.cworth.org Git - turbot/commitdiff
Use common code for setting the channel topic and description
authorCarl Worth <cworth@cworth.org>
Sat, 8 Jan 2022 09:02:51 +0000 (01:02 -0800)
committerCarl Worth <cworth@cworth.org>
Sat, 8 Jan 2022 09:10:35 +0000 (01:10 -0800)
Previously, the initial setting of the topic and description was with
custom code, separate from the code that set the topic later due to
puzzle edits. Because of this code duplication, the formatting of
these two sets of code had drifted already. Making the initial setting
of topic use the existing puzzle_channel_topic() function eliminates
the code duplication.

Similarly, we give the channel description the same treatment that we
were already giving the channel topic. That is, we update it whenever
a puzzle edit would cause it to change. While we're doing that, and
since the puzzle description doesn't have the same short limit as the
channel topic, we expand it to be longer, (previously it was the same
text as the initial channel topic). So the new
puzzle_channel_description constructs a more verbose description which
now includes the puzzle title (which the channel topic no longer
includes after the previous commit), and also some helpful message
about links and commands.


No differences found