]> git.cworth.org Git - turbot/commit
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)
commit8e9a333cdc4118878bdf6ece9ee7456644fd1342
tree6b4e2e898caf57f707136595b5ee6b338c1f787d
parent13323b025f64765f40e63712981cc4c2ffff0394
Use common code for setting the channel topic and description

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.
turbot/events.py
turbot/puzzle.py