npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@hubot-friends/hubot-slack

v3.0.2

Published

A new Slack adapter for Hubot

Downloads

396

Readme

hubot-slack

Important Notice

The original hubot-slack is no longer under active development. Slack recommends taking a look at Bolt for JS with Socket Mode first if you're getting started.

But I'm going to maintain this fork as I continue to evolve Hubot. So feel free to use this one.

Installation

npm i @hubot-friends/hubot-slack hubot

This is a Hubot adapter to use with Slack.

Comprehensive documentation is available.

Adapter Configuration

  • Create (or use an existing one) a Slack Workspace
  • Create a Slack App
  • Create an App-Level Token and give it connections:write scope. This will be the HUBOT_SLACK_APP_TOKEN environment variable. The adapter will use this token to authenticate via Slacks Socket Mode (WebSockets)
  • Create a Bot Token. This will be the HUBOT_SLACK_BOT_TOKEN environment variable. The adapter will use this token to POST messages to Slack's HTTP API.
  • Make sure to give the Slack App the scope permissions noted below in "Notes on using SocketMode".

Startup

An example command to start the app on MacOS is the following. Assuming there is a file called .env with the following environment variables set:

HUBOT_SLACK_APP_TOKEN=xapp-1-...
HUBOT_SLACK_BOT_TOKEN=xoxb-...

Set the environment variables to the values you created for your Slack Apps App-Level Token (HUBOT_SLACK_APP_TOKEN) and Bot Token (HUBOT_SLACK_BOT_TOKEN).

env $(cat .env | grep -v \"#\" | xargs -0) PORT=8080 hubot -a @hubot-friends/hubot-slack -n mybot

Another way to start the app in MacOS or Linux is:

HUBOT_SLACK_APP_TOKEN=xapp-1... HUBOT_SLACK_BOT_TOKEN=xoxb-... PORT=8080 hubot -a @hubot-friends/hubot-slack -n mybot

Notes on using SocketMode

Need the following permissions:

  • app_mentions:read
  • channels:join
  • channels:history
  • channels:read
  • chat:write
  • im:write
  • im:history
  • im:read
  • users:read
  • groups:history
  • groups:write
  • groups:read
  • mpim:history
  • mpim:write
  • mpim:read

Need to following events:

  • app_mention
  • message.channels
  • message.im
  • message.groups
  • message.mpim

Sample YAML

The following YAML manifest will work.

display_information:
  name: NameOfYourBot
  description: Description of your bot.
  background_color: "#3d001d"
features:
  app_home:
    home_tab_enabled: false
    messages_tab_enabled: true
    messages_tab_read_only_enabled: false
  bot_user:
    display_name: NameOfYourbot
    always_online: true
oauth_config:
  scopes:
    bot:
      - app_mentions:read
      - channels:join
      - channels:history
      - channels:read
      - chat:write
      - im:write
      - im:history
      - im:read
      - users:read
      - groups:history
      - groups:write
      - groups:read
      - mpim:history
      - mpim:write
      - mpim:read
settings:
  event_subscriptions:
    bot_events:
      - app_mention
      - message.channels
      - message.im
      - message.groups
      - message.mpim
  interactivity:
    is_enabled: true
  org_deploy_enabled: false
  socket_mode_enabled: true
  token_rotation_enabled: false