{"id":22216766,"url":"https://github.com/khilnani/slack-send-app.serverless","last_synced_at":"2025-08-25T15:07:34.773Z","repository":{"id":150585327,"uuid":"124181916","full_name":"khilnani/slack-send-app.serverless","owner":"khilnani","description":"Node.js based AWS Lambda \u0026 DynamoDB based serverless app to schedule your Slack messages.","archived":false,"fork":false,"pushed_at":"2018-11-12T03:20:40.000Z","size":4499,"stargazers_count":7,"open_issues_count":11,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-27T14:47:13.165Z","etag":null,"topics":["automation","aws","aws-lambda","productivity","serverless","serverless-framework","slack"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/khilnani.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2018-03-07T05:03:53.000Z","updated_at":"2025-05-23T03:30:16.000Z","dependencies_parsed_at":"2023-06-11T11:45:35.706Z","dependency_job_id":null,"html_url":"https://github.com/khilnani/slack-send-app.serverless","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/khilnani/slack-send-app.serverless","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khilnani%2Fslack-send-app.serverless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khilnani%2Fslack-send-app.serverless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khilnani%2Fslack-send-app.serverless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khilnani%2Fslack-send-app.serverless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khilnani","download_url":"https://codeload.github.com/khilnani/slack-send-app.serverless/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khilnani%2Fslack-send-app.serverless/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272084830,"owners_count":24870584,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"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":["automation","aws","aws-lambda","productivity","serverless","serverless-framework","slack"],"created_at":"2024-12-02T22:13:24.335Z","updated_at":"2025-08-25T15:07:34.763Z","avatar_url":"https://github.com/khilnani.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slack-send-app.serverless\n\n\u003e Schedule your Slack messages.\n\n\n# Usage\n\n- `/send Message When` - The app will parse out the last date mentioned as the schedule date using natural language processing.\n  - e.g. `/send Hey Jason, don't forget to send me that cool website at 4pm`\n  - e.g. `/send Hey Jason, don't forget to send me that cool website link in 6 hours`\n- `/slist [inline]` or `/send list [inline]` - List scheduled messages. Appending `inline` allows you to view the list of scheduled messages across devices in the Slack channel the command is run. Each message includes a message ID and deletion button.\n- `/sdelete ID` or `/send delete ID` - Delete a specific message via its ID\n\n# Screenshots\n\nBelow is a screenshot from Slack once the API is deployed and added as a Slack app.\n\n\u003cimg src=\"https://raw.githubusercontent.com/khilnani/slack-send-app.serverless/master/docs/screenshot.png\" width=\"40%\" /\u003e\u003cimg src=\"https://raw.githubusercontent.com/khilnani/slack-send-app.serverless/master/docs/screenshot2.png\" width=\"40%\" /\u003e\n\n## Setup\n\nOK, lets get started. There are quite a few steps here and you may need 30 mins to 1 hour depending on your familiarity with AWS.\n\n*Note*\n\n- The default setup will create a public API endpoint. Take a look at the *Private API Setup* section to make the API private.\n- The project has been tested on Ubuntu, macOS as well as Bash on Windows 10, with and without Docker.\n\n## AWS Setup\n\nSince we're working with DynamoDB, AWS Lambda and AWS API Gateway, we need to setup AWS credentials.\nWe are going to use the Serverless framework to manage the AWS tech stack.\n\n\u003e - The role Serverless needs requires a lot of privilages.\n\u003e - The role used to setup and deploy is different from the permissions set on the lambda code that runs.\n\u003e - If this concerns you, create a new AWS account to play around with.\n\n### Serverless AWS Credentials Setup\n\n- Follow the instructions at https://serverless.com/framework/docs/providers/aws/guide/credentials/ . They cover the setup pretty well.\n\n### Manual AWS IAM Setup\n\n- Create an IAM Group with:\n  - Attach Managed Policies:\n    - AmazonEC2FullAccess - Start and stop EC2 instances\n    - AWSLambdaFullAccess - Create and manage Lambda functions\n    - AmazonS3FullAccess - Create a bucket to store the lambda function code\n    - AmazonDynamoDBFullAccess - Manage DynamoDB\n    - CloudWatchLogsFullAccess - Create and manage Cloudwatch logs\n    - CloudWatchEventsFullAccess - Manage Cloudwatch events\n    - AmazonSESFullAccess - Send Emails for alerts\n    - AmazonSQSFullAccess - Send and subscribe to queues for alerts\n    - AmazonAPIGatewayAdministrator - Create and manage API endpoints\n    - IAMFullAccess - Create new role for the Lambda to work with EC2 instances\n  - Create Custom Group Policy \u003e Custom Policy:\n    - Custom CloudFormation policy (below)- Create and manage CloudFormation stacks\n```\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"Stmt1499009146000\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"cloudformation:*\"\n            ],\n            \"Resource\": [\n                \"*\"\n            ]\n        }\n    ]\n}\n```\n- Create an IAM User and assign the User the newly created Group\n- Setup AWS credentials with this user's security credentials. Check the above link since it has a good overview.\n\n### Private API Setup\n\nIn most cases you will want to secure access to this API. We'll do this using an AWS API Key using the steps below:\n\n- Create an API Key - https://console.aws.amazon.com/apigateway/home?region=us-east-1#/api-keys\n- Create a Usage Plan - https://console.aws.amazon.com/apigateway/home?region=us-east-1#/usage-plans\n    - Add the API (`ec2-remote-dev`) and API Key you created to the Usage Plan.\n- Update `private` to `true` in the `serverless.yaml` method definition for the `unread` function\n- Make API calls with the Request Header `x-api-key: APIKEY`.\n- Example:\n```\ncurl -H \"x-api-key: AWS_API_KEY\" https://API_ID.execute-api.us-east-1.amazonaws.com/dev/ec2/status/INSTANCE_NAME\n```\n\n## Slack Setup\n\nWe will need to add the app to you Slack Workspace\n\n- Create a Slack app - https://api.slack.com/apps?new_app=1\n- Navigate to: Slash Commands\n    - Use the URL below for each command\n        - URL: /dev/slack/send/command\n    - Command: /send\n        - Description: Schedule a message to be sent in the future\n        - Usage hint: message [when] OR help\n    - Command: /slist\n        - Description: List iunsent scheduled messages\n        - Usage hint: [inline]\n    - Command: /sdelete\n        - Description: Delete a scheduled message\n        - Usage hint: ID\n- Navigate to: OAuth \u0026 Permissions\n    - Add Permission Scopes\n       - bot - Call the bot for help\n       - commands - To view, edit and delete scheduled messages\n       - chat:write:user - To send your messages as scheduled\n       - users.profile:read - Timezone specific message scheduling and formatting\n     - Add a Redirect URL:\n        - URL: /dev/slack/send/redirect\n- Navigate to: Interactive Components\n    - Interactivity\n        - URL: /dev/slack/send/actions\n    - Message Menus\n        - URL: /dev/slack/send/options\n- Navigate to: Event Subscriptions\n    - Enable: Enable Events\n    - Request URL: /dev/slack/send/event\n    - Subscribe to Workspace Events\n        - app_uninstalled\n        - tokens_revoked\n    - Subscribe to Bot Events:\n        - app_mention\n- Navigate to: Bot User\n  - Display Name: /send-app\n  - Username: send-app\n  - Always Show My Bot as Online: Yes\n\n# Links\n\n## Slack\n\n- SDK\n    - https://github.com/slackapi/node-slack-sdk\n- API\n    - https://api.slack.com/apps\n    - https://api.slack.com/docs/interactive-message-field-guide#action_payload\n    - https://api.slack.com/methods\n        - https://api.slack.com/methods/chat.postMessage\n            - https://api.slack.com/docs/message-threading\n        - https://api.slack.com/methods/oauth.access\n        - https://api.slack.com/methods/users.info\n\n## Node.js\n\n- NLP\n    - https://github.com/wanasit/chrono\n        - https://github.com/wanasit/chrono/issues/214\n    - https://github.com/neilgupta/Sherlock\n    - http://compromise.cool\n- Dates\n    - https://www.epochconverter.com\n    - http://momentjs.com/docs/\n    - http://momentjs.com/timezone/docs/#/\n- Javascript\n    - https://github.com/request/request-promise\n    - https://github.com/request/request\n    - http://bluebirdjs.com/docs/api-reference.html\n\n## AWS\n\n- Javascript\n    - https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/javascript/example_code\n    - https://aws.amazon.com/blogs/developer/support-for-promises-in-the-sdk/\n- Env Variables\n    - https://docs.aws.amazon.com/lambda/latest/dg/tutorial-env_cli.html\n- DynamoDB\n    - JS\n        - https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/dynamodb-example-table-read-write.html\n        - https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html\n        - https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html\n    - Guide\n        - https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html\n        - https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithItems.html#WorkingWithItems.WritingData\n        - https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.html\n    - API\n        - https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Operations_Amazon_DynamoDB.html\n        - https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html\n        - https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html\n    - Web\n        - https://stackoverflow.com/questions/35963243/how-to-query-dynamodb-by-date-range-key-with-no-obvious-hash-key\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhilnani%2Fslack-send-app.serverless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhilnani%2Fslack-send-app.serverless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhilnani%2Fslack-send-app.serverless/lists"}