message_event_response-changes (#19)
Reviewed-on: #19 Co-authored-by: phoenix <kundeng00@pm.me> Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
+3
-3
@@ -16,7 +16,7 @@ type App struct {
|
||||
AuthUrl string
|
||||
ServiceUsername string
|
||||
ServicePassphrase string
|
||||
TwilioConfig *config.TwiloConfig
|
||||
TwilioConfig *config.TwilioConfig
|
||||
}
|
||||
|
||||
func Load() (*App, error) {
|
||||
@@ -56,7 +56,7 @@ func Load() (*App, error) {
|
||||
}
|
||||
}
|
||||
|
||||
func loadTwilioConfig() (*config.TwiloConfig, error) {
|
||||
func loadTwilioConfig() (*config.TwilioConfig, error) {
|
||||
authSid := os.Getenv("TWILIO_AUTH_SID")
|
||||
serviceSid := os.Getenv("TWILIO_SERVICE_SID")
|
||||
authToken := os.Getenv("TWILIO_AUTH_TOKEN")
|
||||
@@ -71,7 +71,7 @@ func loadTwilioConfig() (*config.TwiloConfig, error) {
|
||||
} else if len(phoneNumber) == 0 {
|
||||
return nil, fmt.Errorf("Twilio config phone number not provided")
|
||||
} else {
|
||||
cfg := config.TwiloConfig{}
|
||||
cfg := config.TwilioConfig{}
|
||||
cfg.AccountSID = authSid
|
||||
cfg.AuthToken = authToken
|
||||
cfg.ServiceSID = serviceSid
|
||||
|
||||
@@ -57,7 +57,7 @@ func (s *Scheduler) ScheduleMessage(schMsg scheduling.ScheduledMessage, event sc
|
||||
}
|
||||
|
||||
func (s *Scheduler) RecordEventResponse(schMsgEvent *scheduling.ScheduledMessageEvent, userId uuid.UUID, bytes []byte, sent *time.Time) ([]*message.MessageEventResponse, error) {
|
||||
mre := message.MessageEventResponse{ScheduledMessageEventId: schMsgEvent.Id, UserId: userId, Response: bytes, Sent: *sent}
|
||||
mre := message.MessageEventResponse{ScheduledMessageEventId: schMsgEvent.Id, UserId: userId, Response: bytes, Sent: *sent, Status: message.Message_Event_Response_Status_Scheduled}
|
||||
|
||||
msgEventResponse := MessageEventResponse{Application: s.Application, Token: s.Token}
|
||||
if responses, err := msgEventResponse.RecordEventResponse(&mre); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user