Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateTimePicker not in ALLOWED_INPUT_ELEMENTS for InputBlock #65

Closed
K8sKween opened this issue Jan 30, 2024 · 1 comment · Fixed by #69
Closed

DateTimePicker not in ALLOWED_INPUT_ELEMENTS for InputBlock #65

K8sKween opened this issue Jan 30, 2024 · 1 comment · Fixed by #69

Comments

@K8sKween
Copy link
Contributor

Problem: DateTimePicker is now allowed inside of InputBlock

Testing:

Code:

InputBlock(label="Select Branch", element=DateTimePicker(action_id="datetimepicker-action",initial_datetime = 1628633820))

Error:

    print(InputBlock(label="Select Branch", element=DateTimePicker(action_id="datetimepicker-action",initial_datetime = 1628633820)))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/slackblocks/blocks.py", line 258, in __init__
    raise InvalidUsageError("")
slackblocks.errors.InvalidUsageError

Documentation: LINK
I tested this this in a slack block editor to make sure it works inside a InputBlock

Caveats: This is only available on Desktop and only in Modal or Messages

Possible Resolution: Add DateTimePicker to the constant HERE

@K8sKween
Copy link
Contributor Author

DateTimePicker may also need a function to validate that inital_datetime is a valid unix timestamp in seconds.

nicklambourne added a commit that referenced this issue Feb 9, 2024
@nicklambourne nicklambourne linked a pull request Feb 9, 2024 that will close this issue
nicklambourne added a commit that referenced this issue Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant