{"id":15861986,"url":"https://github.com/owenrumney/presence-setter","last_synced_at":"2026-05-02T03:32:37.605Z","repository":{"id":150749114,"uuid":"569700624","full_name":"owenrumney/presence-setter","owner":"owenrumney","description":"Simple Lambda for setting Slack presence on a schedule","archived":false,"fork":false,"pushed_at":"2022-11-25T09:20:53.000Z","size":156,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T20:34:46.285Z","etag":null,"topics":["eventbridge","lambda-functions","presence","serverless","slack"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/owenrumney.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-23T12:24:00.000Z","updated_at":"2022-11-27T09:20:34.000Z","dependencies_parsed_at":"2023-04-27T20:46:45.914Z","dependency_job_id":null,"html_url":"https://github.com/owenrumney/presence-setter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/owenrumney/presence-setter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owenrumney%2Fpresence-setter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owenrumney%2Fpresence-setter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owenrumney%2Fpresence-setter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owenrumney%2Fpresence-setter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/owenrumney","download_url":"https://codeload.github.com/owenrumney/presence-setter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owenrumney%2Fpresence-setter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32522245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eventbridge","lambda-functions","presence","serverless","slack"],"created_at":"2024-10-05T22:22:41.023Z","updated_at":"2026-05-02T03:32:37.592Z","avatar_url":"https://github.com/owenrumney.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Presence Setter\n\nPresence setter is a quick and dirty lambda function that will change your presence in Slack on a schedule. Its the same as remembering to manually set your status to `away`.\n\n## Prerequisites\n\nYou'll need;\n\n- AWS Account\n- Ability to create a Slack App\n- Serverless installed\n\n## Quick Tour\n\n`serverless.yaml` is the definition of the infrastructure you want to deploy - this is going to be a Lambda function an and event bridge with 2 rules configured using cron.\n\nSet the times you want to toggle the status and trigger the lambda.\n\n`handler.py` is a quick and dirty lambda that will read the status of your Slack Presence and then change to either `auto` or `away` depending on the current setting. \n\n\u003e Note: This is a bit blunt and will be refined to take into account the time etc to set the correct intended status.\n\n## Using it\n\n### Slack\n\nCreate a Slack App then you need to give the User Token the required scope - this is done going to `OAuth and Permission` \n\n![OAuth and Permissions](.github/images/oauth_settings.png)\n\nand setting the `User Tokens Scope` to;\n\n```\n- dnd:read\n- dnd:write\n- users:write\n- users:read\n```\n\nThe `dnd:*` permissions allow the Do Not Disturb setting and ending and the `users:*` permissions allow for reading and updating your status\n\nInstall the app in your workspace and it's ready to go\n\n### Serverless\n\nI've not user Serverless before, more than anything else, this was an exercise in playing with it.\n\ninstall the CLI\n\n```bash\nnpm i -g serverless\n```\n\n### AWS\n\nCreate some credentials to deploy with, you're going to need them when running Serverless. Either do `aws configure` to set up `~/.aws/credentials` or export the creds to the shell env but you need them for `Serverless` to access.\n\nNow you can run \n\n```bash\nexport SLACK_API_KEY=\u003cprovide your Slack token here\u003e\n\nserverless deploy\n```\n\nWhich will create the Lambda function and the Event bridge...\n\n\n\n\n## Testing it out\n\nYou can test the lambda using the aws cli\n\n```bash\naws lambda invoke --function-name presence-setter-dev-function response.json\n```\n\nthis should change your status and return with a `200`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowenrumney%2Fpresence-setter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fowenrumney%2Fpresence-setter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowenrumney%2Fpresence-setter/lists"}