BartoszCoyote/GoPomodoro

Should set dnd on slack when pomodoro action is running

Closed this issue · 0 comments

Idea

I would like gopomodoro to set slack dnd when its active so that notifications on slack are blocked.
This should be done in a way of events and events handlers per different communicator so we can make it extensible.

Examples

how to use api with tester
set snooze - https://api.slack.com/methods/dnd.setSnooze/test
end snooze - https://api.slack.com/methods/dnd.endSnooze/test

how to generate token - https://hexdocs.pm/slack/token_generation_instructions.html#content

Proposed design:

1. Add config file functionality - 🟢

Create a config file for gopom something like .gopom in main folder by default - this would be os specific.
This file would be used to store configuration.
One of the option would be slackdnd= - on or off

Edit: we used viper and config with filename .GoPomodoro.env

2. gopom configure slack_token

Would be used to set slack_token and encrypt it using gpg, so that we dont store it in plain text.

3. If dnd is set to true and slack token available set dnd in slack - 🟢

Using potentially one of the options like HTTP call

Edit: was implemented using slack api

Things to remember/do:

  • capture process temirnation and send end dnd slack when process is killed/terminated
  • wait for user input to start another work round