If I have a text area to type a message into, and I store that text in String message; How can I send that to a specified slack channel? I have created a slack app and generated an incoming webhook for it but am not sure how to use this.
Tim Moores wrote:The API seems to have dependencies - be sure to add all of them to your classpath, whatever they may be. In this case, slf4j.
Every time I added the dependency, a new error for a new dependency would pop up. I added 6 new jars before I got an error saying that one of them had an improper method definition in it. Do you know if there is a better way to send a slack message than with
This is the reason that application builders like Maven and Gradle were created. It's very common for Java apps to depend on a multitude of libraries that those tools excel in fetching them - and their dependencies and integrating them into tbe module being built.
Your first dependeny was slf4j - the Simple Logging Facade for Java, and it's actually a bit of glue that fixes the problem when you are pulling in different libraries that use different loggers (such as juli and lof4j) and makes them all work together seamlessly. However, it depends, in turn in many cases on pulling in a logger and/or slf4j bridge. And so it goes.
Ideally the Slack API docs will tell you what it wants and perhaps even have build examples, but some vendors are better at that than others, alas.
Some people, when well-known sources tell them that fire will burn them, don't put their hands in the fire.
Some people, being skeptical, will put their hands in the fire, get burned, and learn not to put their hands in the fire.
And some people, believing that they know better than well-known sources, will claim it's a lie, put their hands in the fire, and continue to scream it's a lie even as their hands burn down to charred stumps.