QUESTION
Here I am having a bot, when message with an attachment is posted in the slack channel, it should save the messages with some unique ids, and when we enter those id's in the slack channel , the bot should return that message with attachment from the chat history
(just like how the public url to a message works - https://workspace_name/archives/channel_name/token ).
If I attach an xml file in my channel, the bot should return that attachment(the specific message in which I added my attachment) from my channel's history when I type some id's associated with that message.
I am using this code : https://github.com/rampatra/jbot
At present the issue is :-
I tried to fetch the name of the file I am sharing to the channel , I was using event.getFile().getName() in SlackBot.java ( https://github.com/rampatra/jbot/blob/master/jbot-example/src/main/java/example/jbot/slack/SlackBot.java ) . and tried to display it .
@Controller(events = EventType.FILE_SHARED)
public void onFileShared(WebSocketSession session, Event event) {
logger.info("File shared: {}", event);
System.out.println("file id : "+event.getFileId());
System.out.println("file name :"+ event.getFile().getName());
}
The bot should return the name of the file(1234.xml) I have shared. But it is coming as null value, but the id of the file("F........") is coming up properly.