Giter Site home page Giter Site logo

--gas_v5_linedebug's Introduction

経緯

いつもLINEBotでオウム返しする方法を調べるので、自力でなんとかできるようにコードを整備する。

主要リンク

システムバージョン

ver1.1.0

制限

環境変数

key value 用途 備考
SSID スプレッドシートID デバッグ用シート
SSNAME シート名 デバッグ用シート
ACCESS_TOKEN チャネルアクセストークン 動作対象のLINEBOT
DEBUG_ID userId/groupId デバッグ用アカウント。開発者の個人LINEなど

デバッガ

function debug_doPost() {
  let e = {
    postData: {
      contents: [
        {test: "test"}
      ]
    }
  }
  doPost(e)
}

function debug_lineview(e) {
  if(e) __output_sheet(e);

  const SSID = __property("SSID").value;
  const SSNAME = __property("SSNAME").value;
  const SHEET = SpreadsheetApp.openById(SSID).getSheetByName(SSNAME);
  const data = JSON.parse(SHEET.getRange(SHEET.getLastRow(), 2).getValue())

  // 参考情報
  const json = JSON.parse(
    data.postData.contents
  ).events  // [0].source.(userId or groupId)を取得
  Logger.log(json);

  return data  // デバッグに使い方ので、doPost(e)の引数相当にする
}

パラメータ

doPost

LINEの標準入力に準拠するが、他の入力にも拡張で対応できる

リクエスト

キー キー必須 想定される値 概要

レスポンス

レスポンスはJSON String形式

キー 欠損の可能性 想定される値 概要

レスポンスは([String] or [JSON String] or [JSONS String])形式

システム管理情報

システム名称 情報
READMEフォーマットのバージョン ver1.2022.02.09
README.gs -> README.md https://github.com/shimajima-eiji/--GAS_v5_Template/blob/main/.github/workflows/convert_gs2md.yml
translate ja -> en https://github.com/shimajima-eiji/--GAS_v5_Template/blob/main/.github/workflows/translate_ja2en.yml

--gas_v5_linedebug's People

Contributors

shimajima-eiji avatar

Watchers

 avatar  avatar

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.