Git Product home page Git Product logo

gas-slack-incoming-webhook's Introduction

Slack Incoming Webhook for GAS

clasp

A Slack Incoming Webhook client for Google Apps Script.

This Libray is published as Library-ID 1ZIccV8fPCz2UKpNfRxX6Xb-IkusswcAtDXeBbtM3k8IB-qvPToCfPcfX.

Instalation

  1. Create or Open your GAS project.
  2. Cliock Add Library link, then Library daialog is opened. Input library-id
  3. Input 1ZIccV8fPCz2UKpNfRxX6Xb-IkusswcAtDXeBbtM3k8IB-qvPToCfPcfX to Script ID, and click Search button.
  4. Select library version.
  5. Change ID of this library to Slack change Identifier
  6. Click Add button.

Usage

You can use this library in your google apps script, like the following code.

Simple text

function sendMessage() {
  var url = 'https://hooks.slack.com/services/your/incoming/webhooks/url'
  var webhook = new Slack.IncomingWebhook(url);
  webhook.send('Hello World!')
}

Message with Options

function sendMessageWithOpts() {
  const message: IncomingWebhookSendArguments = {
    channel: 'general',
    icon_emoji: ':ok:',
    username: 'Webhook for GAS',
    text: 'send Message With Opts',
  };
  const webhook = new Slack.IncomingWebhook(url);
  webhook.send(message);
}

You can use other message options of Slack Incoming Webhook API. See Incoming Webhooks | Slack

Development

Requirements

  • Node.js
  • Yarn

How to setup your project

  1. Clone this ripository.
  2. Install dependencies by yarn install
  3. Create your GAS project, push code, and open web editor.
    $ yarn clasp:create 
    $ yarn clasp:push
    $ yarn clasp:open

Related Documents

LICEMSE

MIT

gas-slack-incoming-webhook's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar heromo avatar renovate[bot] avatar

Watchers

 avatar  avatar  avatar  avatar

gas-slack-incoming-webhook's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/eslint.yml
  • actions/checkout v4@a5ac7e51b41094c92402da3b24376905380afc29
  • actions/setup-node v4
  • HeRoMo/pronto-action v1.62.0
nodenv
.node-version
  • node 20.14.0
npm
package.json
  • @slack/types ^2.5.0
  • @google/clasp 2.4.2
  • @types/google-apps-script 1.0.83
  • @typescript-eslint/eslint-plugin 7.11.0
  • @typescript-eslint/parser 7.11.0
  • eslint 9.4.0
  • eslint-config-airbnb-base 15.0.0
  • eslint-plugin-googleappsscript 1.0.5
  • eslint-plugin-import 2.29.1

  • Check this box to trigger a request for Renovate to run again on this repository

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.