0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

変数のスコープを間違えてたメモ

Last updated at Posted at 2020-11-15

やりたかったこと

LINEで飲みに行きたいと言ったらメッセージが返ってくる予定

あかんかった

単純なミスだからインデントをちゃんとつけよう。(どこのカッコの中に入ってるかわかりにくかった)
飲みに行きたい1人目って返信してもらうはずが、なにも来なかった。
定義されたスコープが違うからと認識しているが、別の理由か?(use strictをグローバルレベルのところには書いてた。)
もう少し調べよう。

        // ユーザーメッセージが飲みに行きたいものかどうか
        if (check_go(event.message.text)) {
            let pushText = '';
            console.log("飲みに行きたいってさ");
                        
            pushText = "飲みに行きたい人1人目";
        }
    // 中略
        // 「プッシュ」で後からユーザーに通知します
        return client.pushMessage(event.source.userId, {
            type: 'text',
            text: pushText,
        });
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?