title: Slack Bot returning message from history
body: <p><strong>QUESTION</strong></p>
  
  <p>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 </p>
  
  <p>(just like how the public url to a message works -  <a href="https://workspace_name/archives/channel_name/token" rel="nofollow noreferrer">https://workspace_name/archives/channel_name/token</a>  ). </p>
  
  <blockquote>
    <p>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. </p>
  </blockquote>
  
  <p>I am using this code : <a href="https://github.com/rampatra/jbot" rel="nofollow noreferrer">https://github.com/rampatra/jbot</a></p>
  
  <p><strong>At present the issue is :-</strong></p>
  
  <p>I tried to fetch the name of the file I am sharing to the channel ,
  I was using event.getFile().getName() in SlackBot.java ( <a href="https://github.com/rampatra/jbot/blob/master/jbot-example/src/main/java/example/jbot/slack/SlackBot.java" rel="nofollow noreferrer">https://github.com/rampatra/jbot/blob/master/jbot-example/src/main/java/example/jbot/slack/SlackBot.java</a> ) . and tried to display it .</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> @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());
      }</code></pre>
  </div>
  </div>
  </p>
  
  <p>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.</p>