I have a slack bot built using botkit that is listening for uploaded files from users in a certain channel. I am trying to handle multiple images uploaded simultaneously, in order to have my bot wait for all images to be processed before proceeding to respond to each of them.
I have my application set up to listen for file_shared, file_created, and file_public events, however I am only seeing file_shared ever be triggered by a file upload. I would imagine that file_created would be triggered before file_shared, but this seems to not be the case.
controller.on('file_created', function(res) {
console.log("created!");
});
controller.on('file_public', function(res) {
console.log("public!");
});
controller.on('file_shared', function(res) {
console.log("shared!!");
});
When listening for these events, I only get "shared!!" but not "public!" or "created!" on a file upload, and shared is only triggered after a file has been processed. In addition, my middleware catches two recieved messages on a file upload, one with only a file ID, and one with the full file information. This would be helpful, but it often prints out with the full object first and the ID second, rather than the only-ID object indicating a processing image.
An example of this output is below:
RCVD: { id: 'FAG4C3VNH',
created: 1525114400,
timestamp: 1525114400,
... more file object stuff }
RCVD: { id: 'FAG4C3VNH' }
shared!!
I am looking to find a way to either
a) track how many files are uploaded at one time or
b) track when a file is being processed by Slack in order to wait for it's completion.
Any resources or thoughts are much appreciated!