You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Implement channel welcome messages
* DRY up the command.go code by moving commands to separate functions
* Review fixes#1
* Change keys prefix ordering
* Switch back to sending ephemeral posts
* Send an opportunistic ephemeral post and a DM
Co-authored-by: Pawel Rozlach <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+4-1
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ where
61
61
-**TeamName**: The team for which the Welcome Bot sends a message for. Must be the team handle used in the URL, in lowercase. For example, in the following URL the **TeamName** value is `my-team`: https://example.com/my-team/channels/my-channel
62
62
-**DelayInSeconds**: The number of seconds after joining a team that the user receives a welcome message.
63
63
-**Message**: The message posted to the user.
64
-
- (Optional) **AttachmentMessage**: Message text in attachment containing user action buttons.
64
+
- (Optional) **AttachmentMessage**: Message text in attachment containing user action buttons.
65
65
- (Optional) **Actions**: Use this to add new team members to channels automatically or based on which action button they pressed.
66
66
-**ActionType**: One of `button` or `automatic`. When `button`: enables uses to select which types of channels they want to join. When `automatic`: the user is automatically added to the specified channels.
67
67
-**ActionDisplayName**: Sets the display name for the user action buttons.
@@ -73,6 +73,9 @@ The preview of the configured messages can be done via bot commands:
73
73
*`/welcomebot help` - show a short usage information
74
74
*`/welcomebot list` - lists the teams for which greetings were defined
75
75
*`/welcomebot preview [team-name]` - sends ephemeral messages to the user calling the command, with the preview of the welcome message[s] for the given team name and the user that requested the preview
76
+
*`/welcomebot set_channel_welcome` - sets the given text as current's channel welcome message
77
+
*`/welcomebot get_channel_welcome` - gets the current's channel welcome message
78
+
*`/welcomebot delete_channel_welcome` - deletes the current's channel welcome message
Copy file name to clipboardExpand all lines: server/command.go
+164-54
Original file line number
Diff line number
Diff line change
@@ -10,24 +10,28 @@ import (
10
10
)
11
11
12
12
constCOMMAND_HELP=`* |/welcomebot preview [team-name] [user-name]| - preview the welcome message for the given team name. The current user's username will be used to render the template.
13
-
* |/welcomebot list| - list the teams for which welcome messages were defined`
13
+
* |/welcomebot list| - list the teams for which welcome messages were defined
14
+
* |/welcomebot set_channel_welcome [welcome-message]| - set the welcome message for the given channel. Direct channels are not supported.
15
+
* |/welcomebot get_channel_welcome| - print the welcome message set for the given channel (if any)
16
+
* |/welcomebot delete_channel_welcome| - delete the welcome message for the given channel (if any)
17
+
`
14
18
15
19
funcgetCommand() *model.Command {
16
20
return&model.Command{
17
21
Trigger: "welcomebot",
18
22
DisplayName: "welcomebot",
19
23
Description: "Welcome Bot helps add new team members to channels.",
0 commit comments