Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here


Pull chat history into newly opened buffers

Subscribe to updates I use weechat-slacklog

Statistics on weechat-slacklog

Number of watchers on Github 52
Number of open issues 0
Average time to close an issue about 2 months
Main language Ruby
Average time to merge a PR 6 days
Open pull requests 0+
Closed pull requests 2+
Last commit almost 2 years ago
Repo Created over 5 years ago
Repo Last Updated almost 2 years ago
Size 562 KB
Organization / Authorthoughtbot
Page Updated
Do you use weechat-slacklog? Leave a review!
View weechat-slacklog activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating weechat-slacklog for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

ARCHIVED: This project has been archived. The original authors no longer use it and Slack is currently phasing out the API it relies on.


Pull Slack chat history in when opening a new buffer.



This script is not yet released, please install manually:

% curl -o ~/.weechat/ruby/slacklog.rb \

Optionally set the script to autoload when WeeChat starts:

% cd ~/.weechat/ruby/autoload && ln -s ../slacklog.rb .

Restart WeeChat or load the script manually:

/script load slacklog.rb

Required Settings

Note: You can generate an API token here.

/set plugins.var.ruby.slacklog.servers "thoughtbot"
/set plugins.var.ruby.slacklog.thoughtbot.api_token "abc-123"

These variables can also be modified via the /slacklog command:

/slacklog add thoughtbot abc-123

Optional Settings

By default, the Slack API returns 100 messages when no count is specified. You can change this by setting a value between 1 and 1000:

/set plugins.var.ruby.slacklog.count 500

To change the color of Slacklog lines, change the following WeeChat setting:

/set logger.color.backlog_line darkgray


Whenever you open a buffer for a server in your servers list (and which has a token defined), 100 messages of history will be fetched via the Slack API and printed into the buffer.

The /slacklog command can be used without arguments to actively fetch and print history for an already open buffer.

Implementation Details

The script can be used outside of WeeChat like so:

% ruby ./slacklog.rb fetch API-TOKEN CHANNEL

This prints history messages on stdout and has no dependencies on the Weechat module. The implementation is contained in a normal SlackAPI class which is well tested.

Global functions wire this up as a WeeChat plugin in the following way:

  • Whenever a channel is joined or the /slacklog command is invoked, we determine the token and channel then ask Weechat to asynchronously execute our script as above with a callback.
  • The callback will receive the lines output by our script, and print them into the buffer.
weechat-slacklog open issues Ask a question     (View All Issues)
  • almost 5 years Replace channel/group identifiers with names
  • over 5 years Correct times
weechat-slacklog list of languages used
Other projects in Ruby