How to postMessage without any events
See original GitHub issueDescription
Describe your issue here.
What type of issue is this? (place an x
in one of the [ ]
)
- bug
- enhancement (feature request)
- question
- documentation related
- testing related
- discussion
Requirements (place an x
in each of the [ ]
)
- I’ve read and understood the Contributing guidelines and have done my best effort to follow them.
- I’ve read and agree to the Code of Conduct.
- I’ve searched for any related issues and avoided creating a duplicate issue.
How to use chat.postMessage Method without any Events?
For example, I want to send a message at 9 a.m every day.
There was no ‘body’ or ‘context’ to get a token.
Yes, I do not understand the slack API system well.
Would you like to help me?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Window.postMessage() - Web APIs | MDN
The window.postMessage() method safely enables cross-origin communication between Window objects; e.g., between a page and a pop-up that it ...
Read more >Using JavaScript and window.postMessage() - In Plain English
The window.postMessage() method safely enables cross-origin communication between Window objects; e.g., between a page and a pop-up that it ...
Read more >How do you use window.postMessage across domains?
Here's the code that registers a message event listener in the page on A: window.addEventListener( "message", function (event) { // Do something } ......
Read more >HTML5 window.postMessage - David Walsh Blog
window.postMessage allows for sending data messages between two windows/frames across domains. Essentially window.postMessage acts as ...
Read more >HTML5 window.postMessage() - SCRIPTVERSE
A brief tutorial on the window.postMessage() method, which gives a provision for sending cross-domain data messages between two browser windows safely.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@whitehander Hello, thanks for asking a question!
To just call
chat.postMessage
or any other Web APIs, it’s not always necessary to use Bolt. Installing only@slack/web-api
and writing a small script as guided here would be enough for such a case. Regarding the possible ways to trigger the script, you can go with any solutions such as cron jobs, scheduled events by Cloud services.If you’re interested in having some interactive parts (e.g., buttons, select menu) in the messages, you need to built a backend service that receives incoming requests from the Slack API server. Those HTTP requests tell your backend user action events. Bolt is the best solution for building such a backend service.
So, if you would like to implement both in a single app, having extra internal (= not internet-facing) endpoints for invoking periodical operations (daily, hourly) in a Bolt app may be a reasonable solution. Here is the guide for how to add extra routes in a Bolt app: https://slack.dev/bolt-js/concepts#custom-routes
@srajiang yeah!! Thank you so much. I was a bit confused, but I just figured out and it worked