@@ -139,7 +139,11 @@ func AskStandupYesterdayScheduled(s *common.Slack, userid string) error {
139
139
"uuid" : uuid ,
140
140
}).Info ("Standup uuid generated" )
141
141
142
- _ , _ , channelid , err := s .Client .OpenIMChannel (userid )
142
+ params := & slack.OpenConversationParameters {
143
+ Users : []string {userid },
144
+ }
145
+
146
+ channelid , _ , _ , err := s .Client .OpenConversation (params )
143
147
if err != nil {
144
148
log .WithError (err ).Error ("OpenIMChannel could not get channel id" )
145
149
}
@@ -150,8 +154,8 @@ func AskStandupYesterdayScheduled(s *common.Slack, userid string) error {
150
154
CallbackID : fmt .Sprintf ("standupYesterday_%s" , userid ),
151
155
}
152
156
153
- params := slack .MsgOptionAttachments (attachment )
154
- _ , timestamp , err := s .Client .PostMessage (channelid , params )
157
+ params2 := slack .MsgOptionAttachments (attachment )
158
+ _ , timestamp , err := s .Client .PostMessage (channelid . ID , params2 )
155
159
if err != nil {
156
160
log .WithError (err ).Error ("Failed to post yesterday standup question" )
157
161
}
@@ -165,7 +169,7 @@ loop:
165
169
for {
166
170
select {
167
171
case <- timer .C :
168
- err = postStandupCancelTimeout (s , channelid )
172
+ err = postStandupCancelTimeout (s , channelid . ID )
169
173
if err != nil {
170
174
log .WithError (err ).Error ("Could not cancel standup" )
171
175
}
@@ -176,7 +180,7 @@ loop:
176
180
params2 := & slack.GetConversationHistoryParameters {
177
181
Limit : 1 ,
178
182
Oldest : timestamp ,
179
- ChannelID : channelid ,
183
+ ChannelID : channelid . ID ,
180
184
}
181
185
182
186
history , err := s .Client .GetConversationHistory (params2 )
@@ -201,7 +205,7 @@ loop:
201
205
stamp := history .Messages [0 ].Msg .Timestamp
202
206
switch text {
203
207
case "cancel" :
204
- err = postStandupCancel (s , channelid )
208
+ err = postStandupCancel (s , channelid . ID )
205
209
if err != nil {
206
210
log .WithError (err ).Error ("Could not cancel standup" )
207
211
}
@@ -215,7 +219,7 @@ loop:
215
219
}
216
220
log .Info ("Starting yesterdayRegister" )
217
221
218
- err = askStandupToday (s , channelid , userid , date , times , uuid )
222
+ err = askStandupToday (s , channelid . ID , userid , date , times , uuid )
219
223
if err != nil {
220
224
log .WithError (err ).Error ("Could not start askStandupToday" )
221
225
}
0 commit comments