]> git.cworth.org Git - turbot/log
turbot
3 years agoLive fix for apparently overflowing the Slack message limit with hunt details
Carl Worth [Sat, 16 Jan 2021 15:47:45 +0000 (07:47 -0800)]
Live fix for apparently overflowing the Slack message limit with hunt details

Condense the Turbot Home view to only link to hunts, not give all the
details.

Change hunt_blocks() function to return an array of array of blocks,
(broken up at the level of a round). Callers now generate one post for
each element in the outer array. Hopefully this gives us a little
breathing room for now.

3 years agoAdd some recent TODO items
Carl Worth [Sat, 16 Jan 2021 15:44:27 +0000 (07:44 -0800)]
Add some recent TODO items

These obviously aren't going to happen or this year, but we can
consider them for future years.

3 years agoWhen creating a new puzzle, set default rounds based on current puzzle
Carl Worth [Wed, 13 Jan 2021 04:15:46 +0000 (20:15 -0800)]
When creating a new puzzle, set default rounds based on current puzzle

This happens when running the puzzle creation command, (/new,
/puzzle new, or /new puzzle), from an existing channel.

This should hopefully help people avoid forgetting to set the rounds
for a new puzzle.

3 years agoSwitch from using append() to update() for inserting into a spreadsheet
Carl Worth [Wed, 13 Jan 2021 04:03:36 +0000 (20:03 -0800)]
Switch from using append() to update() for inserting into a spreadsheet

The append() method was the entirely wrong thing: It puts data in as
new rows below existing data. The update() method does what we want,
(sets data at a specific range).

3 years agoUse a double dash separator for the m in the channel name of metapuzzles
Carl Worth [Tue, 12 Jan 2021 02:06:10 +0000 (18:06 -0800)]
Use a double dash separator for the m in the channel name of metapuzzles

The double dash is what will make the meta puzzles sort before all
non-metapuzzled.

3 years agoUse consistent channel naming at puzzle creation time
Carl Worth [Tue, 12 Jan 2021 01:56:47 +0000 (17:56 -0800)]
Use consistent channel naming at puzzle creation time

We've had a bug for some time where the puzzle editing code would
construct a name for the puzzle channel based on hunt, and round, and
puzzle type, and puzzle_id but the puzzle creation code was only using
hunt and puzzle_id.

In this commit, we fix the puzzle creation code to use the same
puzzle_channel_name function so that channel names are created
consistently.

This commit also adds a check to reject a puzzle if it has the same
puzzle_id as an existing puzzle.

3 years agoAdd find_puzzle_for_puzzle_id
Carl Worth [Tue, 12 Jan 2021 01:53:36 +0000 (17:53 -0800)]
Add find_puzzle_for_puzzle_id

This exists so that the puzzle-creation code can ensure that it's not
creating a puzzle with the same puzzle_id as an existing
puzzle. Previously, Turbot was just relying on Slack to guarantee
uniqueness, (which worked when channel names were just made from
hunt_id and puzzle_id).

But more recently, the channel names have round names in them as
well. This set up a possible collision where two puzzle with the same
puzzle_id could be created but with different channel names, (if the
two puzzles were placed in different rounds). To be able to fix this
bug we need this query to be able to find a puzzle by means of using
the puzzle_id.

This does require a new index on the database, so that's here too,
(and we're nuking our database to be able to roll this out).

3 years agoFix comment string for find_puzzle_for_sort_key
Carl Worth [Tue, 12 Jan 2021 01:52:40 +0000 (17:52 -0800)]
Fix comment string for find_puzzle_for_sort_key

The documentation here was stale and still referring to puzzle_id even
though this function is actually using sort_key, (which is similar but
is also slightly different).

3 years agoTighten up the welcome messages for a new hunt and a new puzzle
Carl Worth [Tue, 12 Jan 2021 00:50:29 +0000 (16:50 -0800)]
Tighten up the welcome messages for a new hunt and a new puzzle

And point to `/help` in both cases for more details.

3 years agoExpand list of pop-culture items to include video games
Carl Worth [Mon, 11 Jan 2021 22:25:06 +0000 (14:25 -0800)]
Expand list of pop-culture items to include video games

Perhaps bringing this list more up-to-date, (and also quite compatible
with the proclivities of ✈✈✈ Galactic Trendsetters ✈✈✈ who are writing
this year).

3 years agoDrop names of specific people from the have-you-tried list
Carl Worth [Mon, 11 Jan 2021 22:24:27 +0000 (14:24 -0800)]
Drop names of specific people from the have-you-tried list

Replacing this list with "relevant team experts".

3 years agoFix `/help me` to not give a dispatch_failed error in a private channel
Carl Worth [Mon, 11 Jan 2021 21:56:20 +0000 (13:56 -0800)]
Fix `/help me` to not give a dispatch_failed error in a private channel

Since Turbot can't send a message to a private channel, instead we
just reply as an ephemeral message to the user.

3 years agoMake "/help me" self-documenting
Carl Worth [Mon, 11 Jan 2021 21:09:52 +0000 (13:09 -0800)]
Make "/help me" self-documenting

So that when people see others doing this, they will know how to do it too.

3 years agoImplement a new "/help me" command that suggests something to try
Carl Worth [Mon, 11 Jan 2021 20:53:34 +0000 (12:53 -0800)]
Implement a new "/help me" command that suggests something to try

Thanks to Acme for the original "Have you tried" list as obtained from:

    http://web.mit.edu/puzzle/www/resources.html

as:

    http://web.mit.edu/puzzle/www/resources/haveyoutried.pdf

3 years agoAdd an initial implementation of /help
Carl Worth [Mon, 11 Jan 2021 20:21:29 +0000 (12:21 -0800)]
Add an initial implementation of /help

So that Turbot can be self-documenting.

3 years agoUpdate hunt welcome message to refer to `/puzzle new`
Carl Worth [Mon, 11 Jan 2021 18:09:38 +0000 (10:09 -0800)]
Update hunt welcome message to refer to `/puzzle new`

Previously it was pointing the users at `/puzzle` which is no longer
the correct command to use.

3 years agoFix call to find_hunt_for_hunt_id
Carl Worth [Mon, 11 Jan 2021 17:58:12 +0000 (09:58 -0800)]
Fix call to find_hunt_for_hunt_id

It takes two parameters, not one, (was missing "turb" argument).

This should fix the edit_hunt button (the pencil) which was erroring
out while this bug was present.

3 years agoDrop use of response_url in button handlers
Carl Worth [Mon, 11 Jan 2021 17:54:57 +0000 (09:54 -0800)]
Drop use of response_url in button handlers

Some buttons appear in a context, (like the app's "Home" view), where
there is no response_url, (we can't generate a message there). So we
can't rely on this. And we don't need to anyway, we can use the string
in the reteurn value to get an error message out to the user.

This commit should fix a bunch of broken puzzle edits button in the
Turbot "home" view.

3 years agoUpdate TODO now that "/hunt edit" has been added
Carl Worth [Mon, 11 Jan 2021 17:01:08 +0000 (09:01 -0800)]
Update TODO now that "/hunt edit" has been added

This closes out the last item we had as a required change prior to
Mystery Hunt 2021.

3 years agoMake /edit command smart to auto-edit either puzzle or hunt
Carl Worth [Mon, 11 Jan 2021 16:25:20 +0000 (08:25 -0800)]
Make /edit command smart to auto-edit either puzzle or hunt

Depending on which kind of channel it is run in. It's still possible to
explicitly run `/edit puzzle` or `/edit hunt` instead.

3 years agoAdd a pencil-shaped "edit hunt" button when displaying a hunt
Carl Worth [Mon, 11 Jan 2021 16:07:03 +0000 (08:07 -0800)]
Add a pencil-shaped "edit hunt" button when displaying a hunt

So that editing a hunt can be just as convenient as editing a puzzle.

3 years agoWire up "/edit hunt" to be the same as "/hunt edit"
Carl Worth [Mon, 11 Jan 2021 16:03:30 +0000 (08:03 -0800)]
Wire up "/edit hunt" to be the same as "/hunt edit"

Just as we did for "/edit" and "/edit puzzle" before.

3 years agoAdd a "/hunt edit" command
Carl Worth [Mon, 11 Jan 2021 16:00:40 +0000 (08:00 -0800)]
Add a "/hunt edit" command

We expect this to be useful for a situation like Mystery Hunt where we
create the hunt and its channel in advance, invite all the users to
it, and then only later do we learn what the URL of the hunt actually
is.

3 years agoAdd "/new hunt" as a new sub-command of "/new"
Carl Worth [Sun, 10 Jan 2021 23:41:57 +0000 (15:41 -0800)]
Add "/new hunt" as a new sub-command of "/new"

This means we now have both "/hunt new" as well as "/new hunt" that
both do the same things. I'm not sure we'll want to keep both around
long-term, but they are both here now so that we can experiment and
see which feels more natural.

3 years agoUpdate TOOD with two recently-completed items
Carl Worth [Sun, 10 Jan 2021 21:33:17 +0000 (13:33 -0800)]
Update TOOD with two recently-completed items

There is a new "/hunt new" command now and puzzle sheets are now created
in a folder named after the hunt.

3 years agoCreate puzzle sheets in the hunt folder
Carl Worth [Sun, 10 Jan 2021 21:24:25 +0000 (13:24 -0800)]
Create puzzle sheets in the hunt folder

This will be much nicer to keep our content organized within Google
drive. There will be one folder for each hunt rather than all the
various hunts' puzzles all mixed together at the root level.

3 years agoUse the Google drive API to create a hunt's sheet within a folder
Carl Worth [Sun, 10 Jan 2021 17:52:27 +0000 (09:52 -0800)]
Use the Google drive API to create a hunt's sheet within a folder

When a hunt is created, we create a folder in Google drive named
after the hunt_id and the create the hunt's sheet in that folder.

In future commits, we'll change the puzzle sheets to also be created
in this hunt's folder. This way, with all resources in one folder,
that folder can be shared out to members of the hunt, (this could
be used as an alternate access to hunt resources if Slack is not
available for any reason).

3 years agoRename identifier from item to hunt
Carl Worth [Sun, 10 Jan 2021 17:51:15 +0000 (09:51 -0800)]
Rename identifier from item to hunt

The dynamodb API uses the generic term "item", but our code is more
clear with the more distinctive term "hunt" for the identifier here.

This commit has no functional change.

3 years agoImplement "/hunt new" as a way to make a new hunt
Carl Worth [Sun, 10 Jan 2021 16:36:05 +0000 (08:36 -0800)]
Implement "/hunt new" as a way to make a new hunt

This is more convenient than seeking out the Turbot app's Home tab.

3 years agoRemove a line of dead code
Carl Worth [Sun, 10 Jan 2021 16:35:05 +0000 (08:35 -0800)]
Remove a line of dead code

A second return statement after an unconditional return statement
obviously cannot do anything.

3 years agoFix to work with old puzzles that don't have a type attribute
Carl Worth [Sat, 9 Jan 2021 22:39:39 +0000 (14:39 -0800)]
Fix to work with old puzzles that don't have a type attribute

Without this, commands like /state and /puzzle on old puzzle just die.

3 years agoAllow tag values to have numbers
Carl Worth [Sat, 9 Jan 2021 22:37:10 +0000 (14:37 -0800)]
Allow tag values to have numbers

There was unanimous consent that this could be useful, and it's an
easy change.

3 years agoAdd 4 new TODO items
Carl Worth [Sat, 9 Jan 2021 22:36:18 +0000 (14:36 -0800)]
Add 4 new TODO items

Just the last few fixes we've identified we want to have in place
before the hunt next week.

3 years agoPut the puzzle's name into the first tab of the sheet
Carl Worth [Sat, 9 Jan 2021 16:06:31 +0000 (08:06 -0800)]
Put the puzzle's name into the first tab of the sheet

Just to make it that much easier to tell apart multiple sheet windows
that a user might have to juggle.

3 years agoUpdate the TODO list for a couple of recently-completed items
Carl Worth [Sat, 9 Jan 2021 16:03:15 +0000 (08:03 -0800)]
Update the TODO list for a couple of recently-completed items

We got rid of that "Copy of" text in the sheet tabs, and we also put
the round name into the Slack channel.

3 years agoAdd both round and "-m" (for META), if appropriate, into channel name
Carl Worth [Sat, 9 Jan 2021 15:52:41 +0000 (07:52 -0800)]
Add both round and "-m" (for META), if appropriate, into channel name

For better grouping of related puzzles in the channel list

3 years agoUse best-practice <@user_id> to mention a user in Slack
Carl Worth [Sat, 9 Jan 2021 15:45:37 +0000 (07:45 -0800)]
Use best-practice <@user_id> to mention a user in Slack

This way Slack expands this as a link to the user's full name.

3 years agoCollapse link text inserted into sheets
Carl Worth [Sat, 9 Jan 2021 15:31:13 +0000 (07:31 -0800)]
Collapse link text inserted into sheets

Since we have functional links here we don't need to include the full
URL as part of the link text.

3 years agoRewrite all of sheets.py to look a little more like turbot code
Carl Worth [Sat, 9 Jan 2021 15:19:21 +0000 (07:19 -0800)]
Rewrite all of sheets.py to look a little more like turbot code

The only actual intended behavioral change here is that the puzzle
sheet's now nuke the blank first sheet, (and instead have only sheets
copied over from the template).

3 years agoRename each sheet we copy from the template
Carl Worth [Sat, 9 Jan 2021 14:29:42 +0000 (06:29 -0800)]
Rename each sheet we copy from the template

To get rid of the silly "Copy of" text that we don't need.

3 years agoFix sheet creation to copy all sheets from our template
Carl Worth [Sat, 9 Jan 2021 13:47:33 +0000 (05:47 -0800)]
Fix sheet creation to copy all sheets from our template

Nathan put a lot of word into this template sheet, so it was a shame
the sheets weren't all coming over. It turned out the only reason that
was the case is that the code has a hard-coded list of names of sheets
to copy, (and that, only because I haven't yet figured out the API for
enumerating sheets).

For now, just update the hardcoded list to match what's in the current
template.

3 years agoUpdate TODO for recent addition of /tag command
Carl Worth [Sat, 9 Jan 2021 13:42:59 +0000 (05:42 -0800)]
Update TODO for recent addition of /tag command

This _almost_ completed the feature as intended. In fact, it went
further in one way in that it's already storing the tags in a field
that is separate from the state string. But it's falling short in that
the edit interface is not currently showing the tags at all.

3 years agoAdd hint to expand search terms if implicitly filtered
Carl Worth [Sat, 9 Jan 2021 13:39:30 +0000 (05:39 -0800)]
Add hint to expand search terms if implicitly filtered

I keep accidentally missing some search results when testing because
I'm searching for a tag that only exists on a solved puzzle so something
like:

/hunt cryptic

is not finding the solved puzzle with the CRYTPIC tag due to the
implicit filtering to only unsolved puzzles.

I still want that implicit filtering, but maybe this nudge will be
helpful in cases like this.

3 years agoExtend puzzle search to include type and tags
Carl Worth [Sat, 9 Jan 2021 13:21:43 +0000 (05:21 -0800)]
Extend puzzle search to include type and tags

The matching on puzzle type means you can now do:

/hunt meta

or:

/hunt plain

to see all meta or non-meta puzzles.

And the matching on tags should be obvious.

3 years agoUse a deep copy when comparing a puzzle to detect state modifications
Carl Worth [Sat, 9 Jan 2021 13:16:20 +0000 (05:16 -0800)]
Use a deep copy when comparing a puzzle to detect state modifications

Since the recent tags is an array, we need a deep copy of the puzzle dict
in order to be able to reliably compare the puzzle prior to the copy with
the one after the copy where a tag has been added or removed.

With this fix, adding or removing a tag now reliably updates the channel
description.

3 years agoAdd a /tag command to add or remove tags from puzzle
Carl Worth [Sat, 9 Jan 2021 13:04:28 +0000 (05:04 -0800)]
Add a /tag command to add or remove tags from puzzle

And put the tag values everywhere we have the state string already.

3 years agoAdd two new shortcut commands:
Carl Worth [Sat, 9 Jan 2021 12:27:35 +0000 (04:27 -0800)]
Add two new shortcut commands:

/new Which is the same as: /puzzle new
        /edit Which is the same as: /puzzle edit

I don't know if this is cleaner or messier, but I can at least put it
out there as an option.

3 years agoFor /puzzle on meta puzzles print all titles/answers of feeder puzzles
Carl Worth [Sat, 9 Jan 2021 11:59:02 +0000 (03:59 -0800)]
For /puzzle on meta puzzles print all titles/answers of feeder puzzles

Where feeder puzzles are specifically defined as puzzle belonging to the
same round.

3 years agoPut solution after puzzle name in /hunt reports
Carl Worth [Sat, 9 Jan 2021 11:27:27 +0000 (03:27 -0800)]
Put solution after puzzle name in /hunt reports

The concept here is to keep the puzzle names aligned to make it easier
to find a puzzle of interest in the sorted list.

3 years agoAdd a divider between rounds in the /hunt output
Carl Worth [Sat, 9 Jan 2021 11:22:25 +0000 (03:22 -0800)]
Add a divider between rounds in the /hunt output

Just to make it a little easier to see the grouping of rounds.

3 years agoTODO: Update for two recently-completed meta items
Carl Worth [Sat, 9 Jan 2021 11:20:34 +0000 (03:20 -0800)]
TODO: Update for two recently-completed meta items

The punch list is getting short now...

3 years agoSort all meta puzzles before all non-meta puzzle in puzzle lists
Carl Worth [Sat, 9 Jan 2021 10:57:07 +0000 (02:57 -0800)]
Sort all meta puzzles before all non-meta puzzle in puzzle lists

This is in the output of /hunt, /round, and the Turbot home view.

3 years agonew_puzzle_submission: Create a puzzle dict before shoving it into the DB
Carl Worth [Sat, 9 Jan 2021 10:47:57 +0000 (02:47 -0800)]
new_puzzle_submission: Create a puzzle dict before shoving it into the DB

This will be handy for calling some puzzle.py functions that expect a dict.

3 years agoAdd a "meta" checkbox when creating/editing a puzzle
Carl Worth [Sat, 9 Jan 2021 10:36:20 +0000 (02:36 -0800)]
Add a "meta" checkbox when creating/editing a puzzle

And display all meta puzzles with a bold "META" prefix.

3 years agoFix a typo in a comment
Carl Worth [Sat, 9 Jan 2021 10:35:23 +0000 (02:35 -0800)]
Fix a typo in a comment

This comment was supposed to refer to puzzle_id, not hunt_id, which
made it confusing for me until I fixed it as in this commit.

3 years agoImplement a /round command
Carl Worth [Sat, 9 Jan 2021 09:19:57 +0000 (01:19 -0800)]
Implement a /round command

This is much like the /hunt command with searching, etc. but with two
differences:

  1. It is limited to display puzzles in the same round(s) as the
     current puzzle

  2. It defaults to display all puzzles rather than unsolved puzzles
     like /hunt does

3 years agoImplement a `/puzzle edit` command
Carl Worth [Sat, 9 Jan 2021 08:39:57 +0000 (00:39 -0800)]
Implement a `/puzzle edit` command

As a simple shortcut rather than making the user type `/puzzle` and
then click the pencil icon.

3 years agoReport change in a puzzle's solved status to the main hunt channel
Carl Worth [Sat, 9 Jan 2021 08:32:18 +0000 (00:32 -0800)]
Report change in a puzzle's solved status to the main hunt channel

We were already doing this from the /solved command but now we do it
for puzzle edits as well.

3 years agoPut a message into the channel when a user edits a puzzle
Carl Worth [Sat, 9 Jan 2021 08:26:24 +0000 (00:26 -0800)]
Put a message into the channel when a user edits a puzzle

So that other members of the puzzle are informed that something has changed.

3 years agoAdd display of round(s) in /puzzle output
Carl Worth [Sat, 9 Jan 2021 08:00:22 +0000 (00:00 -0800)]
Add display of round(s) in /puzzle output

Making the output more complete (while still remaining quite compact).

3 years agoAdd new /puzzle command which simply prints the current puzzle
Carl Worth [Sat, 9 Jan 2021 07:51:32 +0000 (23:51 -0800)]
Add new /puzzle command which simply prints the current puzzle

This is the same format one could get from the /hunt command, but
limited to the current puzzle. This is a very convenient way to see
all the puzzle fields and to get access to the pencil button to edit
the current puzzle.

3 years agoRename puzzle creation command from "/puzzle" to "/puzzle new"
Carl Worth [Sat, 9 Jan 2021 07:36:32 +0000 (23:36 -0800)]
Rename puzzle creation command from "/puzzle" to "/puzzle new"

This is to create space for other commands later, (such as "/puzzle edit"
and a new status-reporting "/puzzle" command).

3 years agoDon't re-set channel and sheet name or channel topic to the same value as before
Carl Worth [Sat, 9 Jan 2021 07:04:55 +0000 (23:04 -0800)]
Don't re-set channel and sheet name or channel topic to the same value as before

The puzzle_update_channel_and_sheet function is modified here to
accept an old_puzzle argument in addition to the puzzle argument. By
using this it can decide whether there's any change in the sheet or
channel data before setting it.

This optimization avoids Slack reporting things like:

    Turbot renamed the channel from "hunt-puzzle" to "hunt-puzzle"

Which is obviously just noise.

3 years agoUnify code to rename channel, set channel description, and rename sheet
Carl Worth [Sat, 9 Jan 2021 06:38:26 +0000 (22:38 -0800)]
Unify code to rename channel, set channel description, and rename sheet

With this code, all of those changes are made consistently regardless of
whether the change happens from /state, /solved, or a puzzle edit (which
could set status to either "solved" or "unsolved").

3 years agoReject puzzle edit if "solved" and "solution" are inconsistent
Carl Worth [Sat, 9 Jan 2021 06:19:29 +0000 (22:19 -0800)]
Reject puzzle edit if "solved" and "solution" are inconsistent

There's an argument here that we really shouldn't be giving the user
two different fields if we're forcing them to be edited together, but
that's what we have right now.

3 years agoUpdate TODO file now that puzzle edit dialog has been edited
Carl Worth [Sat, 9 Jan 2021 06:18:26 +0000 (22:18 -0800)]
Update TODO file now that puzzle edit dialog has been edited

And just as the TODO file predicted, right now it's only possible to
get at this functionality through the pencil icon.

3 years agoImplement update of puzzle when edit_puzzle dialog is submitted
Carl Worth [Sat, 9 Jan 2021 02:44:29 +0000 (18:44 -0800)]
Implement update of puzzle when edit_puzzle dialog is submitted

Processing all user input and updating the database with the changes.

This isn't _quite_ updating everything in the channel and the sheet
that should be changed. To do that we simply need to refactor the code
that's currently doing that in various places to do it all in one
place.

3 years agoImplement a dialog box to edit a puzzle
Carl Worth [Sat, 9 Jan 2021 01:23:32 +0000 (17:23 -0800)]
Implement a dialog box to edit a puzzle

This is connected to the "pencil" buttons that were recently added to
the /hunt output as well as the Turbot home view.

So far, this brings up an editable dialog with the puzzle state but
doesn't actually do anything with any of the edits made when the user
saves the dialog.

3 years agoModify multi_select_block to use accessory_block, section_block, and text_block
Carl Worth [Fri, 8 Jan 2021 20:37:40 +0000 (12:37 -0800)]
Modify multi_select_block to use accessory_block, section_block, and text_block

Where this content was previously open-coded and redundant.

The commit removes more lines of code than it adds.

3 years agoRevamp the TODO list
Carl Worth [Fri, 8 Jan 2021 01:51:22 +0000 (17:51 -0800)]
Revamp the TODO list

The primary thing here is a sorted list of everything we want to
complete before a feature freeze, (which we're doing one weekend
before MH 2021 and will be followed by some test hunt over the weekend
both to flush out bugs and to get more of the team comfortable with
Turbot).

3 years agoWire up a function to handle the edit_puzzle button
Carl Worth [Thu, 7 Jan 2021 17:05:34 +0000 (09:05 -0800)]
Wire up a function to handle the edit_puzzle button

It doesn't actually _do_ anything yet, but should at least prevent the
warning sign which was appearing before.

And this should let us see if the action_id field is a good way of
plumbing the hunt_id and puzzle_id through to the handler for the
press of the edit_puzzle button.

3 years agoAdd an edit button next to each puzzle
Carl Worth [Thu, 7 Jan 2021 04:42:21 +0000 (20:42 -0800)]
Add an edit button next to each puzzle

This will appear in both the Turbot home screen as well as in the
output from the /hunt command.

3 years agoFix indentation
Carl Worth [Wed, 6 Jan 2021 16:54:56 +0000 (08:54 -0800)]
Fix indentation

To keep the flake8 check passing.

3 years agoPut -SOLVED as a suffix on sheet names and not a prefix to preserve
justin melvin [Wed, 6 Jan 2021 05:18:17 +0000 (21:18 -0800)]
Put -SOLVED as a suffix on sheet names and not a prefix to preserve
alphabetical ordering.

3 years agoModify a sheet-related TODO item after clarifying it with Nathan
Carl Worth [Tue, 5 Jan 2021 22:25:41 +0000 (14:25 -0800)]
Modify a sheet-related TODO item after clarifying it with Nathan

This is regarding making a hunt-specific folder for sheets to live in.

Also, while thinking about this, add another item about possible
changing the way sheets are renamed.

3 years agoUpdate TODO now that /hunt accepts a search term
Carl Worth [Tue, 5 Jan 2021 18:57:23 +0000 (10:57 -0800)]
Update TODO now that /hunt accepts a search term

Given the way the original TODO item was written, (as adding support
to both /home and to the Turbot home screen), this recent feature
addition doesn't delete an entire item from the TODO list, but it does
deserve to.

3 years agoFix error with missing search terems
Carl Worth [Tue, 5 Jan 2021 18:49:23 +0000 (10:49 -0800)]
Fix error with missing search terems

Some recent change made a command like "/hunt solved" result in an error.
This commit fixes that.

3 years agoUse Slack back-tick quoting for search terms
Carl Worth [Tue, 5 Jan 2021 18:43:44 +0000 (10:43 -0800)]
Use Slack back-tick quoting for search terms

This is cleaner both for preventing misinterpreting asterisks and also
more clear than re-inserting quotation marks for search terms that
include spaces.

3 years agoTweak bolding of hunt lead-in line from search results
Carl Worth [Tue, 5 Jan 2021 18:39:49 +0000 (10:39 -0800)]
Tweak bolding of hunt lead-in line from search results

Using bold just for the puzzle status word. (This is an attempt to
avoid Slack seeing a '*' in a regular expression of a search term and
think that it means to make something bold.)

3 years agoAdd state string to list of puzzle attributes matched in searching
Carl Worth [Tue, 5 Jan 2021 18:34:26 +0000 (10:34 -0800)]
Add state string to list of puzzle attributes matched in searching

This is a really important one so that people can use state strings
for things like "logic" and others who want to solve a logic puzzle
can find them.

3 years agoAdd search terms to the /hunt command
Carl Worth [Tue, 5 Jan 2021 16:31:34 +0000 (08:31 -0800)]
Add search terms to the /hunt command

Now, `/hunt <search-term>` can be used to list puzzles matching
<search-term>. As before, it will display only unsolved puzzles by
default, but `/hunt all <search-term>` or `/hunt solved <search-term>`
can be used to display other puzzles as well.

3 years agoDrop two items from the TODO list (which we just completed)
Carl Worth [Tue, 5 Jan 2021 04:44:28 +0000 (20:44 -0800)]
Drop two items from the TODO list (which we just completed)

A commit just a couple back in the series added these features.

3 years agoCorrect typo in hunt description verbiage
Carl Worth [Tue, 5 Jan 2021 04:43:15 +0000 (20:43 -0800)]
Correct typo in hunt description verbiage

Thanks to Ken for pointing out this misspelling.

3 years agoAdd support for an argument to the /hunt command
Carl Worth [Tue, 5 Jan 2021 03:49:35 +0000 (19:49 -0800)]
Add support for an argument to the /hunt command

This will work with three options:

/hunt all: Show all puzzles
        /hunt unsolved: Show unsolved puzzles
        /hunt solved: Show solved puzzles

3 years agoAdd a /hunt command
Carl Worth [Tue, 5 Jan 2021 03:20:27 +0000 (19:20 -0800)]
Add a /hunt command

Which spits out details of the current hunt, (in a format very similar
to what appears in the Turbot home view).

3 years agoFarm blocks-creation code out to various supporting files
Carl Worth [Tue, 5 Jan 2021 02:41:07 +0000 (18:41 -0800)]
Farm blocks-creation code out to various supporting files

The code will be easier to manage with separate hunt, round, puzzle,
and channel.py files each responsible for maintaining their own
functionality. We don't yet have any classes in any of these files,
(just functions that look things up in the database and that generate
Slack blocks), but we may end up doing classes later, (particularly if
we start wanting methods to update a single attribute in the database
for a given item, etc.).

3 years agoRevert "Turbot home: Disable the 'Hunts you can join' section"
Carl Worth [Tue, 5 Jan 2021 02:10:33 +0000 (18:10 -0800)]
Revert "Turbot home: Disable the 'Hunts you can join' section"

This reverts commit e3385b6a7da4583ab7c0729ac6776a32aa2818a0
which disabled some code to prevent a bug that was causing the
turbot Home view to fail to work.

The previous commit fixes the underyling bug so this code can now be
safely re-enabled.

3 years agohunt_link_block: Remove inadvertent trailing comma
Carl Worth [Tue, 5 Jan 2021 02:05:37 +0000 (18:05 -0800)]
hunt_link_block: Remove inadvertent trailing comma

This was creating a tuple where not intended, so causing invalid
blocks structure to be sent to Slack.

This was the cause of the recent bug preventing the Turbot Home view
from working (unless the user already belonged to every available
hunt).

3 years agoTODO: Capture some recent suggestions
Carl Worth [Tue, 5 Jan 2021 01:33:17 +0000 (17:33 -0800)]
TODO: Capture some recent suggestions

Ideas from various people mentioned in Slack

3 years agoTurbot home: Disable the "Hunts you can join" section
Carl Worth [Sat, 2 Jan 2021 18:27:40 +0000 (10:27 -0800)]
Turbot home: Disable the "Hunts you can join" section

Which is buggy and causing problems right now.

3 years agoPrevent failure of /solved command if /state had never been run
Carl Worth [Sat, 2 Jan 2021 17:24:53 +0000 (09:24 -0800)]
Prevent failure of /solved command if /state had never been run

The recent code to make /solved clear the /state field was buggy in
that it would result in a dispatch_failed error in Slack if /state had
never been invoked previously.

3 years agoTODO: Add a low-priority item for using a URL shortener
Carl Worth [Sat, 2 Jan 2021 07:20:01 +0000 (23:20 -0800)]
TODO: Add a low-priority item for using a URL shortener

One downside of doing something like this is that it would introduce a
dependence on another third-party service, so I'm not really all that
keen on pursuing this.

3 years agoAdd display of rounds in the Turbot home view
Carl Worth [Sat, 2 Jan 2021 06:29:07 +0000 (22:29 -0800)]
Add display of rounds in the Turbot home view

Grouping puzzles that belong to each round (and also a list of puzzles
that belong to no round).

This drops another item from the TODO list.

3 years agoDrop leading/trailing spaces and empty strings when parsing rounds
Carl Worth [Sat, 2 Jan 2021 05:31:20 +0000 (21:31 -0800)]
Drop leading/trailing spaces and empty strings when parsing rounds

Since we're dealing with user input here, it's easy for their to be
leading and trailing space (which we don't want as part of the round
name), or even an accidentally emty round (from two consecutive
commas). Drop any of those spaces and ignore any empty round strings.

3 years agoFix storage of rounds for new puzzle creation
Carl Worth [Sat, 2 Jan 2021 05:22:21 +0000 (21:22 -0800)]
Fix storage of rounds for new puzzle creation

To store an array of strings rather than storing each character from
the round string as an individual round (oops!).

That is, before this fix, if the user typed a round name of "Colors" the
database would store a rounds array for the puzzle with values of "C",
"o", "l", "o", "r", and "s".

3 years agoDrop TODO item regarding audio/video calls
Carl Worth [Fri, 1 Jan 2021 19:13:28 +0000 (11:13 -0800)]
Drop TODO item regarding audio/video calls

Nathan is planning on signing up for a paid plan with Slack
temporarily (over the period of Mystery Hunt) specifically to get
access to Slack video calls. These are already fully integrated
(allowing a call to everyone who belongs to a channel) which means
that that will allow for a call to everyone working on a given
puzzle. So I don't think we'll need any specific work to integrate
Turbot with this approach.

3 years agoRestrict a Slack channel topic to 250 characters
Carl Worth [Fri, 1 Jan 2021 19:06:26 +0000 (11:06 -0800)]
Restrict a Slack channel topic to 250 characters

And terminate it with an ellipsis if the user-provided state string is
too long. (It's a bit annoying that Slack returns an error rather than
just doing this same thing itself, but whatever.)

This satisfies a TODO item since users had encountered this error
during our last hunt.

3 years agoAdd list of available hunts to the Turbot home view
Carl Worth [Fri, 1 Jan 2021 18:55:35 +0000 (10:55 -0800)]
Add list of available hunts to the Turbot home view

So that people can easily find active, public hunts.

3 years agoMake /solved clear the state string for a puzzle
Carl Worth [Fri, 1 Jan 2021 18:42:14 +0000 (10:42 -0800)]
Make /solved clear the state string for a puzzle

In the last test we run, we often saw stale state messages about a
puzzle being half-solve, etc. when it was actually already completely
solved. Instead of putting another chore onto solvers to have them
manually clear the state string after solving a puzzle, here we do
that automatically.

This completes another low-hanging fruit item from the TODO list.

3 years agoRefuse to create a new puzzle with the same URL as an existing puzzle
Carl Worth [Fri, 1 Jan 2021 18:17:35 +0000 (10:17 -0800)]
Refuse to create a new puzzle with the same URL as an existing puzzle

Just a simple safety check when multiple people might be creating the
same puzzle at roughly the same time.

And one less item left on the TODO list.