python - Reading incoming slack message -


an report posted every 5 hrs in slack channel need sort/filter information , put in file, there way read channel continuously or run command 5 min before time , capture report future processing.

yes, possible. here basic outline of solution:

  • create slack app based on script (e.g. in python) has access channel's history (e.g. has channels:history permission scope)
  • use cron call script @ needed time
  • the script reads channels history (e.g. channel.history public channels), filterers out needs , stores report file.

another approach continuously read every new message channel, parse trigger (e.g. specific user sends or name of report) , filter , safe report when appears. if can identify reliable trigger in experience more stable solution, since scheduled reports can delayed.

for approach use events api of slack instead of cron , subscribe receiving messages (e.g. message event public channels). slack automatically send each new message script posted.

if new creating slack apps advise study excellent official documentation , tutorials on slack api site started.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -