Jump to content
frankspin

Slackfred: Interact with your Slack channels, groups and IMs

Recommended Posts

On 4/26/2016 at 2:54 PM, mdorf said:

Hi frankspin,

 

I too would like to know the answer to jwhitmarsh's question. When slackfred sends me to https://api.slack.com/web, all is see is a button that allows me to generate test tokens. Someone at my work suggested creating a slack bot and using its API token, but that's not ideal, since the bot will be a completely separate user.

 

Can you please provide some input on this?

 

Thanks!

 

Michael

 I've tested and using the Test Tokens work perfectly.

Share this post


Link to post

OK I can get a test token, but have no idea how to plug it into the SLT command... it always keeps sending me back to the api.slack.com/web page, and I have the token in my clipboard but nowhere to put it? WHat am I missing? TR

Share this post


Link to post

slr command for starred items is not working. it "searches" but then fallbacks to google search. all other functions seem fine. i'm using alfred 3.2.1 and the latest version from github. thanks!

Screen Shot 2017-01-10 at 17.51.27.png

Share this post


Link to post

@triley60 Sorry about the lack of response here - I expected a fellow community member might be able to help you and this thread fell off my radar.

 

To get the token, type "slt", press cmd and hit return. This will send you to the API page, where you can request and get your token.

 

Once you have your token, re-type "slt" and paste the token you've just copied. Hit return and you'll get a notification confirming the token is set.

 

Screen Shot 2017-01-11 at 10.28.38.png

 

Share this post


Link to post

@gustavomd I've had a play with the "slr" keyword to take a look at these starred items. From what I can see, messages that are starred are returned but not files or images.

 

As such, if there are no matches, the workflow falls back to the Alfred default results. Really, it'd be better practice for it to fall back to a "no starred items found" message, but that's up to the workflow creator @frankspin.

 

Are you certain that 1. You've got the Slack workflow looking at the correct Slack channel? and 2. There are relevant starred messages in that channel?

 

You could always try starring a few messages and testing again as, when there are starred messages, these are correctly returned in my test. :)

 

Screen Shot 2017-01-11 at 10.34.14.png

 

Cheers,
Vero

Share this post


Link to post

Just found and installed this workflow today. Nice work!

 

I hacked my own copy to make a few changes to the slm keyword:

  • You can send direct messages to individuals as well as to channels
  • Deleted users are excluded from the filter list
  • You can use URL-unsafe characters in your message (e.g. using & produced unexpected behavior for me)

Let me know if these features are something you'd be interested in rolling into the "official" version...

Share this post


Link to post
On 1/18/2017 at 4:34 PM, pwharrison said:

Just found and installed this workflow today. Nice work!

 

I hacked my own copy to make a few changes to the slm keyword:

  • You can send direct messages to individuals as well as to channels
  • Deleted users are excluded from the filter list
  • You can use URL-unsafe characters in your message (e.g. using & produced unexpected behavior for me)

Let me know if these features are something you'd be interested in rolling into the "official" version...

I'm interested in this, would you mind sharing a copy? :)

Share this post


Link to post

Requests if possible :)

 

  1. Is there a way to have a command where I can search and toggle through recent messages in descending order? i find that when I get a message I have to type slk and the persons name. Would be nice to have just a command to quickly see the list of those messages.
  2. when typing slk can the IMs/channels be ordered by last received messages or by the last message I've sent?

Thank you! Great workflow!

Share this post


Link to post
On 18.1.2017 at 7:34 PM, pwharrison said:

Just found and installed this workflow today. Nice work!

 

I hacked my own copy to make a few changes to the slm keyword:

  • You can send direct messages to individuals as well as to channels
  • Deleted users are excluded from the filter list
  • You can use URL-unsafe characters in your message (e.g. using & produced unexpected behavior for me)

Let me know if these features are something you'd be interested in rolling into the "official" version...

2

 

Would be very much interest to get a copy to send individual users messages. That would be a key feature for me. Thanks!

Share this post


Link to post
On 11/01/2017 at 11:30 AM, Vero said:

@triley60 Sorry about the lack of response here - I expected a fellow community member might be able to help you and this thread fell off my radar.

 

To get the token, type "slt", press cmd and hit return. This will send you to the API page, where you can request and get your token.

 

Once you have your token, re-type "slt" and paste the token you've just copied. Hit return and you'll get a notification confirming the token is set.

 

Screen Shot 2017-01-11 at 10.28.38.png

 

 

I'm very new to both Alfred and Slack. I cannot seem to get the required Slack token to make Slackfred to work.

Could somebody please help in describing what has to be done on Slack side to get it ?

Thanks in advance

Edited by shakenmilk

Share this post


Link to post

I suggest you to add this link to docs or somewhere else because when I do slt + cmd + return Alfred opens Slack API documentation and it is very difficult to find this "legacy tokens" link.

 

Thanks!

Share this post


Link to post

It's a pity that you have to have a token, I requested one on a couple of my Slack groups to mixed results and there are two that have them entirely disabled. Would oath work with any Slack channel or still require manual authorization?

Share this post


Link to post

Hi Folks, I'm new at Alfred and have an issue with the slm command. I get the Failure Message "asci codec cant encode character...".

Any Idea what i can do?

 

BR

Christian

Bildschirmfoto 2018-02-17 um 10.56.30.png

Share this post


Link to post

Hi @czwengel. Welcome to the forum.

 

The problem is the workflow's code mixing Unicode and encoded strings. Could you provide some additional information, as described in the Reporting Problems with Workflows thread?

 

There should be a full traceback in Alfred's debugger, which will show where in the source code the problem is. Without that information, the bug is a whole lot harder to fix.

Edited by deanishe

Share this post


Link to post

Hi Denishe, thank you for that information, here ist the debug output:

 

Starting debug for 'Slackfred'

[2018-02-18 20:38:40][ERROR: input.scriptfilter] Code 1: 20:38:39 workflow.py:1971 DEBUG    get_password : fspinillo.alfredv2.slackfred:slack_api_key
20:38:40 workflow.py:1531 DEBUG    Cached data saved at : /Users/alskdjalsdjk/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/fspinillo.alfredv2.slackfred/channels.cpickle
20:38:40 workflow.py:1830 ERROR    'ascii' codec can't encode character u'\xfc' in position 15: ordinal not in range(128)
Traceback (most recent call last):
  File "/Users/laksdjalskjd/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.kjkhkhkhA/workflow/workflow.py", line 1828, in run
    func(self)
  File "slackfred-message.py", line 97, in main
    autocomplete='{0} : {1} > '.format(channels['team'], channels['name']),
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 15: ordinal not in range(128)

Share this post


Link to post

It appears you're not using the latest version of the workflow. At least, the line numbers don't line up with code in the repository.


In any case, changing this (line 97 of slackfred-message.py according to your traceback):

autocomplete='{0} : {1} > '.format(channels['team'], channels['name']),

to this:

autocomplete=u'{0} : {1} > '.format(channels['team'], channels['name']),


should fix the problem. There are likely other places in the code with the same issue, however (i.e. they'll explode with non-ASCII text).

Share this post


Link to post

Right-click on the workflow in Alfred Preferences and choose Open in Finder. You'll see the file right there.

 

To edit it, open it in a programmer's editor (not TextEdit), find the line, change it, then save the file. The bug should be fixed.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...