status button
This commit is contained in:
1 parent
c7547a9125
commit
9e94c05fb6
5 files changed
+109
-23
No files matched your search
@@ -318,7 +318,6 @@ func (b *Bot) onMessage(ctx context.Context, m incoming) {
|
||||
}
|
||||
}
|
||||
|
||||
edit("_working…_")
|
||||
pctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
for _, ts := range []string{m.ts, ph} {
|
||||
@@ -437,6 +436,12 @@ func (b *Bot) onAction(ctx context.Context, cb slack.InteractionCallback) {
|
||||
}
|
||||
thread := cb.Message.ThreadTimestamp
|
||||
for _, a := range cb.ActionCallback.BlockActions {
|
||||
if a.ActionID == "cancel" {
|
||||
if cancel, ok := b.running.Load(cb.Channel.ID + "/" + a.Value); ok {
|
||||
cancel.(context.CancelFunc)()
|
||||
}
|
||||
continue
|
||||
}
|
||||
ownerID := a.Value
|
||||
if ownerID != cb.User.ID && ownerID != cb.Channel.ID {
|
||||
continue
|
||||
|
||||
Reference in new issue
Block a user