-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add wrap message template for x plugin #1117
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mszostok
force-pushed
the
x-plugin-wrap-tpl
branch
3 times, most recently
from
July 5, 2023 22:33
35dcee5
to
1342f14
Compare
mszostok
requested review from
josefkarasek and
huseyinbabal
and removed request for
josefkarasek
July 5, 2023 22:34
mszostok
force-pushed
the
x-plugin-wrap-tpl
branch
from
July 6, 2023 11:50
1342f14
to
cb364fd
Compare
mszostok
force-pushed
the
x-plugin-wrap-tpl
branch
from
July 6, 2023 11:54
cb364fd
to
7e0335f
Compare
huseyinbabal
reviewed
Jul 6, 2023
huseyinbabal
approved these changes
Jul 6, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with following feedbacks.
- When I execute a command, it feels my command is not worked, but actually it takes time.
- We can maybe introduce a progressing bar in another task as a general solution.
I have prepared a demo for progressing.
package main
import (
"fmt"
"log"
"time"
"github.com/slack-go/slack"
)
func main() {
api := slack.New("xoxb-")
channelID := "" // Slack > Channel > More details > scroll down and copy
// Start a goroutine to send progressing updates
sendProgressingUpdates(api, channelID)
}
func sendProgressingUpdates(api *slack.Client, channelID string) {
progressText := "Operation in progress..."
var messageTimestamp string
// Send the initial message
_, timestamp, _, err := api.SendMessage(channelID, slack.MsgOptionText(progressText, false), slack.MsgOptionAsUser(true))
if err != nil {
log.Fatalf("Failed to send message: %v", err)
}
messageTimestamp = timestamp
// Update the message periodically
for i := 0; i < 100; i++ {
time.Sleep(1 * time.Second)
progressText := fmt.Sprintf("Installation progress: %d%%", i)
_, updatedTimestamp, _, err := api.UpdateMessage(channelID, messageTimestamp, slack.MsgOptionUpdate(messageTimestamp), slack.MsgOptionText(progressText, false))
if err != nil {
log.Printf("Failed to update message: %v", err)
}
messageTimestamp = updatedTimestamp
}
}
slack_progress.mov
Yes, I also like the interactive message, IMO we should do it in the near future. Huge +1 from my side 👍 |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Changes proposed in this pull request:
Testing
Create k3d cluster
Start plugin server:
env PLUGIN_SERVER_HOST=http://host.k3d.internal go run test/helpers/plugin_server.go
Build x plugin:
PLUGIN_TARGETS="x" make build-plugins
Install Botkube with such example config:
config yaml
Example Flux
Install Flux CLI
Initialize flux (it takes a while)
Create Source:
List sources:
Related issue(s)