LoginSignup
0
0

More than 5 years have passed since last update.

gulp の Typetalk 通知プラグインを作った話

Posted at

概要

gulp の Typetalk 通知プラグイン gulp-typetalk を作ったので紹介する記事です。

前提知識

Typetalk って何?という方は こちら

gulp とは?

gulp is a toolkit for automating painful or time-consuming tasks in your development workflow, so you can stop messing around and build something.

Node.js 製のタスクランナーです。

使い方

1) Typetalk でボットを作成します。

Screen Shot 2019-03-07 at 1.00.27.png

メッセージの投稿を行うので、topic.post にチェックを入れます

項目
ID gulp-typetalk
Full Name gulp-typetalk

2) gulpfile を作成します。

サンプルコード

// gulpfile.js
const typetalk = require("gulp-typetalk");

function typetalkExample (cb) {
    typetalk({
        token: YOUR_TYPETALK_TOKEN,
        topicId: YOUR_TOPIC_ID,
        message: "Hello, World!"
    });
    cb();
}

exports.default = typetalkExample;

YOUR_TYPETALK_TOKEN は手順1で作成したボットのトークン、YOUR_TOPIC_ID はボットがいるトピックのIDで置き換えてください

3) package.json を作成します。

{
  "scripts": {
    "gulp": "gulp"
  }
}

4) 依存ライブラリをインストールします。

$ npm i --save-dev gulp gulp-typetalk

5) 実行します。

$ npm run gulp

6) メッセージが投稿されます。

Screen Shot 2019-03-07 at 1.11.13.png

手順は以上となります。いかがだったでしょうか?フィードバック歓迎です :pray:

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0