Giter Club home page Giter Club logo

emacs-slack's Introduction

DEPRECATED

Please note, this project is deprecated and no longer being maintained


MELPA

Emacs Slack

GNU Emacs client for Slack.


Preview

You can see some gifs on the wiki.

Dependencies

Extensions

Configuration

How to get token and cookie

;; I'm using use-package and el-get and evil

(el-get-bundle slack)
(el-get-bundle yuya373/helm-slack) ;; optional
(use-package helm-slack :after (slack)) ;; optional
(use-package slack
  :commands (slack-start)
  :init
  (setq slack-buffer-emojify t) ;; if you want to enable emoji, default nil
  (setq slack-prefer-current-team t)
  :config
  (slack-register-team
   :name "emacs-slack"
   :default t
   :token "xoxs-sssssssssss-88888888888-hhhhhhhhhhh-jjjjjjjjjj"
   :subscribed-channels '(test-rename rrrrr)
   :full-and-display-names t)

  (slack-register-team
   :name "test"
   :token "xoxs-yyyyyyyyyy-zzzzzzzzzzz-hhhhhhhhhhh-llllllllll"
   :subscribed-channels '(hoge fuga))

  (evil-define-key 'normal slack-info-mode-map
    ",u" 'slack-room-update-messages)
  (evil-define-key 'normal slack-mode-map
    ",c" 'slack-buffer-kill
    ",ra" 'slack-message-add-reaction
    ",rr" 'slack-message-remove-reaction
    ",rs" 'slack-message-show-reaction-users
    ",pl" 'slack-room-pins-list
    ",pa" 'slack-message-pins-add
    ",pr" 'slack-message-pins-remove
    ",mm" 'slack-message-write-another-buffer
    ",me" 'slack-message-edit
    ",md" 'slack-message-delete
    ",u" 'slack-room-update-messages
    ",2" 'slack-message-embed-mention
    ",3" 'slack-message-embed-channel
    "\C-n" 'slack-buffer-goto-next-message
    "\C-p" 'slack-buffer-goto-prev-message)
   (evil-define-key 'normal slack-edit-message-mode-map
    ",k" 'slack-message-cancel-edit
    ",s" 'slack-message-send-from-buffer
    ",2" 'slack-message-embed-mention
    ",3" 'slack-message-embed-channel))

(use-package alert
  :commands (alert)
  :init
  (setq alert-default-style 'notifier))

How to get token and cookie

  1. Using Chrome, open and sign into the slack customization page, e.g. https://my.slack.com/customize
  2. Right click anywhere on the page and choose "inspect" from the context menu. This will open the Chrome developer tools.
  3. Find the console (it's one of the tabs in the developer tools window)
  4. At the prompt ("> ") type the following: window.prompt("your api token is: ", TS.boot_data.api_token)
  5. Copy the displayed token elsewhere.
  6. If your token starts with xoxc then keep following the other steps below, otherwise you are done and can close the window.
  7. Now switch to the Applications tab in the Chrome developer tools (or Storage tab in Firefox developer tools).
  8. Expand Cookies in the left-hand sidebar.
  9. Click the cookie entry named d and copy its value. Note, use the default encoded version, so don't click the Show URL decoded checkbox.
  10. Now you're done and can close the window.

For further explanation, see the documentation for the emojme project: (github.com/jackellenberger/emojme)

Note that it is only possible to obtain the cookie manually, not through client-side javascript, due to it being set as HttpOnly and Secure. See OWASP HttpOnly.

How to secure your token

If someone steals your token they can use the token to impersonate you, reading and posting to Slack as if they were you. It's important to take reasonable precautions to secure your token.

One way to do this is by using the Emacs auth-source library. Read the auth-source documentation to learn how to use it to store login information for remote services.

Then configure the auth-sources variable to select a "backend" store. The default backend is ~/.authinfo file, which is simple but also un-encrypted. A more complex option is to encrypt that .~/authinfo file with gnupg and configure auth-sources to use ~/.authinfo.gpg as the source for all passwords and secrets. Other backends exist beyond these; read the documentation for details.

How to store your slack tokens in your auth-source backend will vary depending which backend you chose. See documentation for details. The "host" and "user" fields can be whatever you like as long as they are unique; as a suggestion use "myslackteam.slack.com" for host, and use your email address for user. The "secret" or "password" field should contain the token you obtained earlier (How to get token and cookie).

Do the same for the cookie, however for the "user" field append ^cookie, so if for the token you picked [email protected] then for the cookie use [email protected]^cookie.

Then finally, in your Emacs init read the token from your auth-source:

(slack-register-team
 :name "myslackteam"
 :token (auth-source-pick-first-password
         :host "myslackteam.slack.com"
         :user "[email protected]")
 :subscribed-channels '((channel1 channel2)))

If your token starts with xoxc you'll also need to manually obtain the cookie as described in How to get token and cookie and make sure the "user" has ^cookie in it as described above in How to secure your token:

(slack-register-team
 :name "myslackteam"
 :token (auth-source-pick-first-password
         :host "myslackteam.slack.com"
         :user "[email protected]")
 :cookie (auth-source-pick-first-password
         :host "myslackteam.slack.com"
         :user "[email protected]^cookie")
 :subscribed-channels '((channel1 channel2)))

If you do not specify :cookie then you'll automatically be prompted for one if you are using an xoxc token.

How to use

I recommend to chat with slackbot for tutorial using slack-im-select.

Some terminology in the slack- functions:

  • im: An IM (instant message) is a direct message between you and exactly one other Slack user.

  • channel: A channel is a Slack channel which you are a member of

  • group. Any chat (direct message or channel) which isn't an IM is a group.

  • slack-register-team

    • set team configuration and create team.
    • :name and :token are required
  • slack-change-current-team

    • change slack-current-team var
  • slack-start

    • do authorize and initialize
  • slack-ws-close

    • turn off websocket connection
  • slack-group-select

    • select group from list
  • slack-im-select

    • select direct message from list
  • slack-channel-select

    • select channel from list
  • slack-group-list-update

    • update group list
  • slack-im-list-update

    • update direct message list
  • slack-channel-list-update

    • update channel list
  • slack-message-embed-mention

    • use to mention to user
  • slack-message-embed-channel

    • use to mention to channel
  • slack-file-upload

    • uploads a file
    • the command allows to choose many channels via select loop. In order to finish the loop input an empty string. For helm that's C+RET or M+TET. In case of Ivy it's C+M+j.

Notification

See alert.

emacs-slack's People

Contributors

aculich avatar anaisbetts avatar asok avatar event avatar gonewest818 avatar halcyon avatar jaor avatar jasoncyu avatar jpablobr avatar juergenhoetzel avatar justinbarclay avatar kidd avatar malabarba avatar malb avatar matthew-piziak avatar mdoza avatar mschuldt avatar nasa9084 avatar pcrama avatar rememberyou avatar ryuslash avatar sarg avatar supermomonga avatar syohex avatar tejasbubane avatar turbomack avatar unhammer avatar wammkd avatar yuki-inoue avatar yuya373 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emacs-slack's Issues

Screenshots?

It would be nice to have an idea of what it looks like in action. :)

slack-register-team doesn't work

When I eval slack-register-team, I got an error void function: slack-collect-slots. And I found slack-collect-slots was defined in slack-util.el, but slack-team.el didn't require it. So I add (require 'slack-util) in slack-team.el and it works now.

Could you fix this bug? Thanks. :)

Provide warning when sending message and no connection to Slack is open

I was connected to Slack on my laptop, closed it, walked up a few floors and re-opened. Then I typed out a message in a Slack buffer and hit enter. The message disappeared (unrecoverable?) and wasn't sent. It would be good to:

  • Prevent input when there's no connection to Slack
  • Attempt to send, if no connection, try to connect and preserve the message in the input buffer
  • Other ideas?

[Documentation] `slack-message-custom-notifier` object arguments

Hey dood.

Many thanks that you fixed #109 , it helped me view my slack and IRC messages in one buffer.

I just want to point out when using slack-message-custom-notifier, the arguments are not plain text/string as in you can plug it in alert but objects. So in order for me to get the team, room and message; I had to copy the code from the original alert notification and plug in the correct parameters.

I have no problem that the arguments are objects, but rather I had to go look at the source just to figure what they were. So maybe some documentation on the API objects might alleviate this confusion in using the custom notifier.

Either way, good job.

Spacemacs layer

Hi @yuya373,

Just a heads up, I started working on a layer for Spacemacs that's based on your package: syl20bnr/spacemacs#4821

if you have thoughts on keybindings and configuration, please feel free to submit changes to the PR.

Thanks!

upon slack-im-select: "Invalid function: slack-buffer-widen"

Sometimes, when I have more than one window open in Emacs (that is, the frame is split), and I run slack-im-select, I get an error in the minibuffer: Invalid function: slack-buffer-widen.

If I open up slack-buffer.el, and move slack-buffer-widen before its first usage, I don't get the flycheck error. But I'm not sure if this is a real fix; the Emacs macro documentation says:

In order for compilation of macro calls to work, the macros must already be defined in Lisp when the calls to them are compiled. The compiler has a special feature to help you do this: if a file being compiled contains a defmacro form, the macro is defined temporarily for the rest of the compilation of that file.

So perhaps this isn't the issue. I don't see this problem when I have only one window open.

Feature request: TAB completion of message reactions

When putting the cursor on a message and running

M-x slack-message-add-reaction

a minibuffer prompt for the reaction/emoticon comes up. Here, the user is to enter a Slack reaction like:

:laughing:

It would be great to have auto completion of these reactions/emoticons. Both to speed up adding reactions, but also to avoid misspelling an emoticon.

Unbound slot: "#<class slack-attachment>

I tried switching to a channel with 4 unread messages (all of them from a bot, if that makes a difference) and got:

eieio-default-superclass: Unbound slot: "#<class slack-attachment>", "#<slack-attachment attachment>", fallback, oref

I'm unable to join that particular channel.

Alternate colors for nicks

I noticed this package is already making use of lui from Circe. They also have some nice code (not sure if it's an easily extractable library though) for alternating nick colors in a buffer. Would be nice to have here.

No obvious way to open a new Direct Message

If I've already been talking with someone on slack, slack-im-select allows me to open up my chat with that person.

But if I haven't talked to someone before, I'm not sure how I can talk to them. They don't show up in the list for slack-im-select, and typing their name results in emacs-slack saying "no match".

How can I do this?

Wrong type argument: stringp, nil

On latest master under Emacs 24.5.1 a *Warnings* occasionally pops up with the following message:

Error (websocket): in callback `on-message': Wrong type argument: stringp, nil

No method definition: slack-message-append-reaction

Occasionally a *Warnings* buffer pop up with the following message:

Error (websocket): in callback `on-message': No method definition: slack-message-append-reaction, (nil [object slack-reaction "slack-reaction" [...]

I see that the method is actually defined in slack-message-reaction.el, and tried re-loading the file without much success. Version used is 20160110.1829 from melpa.

"OAuth error: invalid_client_id"

Hi! I am wondering if someone can help me with this error I'm getting from Firefox when I try to fire up emacs-slack. Looks like a likely configuration problem but I have double and triple checked the oauth credentials. I've put a scrambled copy of my config up here.

https://gist.github.com/tomb7890/27da3bc955870ebf0589

I'm using Emacs 24.4.1. Had no problems installing the prerequisite packages, as far as I can tell. Had no problems getting my id etc. from slack.com as far as I can tell.

Thanks

Feature: Decouple notification function

Nice work here dood.

Like jabber, it has an message hook jabber-alert-message-hooks which allows whatever messaging function aside from alert. It would be nice if I could set my own notification function so I could handle what to do based on channel, team, message, room and others.

Error connecting to rtm.start

Calling slack-register-team results in this message:

Slack Websocket is not open - <name>
[eieio-class-tag--slack-team unbound "<token>" "<id>" "<secret>" "<name>" unbound unbound unbound unbound unbound unbound unbound nil nil unbound unbound unbound nil nil nil 20 t nil 1 4096 nil nil #s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8 data ()) 0 nil (general)]

Then slack-start results in:

REQUEST [error] Error (error) while connecting to https://slack.com/api/rtm.start.

Any ideas what is wrong?

Is there a way to get a more complete log?

Defcustom message width

There should be a def custom that dictates how wide message should be displayed. Or maybe there is already a way to change this and I was unable to find it.

Submitting an edited message doesn't work

Hi,

there seems to be a regression when submitting an edited message.

Editing one of my messages with slack-message-edit brings up the message in a buffer for edit. After making my edit and hitting C-c C-c I get the following error:

ad-Advice-call-interactively: Wrong type argument: commandp, slack-message-send-edited

GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-05-06
emacs-slack version: 20160517.1009 (installed from melpa)

Cheers,

-Torstein

slack-group-select fails

Debugger entered--Lisp error: (invalid-slot-name "#<slack-message :ts>" "0")
  signal(invalid-slot-name ("#<slack-message :ts>" "0"))
  #[(object slot-name operation &optional new-value) "\302\303\304�!    D\"\207" [object slot-name signal invalid-slot-name eieio-object-name] 4 "Method invoked when an attempt to access a slot in OBJECT fails.\nSLOT-NAME is the name of the failed slot, OPERATION is the type of access\nthat was requested, and optional NEW-VALUE is the value that was desired\nto be set.\n\nThis method is called from `oref', `oset', and other functions which\ndirectly reference slots in EIEIO objects."]([object slack-message :ts unbound nil unbound nil unbound unbound unbound unbound unbound unbound unbound nil] "0" oset nil)
  apply(#[(object slot-name operation &optional new-value) "\302\303\304�!  D\"\207" [object slot-name signal invalid-slot-name eieio-object-name] 4 "Method invoked when an attempt to access a slot in OBJECT fails.\nSLOT-NAME is the name of the failed slot, OPERATION is the type of access\nthat was requested, and optional NEW-VALUE is the value that was desired\nto be set.\n\nThis method is called from `oref', `oset', and other functions which\ndirectly reference slots in EIEIO objects."] ([object slack-message :ts unbound nil unbound nil unbound unbound unbound unbound unbound unbound unbound nil] "0" oset nil))
  slot-missing([object slack-message :ts unbound nil unbound nil unbound unbound unbound unbound unbound unbound unbound nil] "0" oset nil)
  #[(obj slots) "\304\216�\305H B�\n\2057

It's really hard to investigate what's going on, so here's the stack trace.

What preceded this trace:

(slack-start) - succeeded (I've finally found all the credentials I need).
(slack-channel-list-update) - fetched a bunch of channels, beside others there ware the channels I knew to be used by my group.

PS. The readme would benefit from information about how to actually use this client. For instance, there is no information on how to send messages... and it's not really obvious from the code.

The load prev message function always seems to fail.

(defun slack-room-load-prev-messages () (interactive) (let* ((cur-point (point)) (msg-beg (next-single-property-change cur-point 'ts)) (ts (get-text-property msg-beg 'ts)) (line (thing-at-point 'line)) (oldest (ignore-errors (get-text-property 0 'oldest line))))

For me msg-beg is nil and the following get-text-property msg-beg 'ts fails with wrong type argument.

Slack Websocket PING Timeout.

I have installed emacs-slack with the slack layer in Spacemacs, Emacs 25.1.1. Emacs-slack reports that the websocket is initialized successfully and I am also able to grab the initial JSON with a curl command & my access token. However, when executing slack-start I get:

Slack Websocket Is Ready! - {team name redacted}
Error running timer: (wrong-type-argument hash-table-p (slack-ws-init-ping-check-timers)) [3 times]
Slack Websocket PING Timeout.

Suggestions?

Thanks.

My configuration (sanitized), currently in .spacemacs, looks like this:

  (setq slack-buffer-emojify t) ;; if you want to enable emoji, default nil
  (setq slack-prefer-current-team t)
  (setq alert-default-style 'notifier)
  (slack-register-team
   :name "{redacted}"
   :default t
   :client-id "{id from slack app config}"
   :client-secret "{secret}"
   :token "xoxp-XXX"
   :subscribed-channels '(general)
  )
  (evil-define-key 'normal slack-info-mode-map
    ",u" 'slack-room-update-messages)
  (evil-define-key 'normal slack-mode-map
    ",c" 'slack-buffer-kill
    ",ra" 'slack-message-add-reaction
    ",rr" 'slack-message-remove-reaction
    ",rs" 'slack-message-show-reaction-users
    ",pl" 'slack-room-pins-list
    ",pa" 'slack-message-pins-add
    ",pr" 'slack-message-pins-remove
    ",mm" 'slack-message-write-another-buffer
    ",me" 'slack-message-edit
    ",md" 'slack-message-delete
    ",u" 'slack-room-update-messages
    ",2" 'slack-message-embed-mention
    ",3" 'slack-message-embed-channel
    "\C-n" 'slack-buffer-goto-next-message
    "\C-p" 'slack-buffer-goto-prev-message)
  (evil-define-key 'normal slack-edit-message-mode-map
    ",k" 'slack-message-cancel-edit
    ",s" 'slack-message-send-from-buffer
    ",2" 'slack-message-embed-mention
    ",3" 'slack-message-embed-channel)

All chat messages are displayed in the minibuffer

All the chat messages are displayed in the minibuffer when I'm visiting a different buffer. This is rather annoying and I would like to turn it off (is this a bug or a feature?)

My slack settings are:

(require 'slack)
(setq slack-enable-emoji t
      slack-buffer-emojify nil
      slack-typing-visibility 'buffer
      slack-prefer-current-team t)

Best regards,

-Torstein

emacs-slack-20160521.722 (via melpa)
GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.20.4) of 2016-05-24

Possibility to turn off "<user> is typing ..." messages

Heya,

I've just installed emacs-slack (through package-install, version 20160422.908) and it's great to get more of the Slack features, that are excluded form the IRC bridge. Thank you very much for making this package!

One thing that would make this package even better, is the possibility to turn off the notification in the minibuffer every time a user types. The minibuffer is precious real estate and I'd like to preserve it for other, to me more important, messages, like eldoc.

Cheers,

-Torstein

Emacs freeze frequently

When I do other works with opening some slack channels, Emacs freeze with high-consumption of cpu and memory frequently.
It seems to happen with overlay function like isearch-forward but I'm not sure.

At present, all I can do is to send SIGKILL to a Emacs process when this trouble happens.
Could you give me some help to find the cause?

英語に自信無いので、補足します。
頻繁にフリーズしてしまう感じで、どうもOverlay関連の機能を使うと起こる気がしていますが、確証はないです。
起きると、Emacs強制終了するしか無くて、今のところ原因が全然わかりません。
何とか原因を特定したいのですが、ログを出力する方法とか、この辺が怪しそうとか、何か情報頂けませんでしょうか。

環境は以下です。
MacBookPro OS X 10.11.5
GNU Emacs 24.5.1 (x86_64-apple-darwin15.5.0, NS apple-appkit-1404.47) of 2016-07-03 on aki2o-no-MacBook-Pro.local

slack-room-load-prev-messages fails with wrong-type-argument integer-or-marker-p nil

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
get-text-property(nil ts)
slack-room-load-prev-messages()
call-interactively(slack-room-load-prev-messages record nil)
command-execute(slack-room-load-prev-messages record)
execute-extended-command(nil "slack-room-load-prev-messages")
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)

Warning when linking youtube video

When receiving a message that is a link of a youtube video, I get the following warning:

Warning (emacs): (error Invalid use of ‘\’ in replacement text) payload: (:type message :channel D0LK3GAUD :user U0LJARZT2 :text <https://www.youtube.com/watch?v=I8LbkfSSR58> :ts 1476710583.000015 :team T03PZN9B6 :reactions nil :attachments nil :pinned_to nil)
Error (websocket): in callback `on-message': error: "Invalid use of ‘\\’ in replacement text"
Warning (emacs): (error Invalid use of ‘\’ in replacement text) payload: (:type message :message (:type message :user U0LJARZT2 :text <https://www.youtube.com/watch?v=I8LbkfSSR58> :attachments [(:service_name YouTube :service_url https://www.youtube.com/ :title Category Theory 1.1: Motivation and Philosophy :title_link https://www.youtube.com/watch?v=I8LbkfSSR58 :author_name Bartosz Milewski :author_link https://www.youtube.com/user/DrBartosz :thumb_url https://i.ytimg.com/vi/I8LbkfSSR58/hqdefault.jpg :thumb_width 480 :thumb_height 360 :fallback YouTube Video: Category Theory 1.1: Motivation and Philosophy :video_html <iframe width="400" height="225" src="https://www.youtube.com/embed/I8LbkfSSR58?feature=oembed&autoplay=1&iv_load_policy=3" frameborder="0" allowfullscreen></iframe> :video_html_width 400 :video_html_height 225 :from_url https://www.youtube.com/watch?v=I8LbkfSSR58 :service_icon https://a.slack-edge.com/2089/img/unfurl_icons/youtube.png :id 1 :fields nil)] :ts 1476710583.000015) :subtype message_changed :hidden t :channel D0LK3GAUD :previous_message (:type message :user U0LJARZT2 :text <https://www.youtube.com/watch?v=I8LbkfSSR58> :ts 1476710583.000015) :event_ts 1476710584.435778 :ts 1476710584.000016)
Error (websocket): in callback `on-message': error: "Invalid use of ‘\\’ in replacement text"

White space around messages

This is awesome good work.

I see a lot of white space around every message in a buffer - is that expected? Around 3 blanks lines after a post.

Rooms with unread messages / notifications

Slack's web UI shows which rooms have unread messages, and also which have unseen notifications.

Is there a way to do either of these in emacs-slack?

If not, please consider this a feature request.

Thanks for emacs-slack!

Multiple team support

The official client allows selecting from more than one Slack team. ERC and rcirc, popular Emacs IRC clients, provide similar features by supporting more than one IRC server connection.

Skimming the source, a path forward may be to define a slack-team structure and nest most of the vars in slack.el under that. A slack-teams-alist could then hold the list of teams available for connection.

The drudge work, then, is modifying almost every function to require a team argument, and provide wrappers for interactive functions which select the team from the current buffer, or add a completing-read for picking from slack-teams-alist interactively.

If this is a good direction to go, I'd be happy to tackle this.

Support object scopes

Slack is forcing applications to migrate to the "object token" system, which requires the application to declare the permission scopes it needs to work.

The new authorization URL scheme looks like:

https://slack.com/oauth/authorize?client_id=&scope=channels:history%20channels:read%20channels:write%20chat:write:user%20dnd:read%20dnd:write%20emoji:read%20files:read%20files:write:user%20groups:history%20groups:read%20groups:write%20im:history%20im:read%20im:write%20mpim:history%20mpim:read%20mpim:write%20pins:read%20pins:write%20reactions:read%20reactions:write%20search:read%20stars:read%20stars:write%20team:read%20usergroups:read%20usergroups:write%20users:read%20users:write%20identify&redirect_uri=http://localhost:9000?complete
  • emacs-slack should declare the scopes it needs in the authorization URL.
  • These scopes should be customizable per-team. For example:
  (slack-register-team
   :name "team-name"
   :default t
   :client-id "client-id"
   :client-secret "client-secret"
   :scopes '("channels:history"
             "channels:read"
             "channels:write"
             "chat:write:user"
             "dnd:read"
             "dnd:write"
             "emoji:read"
             "files:read"
             "files:write:user"
             "groups:history"
             "groups:read"
             "groups:write"
             "im:history"
             "im:read"
             "im:write"
             "mpim:history"
             "mpim:read"
             "mpim:write"
             "pins:read"
             "pins:write"
             "reactions:read"
             "reactions:write"
             "search:read"
             "stars:read"
             "stars:write"
             "team:read"
             "usergroups:read"
             "usergroups:write"
             "users:read"
             "users:write"
             "identify"
             )
   )
  • emacs-slack should honor declared scopes and avoid making requests which do not have a corresponding scope above. Read about scopes and their corresponding API calls here.
  • The documentation should be updated for new users, who will be required to declare the list of scopes in their Slack application configuration.

Existing tokens using the client scope will continue to work.

Add to MELPA?

Perhaps it's a bit too soon. But adding this for your consideration.

Cannot kill slack window

As soon as I open a slack window up, I cannot close it with C-x k or with the buffer-list. The message I get is Invalid slot name: "#<slack-message :ts>", "0"

Suggestion: moving commands

Problem

Each message has multiple lines (name and time, message, blank line for separator), so we have to press up or down key at least 3 times to focus to the next or previous message.

Suggestion

Maybe we need following commands (and functions used by their commands) to move between each messages.

  • slack-messages-move-to-next-message
    • The command to move to the next (below one) message in the buffer that determined by current cursor position.
  • slack-messages-move-to-previous-message
    • The command to move to the previous (above one) message in the buffer that determined by current cursor position.
  • slack-messages-move-to-first-message
    • The command to move to the first (top) message in the buffer
  • slack-messages-move-to-last-message
    • The command to move to the last (bottom) message in the buffer

What do you think?

Direct messages do not not raise a mode line alert

So close now to being my main client :-)

Is it possible for the mode line to raise notification of DMs like channels do?

Also I'd like to disable the notification on the mode-line of the notification channel - it's way way to busy in our environment.

Private channels inaccessible

I've connected successfully to our work Slack account, and can join and use public channels.

However, despite a private channel private1 being listed here:

(slack-register-team
 :name "work"
 :default t
 :client-id "1234"
 :client-secret "5678"
 :token "9012"
 :subscribed-channels '(public1 public2 private1))

... I can't join said private channel using M-x slack-select-channel; it doesn't appear in the autocomplete list, and can't be entered manually.

Update README with instructions on how to use emacs-slack?

Right now the README has instructions on how to connect Emacs to Slack with this package ( which work great, I'm all connected ), but no instructions on how to use the package.

I've got no idea on how to send messages, and I can't test very much because I can't switch channels due to #44. Maybe once that bug is fixed and I'm able to play around with it, I'll be able to write docs and do a PR.

slack edit buffer doesn't close after finishing edit with C-c C-c

Steps to reproduce

  1. Send a message
  2. Edit sent message using slack-message-edit
  3. Finish edit with C-c C-c
  4. Edit buffer disappears and message is updated.
  5. Check Buffer List.
    OBSERVED: "* Slack - Edit Message_" buffer still in the list
    EXPECTED: "_ Slack - Edit Message*" buffer is closed and not in the buffer list

Note: I use emacs in nox mode.

REQUEST [error] Error (error) while connecting to https://slack.com/api/rtm.start

Hi there,

Getting the error:

REQUEST [error] Error (error) while connecting to https://slack.com/api/rtm.star

When running M-x slack-start. Used to work fine, so in theory configuration is correct but I've tested with emacs -Q and just loading the minimum configuration anyway, no change. I don't believe there are token/auth/access issuses as I'm able to connect to GET https://slack.com/api/rtm.start?token=xoxp-XXX... via restclient and I get same JSON data back that https://api.slack.com/methods/rtm.start/test returns.

Any ideas on how to debug further or what the issue may be?

Thanks,

Symbol's function definition is void: string>

Line 196 in slack-room.el uses a function called 'string>', which causes an error when trying to use 'slack-channel-select'.

I get the following backtrace when I try to run the command:

Debugger entered--Lisp error: (void-function string>)
  (string> (slack-room-latest-ts (cdr a)) (slack-room-latest-ts (cdr b)))
  (closure ((l ("  all-notifications " . [object slack-channel ))
  sort((("  all-notifications " . []) slack-buffer-function slack-current-room slack-token t) (a b) (string> (slack-room-latest-ts (cdr a)) (slack-room-latest-ts (cdr b)))))
  (closure ((--cl-build-cons-- closure #1 (room) (cons (funcall --cl-build-label-- room) room)) (--cl-im-presence-- closure #1 (room) (if (object-of-class-p room (quote slack-im)) (slack-im-user-presence room) "  ")) (--cl-build-label-- closure #1 (room) (concat (funcall --cl-im-presence-- room) (format "%s %s" (slack-room-name room) (slack-room-unread-count room)))) (--cl-sort-rooms-- closure #1 (l) (sort l (function (lambda (a b) (string> (slack-room-latest-ts ...) (slack-room-latest-ts ...)))))) (rooms [])))
  funcall((closure ((--cl-build-cons-- closure #1 (room) (cons (funcall --cl-build-label-- room) room)) (--cl-im-presence-- closure #1 (room) (if (object-of-class-p room (quote slack-im)) (slack-im-user-presence room) "  ")) (--cl-build-label-- closure #1 (room) (concat (funcall --cl-im-presence-- room) (format "%s %s" (slack-room-name room) (slack-room-unread-count room)))) (--cl-sort-rooms-- closure #1 (l) (sort l (function (lambda (a b) (string> (slack-room-latest-ts ...) (slack-room-latest-ts ...)))))) (rooms [])))
  (let (--cl-sort-rooms-- --cl-build-label-- --cl-im-presence-- --cl-build-cons--) (setq --cl-sort-rooms-- (function (lambda (l) (sort l (function (lambda (a b) (string> ... ...))))))) (setq --cl-build-label-- (function (lambda (room) (concat (funcall --cl-im-presence-- room) (format "%s %s" (slack-room-name room) (slack-room-unread-count room)))))) (setq --cl-im-presence-- (function (lambda (room) (if (object-of-class-p room (quote slack-im)) (slack-im-user-presence room) "  ")))) (setq --cl-build-cons-- (function (lambda (room) (cons (funcall --cl-build-label-- room) room)))) (funcall --cl-sort-rooms-- (mapcar --cl-build-cons-- (if (function (lambda (rooms) (cl-remove-if (function ...) rooms))) (funcall (function (lambda (rooms) (cl-remove-if ... rooms))) rooms) rooms))))
  (cl-labels ((sort-rooms (l) (sort l (function (lambda (a b) (string> (slack-room-latest-ts ...) (slack-room-latest-ts ...)))))) (build-label (room) (concat (im-presence room) (format "%s %s" (slack-room-name room) (slack-room-unread-count room)))) (im-presence (room) (if (object-of-class-p room (quote slack-im)) (slack-im-user-presence room) "  ")) (build-cons (room) (cons (build-label room) room))) (sort-rooms (mapcar (function build-cons) (if (function (lambda (rooms) (cl-remove-if (function ...) rooms))) (funcall (function (lambda (rooms) (cl-remove-if ... rooms))) rooms) rooms))))
  (slack-room-names rooms (function (lambda (rooms) (cl-remove-if (function (lambda (r) (or (not ...) (slack-room-archived-p r)))) rooms))))
  (let* ((list (slack-room-names rooms (function (lambda (rooms) (cl-remove-if (function ...) rooms))))) (candidates (mapcar (function car) list))) (let ((selected (let ((completion-ignore-case t)) (completing-read (format "%s" "Select Channel: ") candidates nil t nil nil candidates)))) (let ((G12309 (cdr (cl-assoc selected list :test (function string=))))) (slack-room-make-buffer-with-room G12309 :update nil))))
  slack-room-select(([]))
  slack-channel-select()
  call-interactively(slack-channel-select record nil)
  command-execute(slack-channel-select record)

No idea what's going on.

Only first slack-register-team call seems to work

I'm registering two teams:

(require 'alert)
(require 'slack)

(setq alert-default-style 'notifier)
(setq slack-buffer-emojify t)

(slack-register-team :name "team-a"
                     :client-id "REDACTED"
                     :client-secret "REDACTED"
                     :token "xoxp-REDACTED"
                     :subscribed-channels '(one two three))

(slack-register-team :name "team-b"
                     :client-id "REDACTED"
                     :client-secret "REDACTED"
                     :token "xoxp-REDACTED"
                     :subscribed-channels '(a b c))

However, it only seems to be connecting to the first one (from *Messages*):

Slack Authorization Finished - team-a
Slack Authorization Finished - team-b
Opening TLS connection to `mpmulti-mzet.slack-msgs.com'...
Opening TLS connection with `gnutls-cli --insecure -p 443 mpmulti-mzet.slack-msgs.com'...done
Opening TLS connection to `mpmulti-mzet.slack-msgs.com'...done
Slack Websocket Is Ready! - Team A

Then, when I call slack-change-current-team, the only available option is Team A. I'd expect both Team A and Team B to be available.

Send formatted links from emacs slack client?

The slack message API (but not the slack GUI clients) allow you to send a message with a formatted link, e.g.

{
    "text": "I am a test *message*:<http://www.example.com|some link>"
}

Which shows up as "I am a test ⁠⁠⁠message⁠⁠⁠: some link"

When I send the same message via the emacs slack client, I get,
I am a test message:<http://www.example.com|some link>
where the word message is in bold, but the link is not active and shows the formatting characters.

Is there any way to send a formatted link via the slack emacs client?

websocket-1.5 is unavailable

Warning (emacs): Unable to activate package `slack'.
Required package `websocket-1.5' is unavailable

If I use the setup from the readme.

I can load this package with ELPA, but then there are many other errors possibly related to this.

Actually, el-get isn't able to install any of the required versions except for circle package.

persistent notification

I have hard time figuring how to make persistent notifications.

In jabber if new message arrived I will get a highlighted sender name in mode-line till I visit that buffer. This is very convenient. How can I achieve similar behavior with slack?

My configuration of alert is (setq alert-default-style 'mode-line). All I see is a temporary highlight of mode-line which disappars on any user action.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.