-from turbot.blocks import section_block, text_block
+from turbot.blocks import (
+ section_block, text_block, button_block, accessory_block
+)
from turbot.channel import channel_url
from boto3.dynamodb.conditions import Key
import re
return response['Items'][0]
-def puzzle_block(puzzle):
+def puzzle_blocks(puzzle):
"""Generate Slack blocks for a puzzle
The puzzle argument should be a dictionary as returned from the
', '.join(links), state_str
)
- return section_block(text_block(puzzle_text))
+ return [
+ accessory_block(
+ section_block(text_block(puzzle_text)),
+ button_block("✏", puzzle['puzzle_id'])
+ )
+ ]
def puzzle_matches_one(puzzle, pattern):
"""Returns True if this puzzle matches the given string (regexp)