in Education by
I want to post a message on slack using allbegrey Slack API . The message contains links. How to do so? com.github.allbegray slack-api 1.7.0.RELEASE Info: My message is similar to this one. Udpate If you want to post a simple message to a channel. And your message contains a url. You use the slack markup to format the message and then call postMessage(String channel, String text). It works, but if you have attachments it does not work. My message has attachments and I do it like this: val text = "Nostrum dolores eaque vero voluptatibus illum quibusdam ex sapiente!" val message = "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Expedita tempora asperiores corporis hic quidem dicta maiores odit illo perferendis quaerat. Nostrum dolores eaque vero voluptatibus illum quibusdam ex sapiente!" val webApiClient = SlackWebApiClientImpl(slackApiToken, null, 8000) val channel = webApiClient.openDirectMessageChannel(author.slackId) val method = ChatPostMessageMethod(channel, text) val attachment = Attachment() attachment.author_name = author.name attachment.author_icon = author.profileImageUrl attachment.author_link = "https://XXXX.slack.com/team/${author.slackId}" attachment.text = message attachment.pretext = message method.attachments = listOf(attachment) method.isLink_names = true webApiClient.postMessage(method) Doing so, I get the message but without clickable links. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I have never used this library, but after a cursory looks it seams to expose all the standard API methods as class methods. So you should be able to use the usual Slack markup for formatting you text messages. Here is an example on how to include URLs in your text: Check out this link at . Its pretty cool. Just call the method postMessage() with your message in text and it should work.

Related questions

0 votes
    I want to post a message on slack using allbegrey Slack API . The message contains links. How to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 3, 2022 in Education by JackTerrance
0 votes
    Which of these method returns an instance of DateFormat that can format time information? (a) getTime() (b) ... Expressions of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    How can we take input text from user in HTML page? (a) input tag (b) inoutBufferedReader tag (c) meta ... & Servlet of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
0 votes
    Does anyone know how to solve this java error? java.io.IOException: Invalid keystore format I get it when ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    Does anyone know how to solve this java error? java.io.IOException: Invalid keystore format I get it when ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    Which of this class can be used to format dates and times? (a) Date (b) SimpleDate (c) DateFormat (d ... Regular Expressions of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    I have a text file, by which I am trying to write to in my program. Whenever user wants to add ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    Which of these package is used for text formatting in Java programming language? (a) java.text (b) java. ... Expressions of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    I'm trying to setup a guacamole instance to manage my servers accounts. It's working well when I' ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    Set has contains(Object o) method. (a) True (b) False The question was posed to me by my school ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these is a method of class Date which is used to search whether object contains a date before the ... Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these class contains the methods used to write in a file? (a) FileStream (b) FileInputStream (c) ... & Applets of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which of these packages contains all the classes and methods required for even handling in Java? (a) java.applet ... Handling of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which of these packages contains all the event handling interfaces? (a) java.lang (b) java.awt (c) java.awt ... Event Handling of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which jar provides FileUtils which contains methods for file operations? (a) file (b) apache commons (c) ... Miscellaneous of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
...