Skip to content

Instantly share code, notes, and snippets.

@PamornT
Created October 20, 2019 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PamornT/a5a194b632c5b852ded583cc585edc01 to your computer and use it in GitHub Desktop.
Save PamornT/a5a194b632c5b852ded583cc585edc01 to your computer and use it in GitHub Desktop.
...
if(event.message.text === 'register') {
let access_token = await issue_access_token();
access_token = JSON.parse(access_token);
await initialLINE(access_token['token_type'], access_token['access_token']);
await admin.database().ref('token').child(event.source.userId).set(access_token);
reply(event.replyToken, {
type: 'text',
text: '\uDBC0\uDC7F ลงทะเบียน token เรียบร้อยแล้ว เอาไปใช้ได้เลย\n\n' + JSON.stringify(access_token)
});
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment