irslackd icon indicating copy to clipboard operation
irslackd copied to clipboard

Example of available commands

Open caywin25 opened this issue 3 years ago • 3 comments

Hello,

Thank you for your work. Sorry, this is not a problem, but I can't use the available commands, I don't read javascript well.

Could you give me some examples on how to use the thread command please?

An example of a command to edit or delete messages?

A small list with examples of how to use the different @slack commands.

Thanks :)

caywin25 avatar Mar 25 '21 08:03 caywin25

For example I can answer in a thread but not create a thread. I can't delete my messages or edit them either.

caywin25 avatar Mar 25 '21 12:03 caywin25

Is there a good places to add @slack examples and notes? Maybe a wiki page or in the readme?

so far I have:

  • @slack's available commands are enumerated in the switch at https://github.com/adsr/irslackd/blob/master/lib/irslackd.js#L803
  • the methods mostly forward directly to slack's api
  • at least @slack history and @slack react do not work in private/direct messages (?)

history

uses https://api.slack.com/methods/conversations.history

  • translates -l to limit
  • notifies slack's json response
21:18 <will> test again
21:18 <will> @slack history -l 1
21:18 -- Notice(irslackd): {"type":"message","text":"test again","user":"U04EMK30W","ts":"1663031889.716039","team":"T04EMK30U","blocks":[{"type":"rich_text","block_id":"kVx","elements":[{"type":"rich_text_section","elements":[{"type":"text","text":"test again"}]}]}]}

react

forwards to https://api.slack.com/methods/reactions.add and needs timestamp and name.

  • timestamp (10.6 digit) can be fetched from @slack history -- but someone must have a more ergonomic method.
  • name is the emoji name (sans surrounding :)
21:19 <will> @slack react 1663031889.716039 thumbsup
21:19  * will reacts @ will :+1:

thread

https://api.slack.com/methods/conversations.replies

@slack thread seems to be for thread history, not for starting/responding to a thread (?)

WillForan avatar Sep 13 '22 01:09 WillForan

A wiki page would be great.

adsr avatar Sep 13 '22 02:09 adsr