diff --git a/cmd/swimming/notify/main.go b/cmd/swimming/notify/main.go index 084f285..41a6518 100644 --- a/cmd/swimming/notify/main.go +++ b/cmd/swimming/notify/main.go @@ -18,8 +18,13 @@ func Handler(ctx context.Context, request events.APIGatewayProxyRequest) (events env := config.GetInstance() botId := env.SwimNotifyBotId channelId := env.SwimNotifyChannelId + message, messageExist := request.QueryStringParameters["message"] content := url.QueryEscape("[溫腥提醒]各位奴才們,明天又到了一週最開心的週二看妹日囉😍,請別忘了 攜帶泳具👙,喵~") + + if messageExist { + content = url.QueryEscape(message) + } requestURL := fmt.Sprintf("https://api.telegram.org/bot%s/sendMessage?chat_id=%s&text=%s", botId, channelId, content) res, err := http.Get(requestURL) diff --git a/serverless.yml b/serverless.yml index 3f33e14..d5fff11 100644 --- a/serverless.yml +++ b/serverless.yml @@ -148,6 +148,9 @@ resources: KeySchema: - AttributeName: UserId KeyType: HASH + TimeToLiveSpecification: + AttributeName: ttl + Enabled: true TableName: Fn::Join: - "-"