skoczen / will

Will is a simple, beautiful-to-code bot for slack, hipchat, and a whole lot more.
https://heywill.io
MIT License
406 stars 171 forks source link

help should be single message in Slack #358

Open Ashex opened 6 years ago

Ashex commented 6 years ago

The help command is broken into multiple messages which on slack results in several gigantic blocks of text appearing.

Ideally we'd have the message posted to slack in a way that allows for it to be automatically collapsed or a directly reply to the message creating a thread.

skoczen commented 6 years ago

Big +1 to that for me. Broadly, help could use a lot of love. The challenge has been finding ways to keep it working across platforms, with minimal upkeep.

If you've got suggestions on a way to implement the collapsed message, I'm all ears!

Ashex commented 6 years ago

I tried tweaking it to be a direct reply (start thread) and there looks to be a bug with reply when it comes to html processing:

Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/ahmed/Projects/null/null/will/backends/io_adapters/base.py", line 71, in __start_event_listeners
    self.handle_outgoing_event(pubsub_event.data)
  File "/Users/ahmed/Projects/null/null/will/backends/io_adapters/slack.py", line 202, in handle_outgoing_event
    event.content = event.content.replace("&", "&")
AttributeError: 'NoneType' object has no attribute 'replace'

It works if I use say but will complains about the incorrect usage.

pastorhudson commented 6 years ago

I built an attachment class. So I can easily build slack attachments and pass them around and add buttons and stuff. It would probably help with this.

Ashex commented 6 years ago

I'm very intrigued by this attachment class! Unfortunately I believe help needs to stay cross platform so we can't process it as attachments (unless we add some checks to see which backend is in use then let's go hog wild).

pastorhudson commented 6 years ago

The awesome part of the attachment class is subclassing with all the colors and footer icons for your org/app. Then every message you send has all that ready to go.