slack-friends Make it easy to send to Slack from your application

Overview

slack-friends

Make it easy to send to Slack from your application

Installation

πŸ’‘ npm install slack-friends

How to get bot token

  1. https://api.slack.com/
  2. Your apps
  3. Create New App
  4. OAuth & Permissions - Bot User OAuth Token
Bot Token scopes 
  * channels:join
  * channels:read
  * chat:write

Usage

import { SlackFriends } from "slack-friends";

const slack = new SlackFriends({
  token: "Your Bot Token",
  channel: "Channel Name",
});
  • token : Please refer to 'How to get bot token' to issue the token
  • channel : write channel name eg) #channelName -> remove # and only use channelName

Common Message

slack.send("hello world");

Custom Message

Please refer to the detail to build Custom Message https://app.slack.com/block-kit-builder/

const customMessage = {
  "blocks": [
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "This is a section block with a button."
      },
      "accessory": {
        "type": "button",
        "text": {
          "type": "plain_text",
          "text": "Click Me",
          "emoji": true
        },
        "value": "click_me_123",
        "action_id": "button-action"
      }
    }
  ]
}

slack.send(customMessage);

Cron Message

slack.cron("* * * * *", "hello World");
 # β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ second (optional)
 # β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ minute
 # β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ hour
 # β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€ day of month
 # β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€ month
 # β”‚ β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€ day of week
 # β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
 # β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
 # * * * * * *

This is a quick reference to cron syntax and also shows the options supported by node-cron.

Schedule Message

slack.time(new Date("2022-06-18T05:17:00Z"), "hello World");

MIT

You might also like...

A library for boolean aliases to help you make your code more confusing and make your coworkers hate you.

yup-nope A library for boolean aliases to help you make your code more confusing and make your coworkers hate you. Installation Using npm: npm install

Dec 10, 2022

Catalogist is the easy way to catalog and make your software and (micro)services visible to your organization in a lightweight and developer-friendly way.

Catalogist is the easy way to catalog and make your software and (micro)services visible to your organization in a lightweight and developer-friendly way.

catalogist πŸ“š πŸ““ πŸ“’ πŸ“– πŸ”– The easy way to catalog and make your software and (micro)services visible to your organization through an API You were a pe

Dec 13, 2022

Hi, Spring fans! In this installment we look at the just-released Hilla framework, from our friends at Vaadin

Custom project from Hilla This project can be used as a starting point to create your own Hilla application with Spring Boot. It contains all the nece

Nov 17, 2022

See a banned user's profile, their friends, their favorite games, their followers etc.

Roblox-Banned-User-Viewer AKA BanView See a banned user's profile, their friends, their favorite games, their followers etc. Ever wondered how to view

Nov 18, 2022

Friend Finder App, asks questions and recommends friends

Friendology Friend Finder app created as a Course Project for CS-522 Social Computing, at IIT Ropar. The application asks questions regarding lifestyl

Apr 26, 2022

Planning a getaway with family or friends and looking for a trip planner app to help you figure out the logistics?

Never-Wavering-Wayfaring-Wanderlust-Adventure-Planner Planning a getaway with family or friends and looking for a trip planner app to help you figure

Jun 15, 2022

Split bills between friends ;)

Split bills between friends ;)

SplitWise - FindCoder.io Hackathon Submission Full stack application to split bills among friends ;) Frontend : https://tripsplits.netlify.app/registe

Dec 25, 2022

Steam - Highlight specific friends who play

highlight-friends Steam Website - Highlight specific friends who play https://greasyfork.org/en/scripts/450409-highlight-specific-friends-who-play?loc

Nov 6, 2022
Owner
Taein Kang
κΈˆκ΅μ„ : λ‚΄κ°€ λ…Έλ“œ 1짱이닀. https://developoerty.tistory.com/
Taein Kang
Start building admin tools on Slack without going into complex slack syntax and flows.

Slackmin Slackmin helps in easy integration with slack to use slash commands, interactive components, format and send messages, design and use modals.

PLG Works 49 Jan 2, 2023
An example implementation of the slack-gpt starter which ingests confluence pages to create a helpful slack bot

Slack-GPT (HR bot example implementation) Table of Contents Introduction Prerequisites Creating and installing the application Configuration Starting

Martin Hunt 17 Jul 31, 2023
Make friends through music. Discover great sound tracks on Solana and play them with your buddies :dancer:.

Acoustic Licious COVID-19 has significantly impacted the mental health of children and adults alike. Globally, the population suffering from lonelines

Devyansh Chawla 4 Oct 28, 2022
This site compares your GitHub Profile to your friends, and analyses and tells your GitHub profile score too.

GitHub βš”οΈ Duel Deployed at ?? : https://githubduel.vercel.app/ Compare your GitHub profiles with your friends It gives score to GitHub profile based o

Anshuman swain 17 Nov 21, 2022
This branch is created to make receive and send data to api using async and await methods

Microverse-Leader-Board Project from module 2 week 4 This branch is created to make receive and send data to api using async and await methods Screens

Akshitha Reddy 6 Apr 22, 2022
A full-stack social media application where users can post and share their coding projects, adding friends, and joining the discussion in threaded comments on project posts.

CodeFlow Description CodeFlow is a social media application where users can post and share their coding projects with others. By logging in or signing

Chris Nohilly 4 Dec 8, 2022
✨ View all of your GitHub stats and compare your stats with friends, made using nextjs and tailwind.

Octotastic All of your GitHub Stats in one place. Features: View your own stats or any other user's stats. View advanced stats using graphs and charts

ashish 10 Sep 6, 2022
FocusSpace - A time-management tool to help you stay focus with your friends

FocusSpace ?? ElleHacks2022 - (Telus) First Place ?? Developers Manyi Cheng(@man

Manyi Cheng 1 Feb 13, 2022
A new way to share your readings with friends. Hope you like it!

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Gardenia Georgia 4 Sep 9, 2022
Diush - a secure funnel for selling items to your friends and network

diush a secure funnel for selling items to your friends and network. learn more at diush.xyz Β» diush is an open-source mobile platform that acts as a

diush 7 Dec 21, 2022