Even if you love your friends, some times you may forget their birthday and feel bad about that. So are your friends. This script helps you to make sure to celebrate everyone's birthday in the chat group. It's set up for LINE chat app, but the most part should be compaditble with any other chat app.
-
Create a new LINE Channel: https://developers.line.me/en/
Note:- Plan -> Developer Trial
- Use Webhooks -> enabled
-
Create a new Google Apps Script project: https://developers.google.com/apps-script/
- Copy this code and paste on your Google Apps Script project.
- Customize birthday info, message options, etc.
- Go to LINE Developer console and check your channel's access token (if it doesn't exist or expired, issue a new one). Assign it to
CHANNEL_ACCESS_TOKEN
. - Go to LINE Developer console and check your channel's userID and assign it to
to_ID
(replace it with groupID later). - Set up a developer account with GIPHY and obtain an api key, assign it to
API_KEY
ingetVideo
function. - Set up a developer account with Unsplash and obtain a client ID, assign it to
ACLIENT_ID
ingetPreviewImage
function. - Deploy > New deployment.
- Select "Web app".
- Choose "Anyone" for access permission.
- Copy "Current web app URL" and paste it to "Webhook URL" input form on the LINE console.
- Become a "friend" with your channel and invite it to the chat group.
- Send some text in the chat group, then you will get the groupID from the channel.
- Assign the groupID to
to_ID
, delete or comment outdoPost
function. - Click the clock icon and set a trigger for
sendMessage
function.
- Do 7-10 again