Giter Site home page Giter Site logo

mattermost-plugin-welcomebot's Introduction

Disclaimer

This repository is community supported and not maintained by Mattermost. Mattermost disclaims liability for integrations, including Third Party Integrations and Mattermost Integrations. Integrations may be modified or discontinued at any time.

Welcome Bot Plugin

Build Status Code Coverage Release HW

Maintainer: @mickmister

Use this plugin to improve onboarding and HR processes. It adds a Welcome Bot that helps welcome users to teams and/or channels as well as easily join channels based on selections.

image

Welcome a new team member to Mattermost Contributors team. Then add the user to a set of channels based on their selection.

image

Configuration

  1. Go to System Console > Plugins > Management and click Enable to enable the Welcome Bot plugin.

  2. Modify your config.json file to include your Welcome Bot's messages and actions, under the PluginSettings. See below for an example of what this should look like.

Usage

To configure the Welcome Bot, edit your config.json file with a message you want to send to a user in the following format:

        "Plugins": {
            "com.mattermost.welcomebot": {
                "WelcomeMessages": [
                    {
                        "TeamName": "your-team-name",
                        "DelayInSeconds": 3,
                        "IncludeGuests": false,
                        "Message": [
                            "Your welcome message here. Each list item specifies one line in the message text."
                        ],
                        "AttachmentMessage": [
                            "Attachment message containing user actions"
                        ],
                        "Actions" : [
                            {
                                "ActionType": "button",
                                "ActionDisplayName": "User Action",
                                "ActionName": "action-name",
                                "ActionSuccessfulMessage": [
                                    "Message posted after the user takes this action and joins channels specified by 'ChannelsAddedTo'."
                                ],
                                "ChannelsAddedTo": ["channel-1", "channel-2"]
                            },
                            {
                                "ActionType": "automatic",
                                "ChannelsAddedTo": ["channel-3", "channel-4"]
                            }
                        ]
                    }
                ]
            }
        },

where

  • 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
  • DelayInSeconds: The number of seconds after joining a team that the user receives a welcome message.
  • Message: The message posted to the user.
  • (Optional) IncludeGuests: Whether or not to include guest users.
  • (Optional) AttachmentMessage: Message text in attachment containing user action buttons.
  • (Optional) Actions: Use this to add new team members to channels automatically or based on which action button they pressed.
    • 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.
    • ActionDisplayName: Sets the display name for the user action buttons.
    • ActionName: Sets the action name used by the plugin to identify which action is taken by a user.
    • ActionSuccessfulMessage: Message posted after the user takes this action and joins the specified channels.
    • ChannelsAddedTo: List of channel names the user is added to. Must be the channel handle used in the URL, in lowercase. For example, in the following URL the channel name value is my-channel: https://example.com/my-team/channels/my-channel

The preview of the configured messages, as well as the creation of a channel welcome message, can be done via bot commands:

  • /welcomebot help - Displays usage information.
  • /welcomebot list - Lists the teams for which greetings were defined.
  • /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.
  • /welcomebot set_channel_welcome [welcome-message] - Sets the given text as current's channel welcome message.
  • /welcomebot get_channel_welcome - Gets the current channel's welcome message.
  • /welcomebot delete_channel_welcome - Deletes the current channel's welcome message.

Example

Suppose you have two teams: one for Staff (with team handle staff) which all staff members join, and another for DevSecOps (team handle devsecops), which only security engineers join.

Those who join the Staff team should be added to a set of channels based on their role:

  • Developers added to Bugs, Jira Tasks, and Sprint Planning channels
  • Account Managers added to Leads, Sales Discussion, and Win-Loss Analysis channels
  • Support added to Bugs, Customer Support and Leads channels

Moreover, those who join the DevSecOps team should automatically be added to Escalation Process and Incidents channels.

To accomplish the above, you can specify the following configuration in your config.json file.

        "Plugins": {
            "com.mattermost.welcomebot": {
                "WelcomeMessages": [
                    {
                        "TeamName": "staff",
                        "DelayInSeconds": 5,
                        "Message": [
                            "### Welcome {{.UserDisplayName}} to the Staff {{.Team.DisplayName}} team!",
                            "",
                            "If you have any questions about your account, please message your @system-admin.",
                            "",
                            "For feedback about the Mattermost app, please share in the ~mattermost channel."
                        ]
                    },
                    {
                        "TeamName": "staff",
                        "DelayInSeconds": 10,
                        "AttachmentMessage": [
                            "Let's get started by adding you to key channels! What's your role in the company?"
                        ],
                        "Actions" : [
                            {
                                "ActionType": "button",
                                "ActionDisplayName": "Developer",
                                "ActionName": "developer-action",
                                "ChannelsAddedTo": ["bugs", "jira-tasks", "sprint-planning"],
                                "ActionSuccessfulMessage": [
                                    "### Awesome! I've added you to the following developer channels:",
                                    "~bugs - To help investigate or report bugs",
                                    "~jira-tasks - To stay updated on Jira tasks",
                                    "~sprint-planning - To plan and manage your team's Jira sprint"
                                ]
                            },
                            {
                                "ActionType": "button",
                                "ActionDisplayName": "Customer Engineer",
                                "ActionName": "customer-engineer-action",
                                "ChannelsAddedTo": ["leads", "sales-discussion", "win-loss-analysis"],
                                "ActionSuccessfulMessage": [
                                    "### Awesome! I've added you to the following developer channels:",
                                    "~leads - To stay updated on incoming leads",
                                    "~sales-discussion - To collaborate with your fellow Customer Engineers,
                                    "~win-loss-analysis - To conduct win-loss analysis of closed deals"
                                ]
                            },
                            {
                                "ActionType": "button",
                                "ActionDisplayName": "Support",
                                "ActionName": "support-action",
                                "ChannelsAddedTo": ["bugs", "customer-support", "leads"],
                                "ActionSuccessfulMessage": [
                                    "### Awesome! I've added you to the following developer channels:",
                                    "~bugs - To help investigate or report bugs",
                                    "~customer-support - To troubleshoot and resolve customer issues",
                                    "~leads - To discuss potential accounts with other Customer Engineers"
                                ]
                            }
                        ]
                    },
                    {
                        "TeamName": "devsecops",
                        "DelayInSeconds": 5,
                        "Message": [
                            "### Welcome {{.UserDisplayName}} to the {{.Team.DisplayName}} team!",
                            "",
                            "**If you're not a member of the Security Meta Team and ended up on this team by accident, please report this issue and leave the team!**",
                            "",
                            "##### I've added you to a few channels to get you started:",
                            "",
                            "~escalation-process - To review the DevSecOps escalation process",
                            "~incidents - To collaborate on and resolve security incidents"
                        ],
                        "Actions" : [
                            {
                                "ActionType": "automatic",
                                "ChannelsAddedTo": ["escalation-process", "incidents"]
                            }
                        ]
                    }
                ]
            }
        },
        "PluginStates": {
            "com.mattermost.welcomebot": {
                "Enable": true
            }
        }

We've used {{.UserDisplayName}} and {{.Team.DisplayName}} in the example config.json. You can insert any variable from the MessageTemplate struct, which has the following fields:

type MessageTemplate struct {
    WelcomeBot      *model.User
    User            *model.User
    Team            *model.Team
    Townsquare      *model.Channel
    DirectMessage   *model.Channel
    UserDisplayName string
}

Development

This plugin contains a server and webapp portion.

Use make dist to build distributions of the plugin that you can upload to a Mattermost server. Use make check-style to check the style. Use make deploy to deploy the plugin to your local server.

For additional information on developing plugins, refer to our plugin developer documentation.

mattermost-plugin-welcomebot's People

Contributors

alifarooq0 avatar bbodenmiller avatar coreyhulen avatar cpanato avatar cpoile avatar crspeller avatar cwarnermm avatar hanzei avatar jasonblais avatar jfrerich avatar justinegeffen avatar kshitij-katiyar avatar levb avatar maisnamrajusingh avatar mickmister avatar nathanaelhoun avatar pazdev avatar sibasankarnayak avatar spirosoik avatar srkgupta avatar streamer45 avatar toninis avatar vespian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mattermost-plugin-welcomebot's Issues

Empheral messages?

Hi

I deployed the welcome bot some months ago to my instance but no one seems to join the channels that the welcome bot is proposing. Either they are not worthy to join or new users don’t see it enough.

I think it would be more visible when the welcome message would be posted to TownSquare as it is in the direct view of the user.

Welcome bot will not let me add a message to private channels

Seems like the feature of adding a channel level welcome message should work for both public and private channels.
When I try using this feature I see a message saying this is not supported for DM channels. However the channel is not a DM.
image

Steps:

  • Create or open any private channel
  • Type /welcomebot set_channel_welcome "I like pickles"
    Observed: welcome messages are not supported for direct channels

Add example usage of Include Guest to read me

Can you please add something to the read-me that covers an example of using the new guest-account support feature?
It would be helpful if you could just add that middle line below to the read-me as you already have changes in.

                        "DelayInSeconds": 3,
                        "IncludeGuests": false,
                        "Message": [
                        
                    

Allow mentioning user in the channel welcome messages

When configuring Team welcome messages, the config allows referencing fields from the MessageTemplate struct. However, setting a welcome message through /welcomebot set_channel_welcome only allows text. This ticket is asking to allow accessing the members of the MessageTemplate struct while creating a channel welcomebot message.

type MessageTemplate struct {
    WelcomeBot      *model.User
    User            *model.User
    Team            *model.Team
    Townsquare      *model.Channel
    DirectMessage   *model.Channel
    UserDisplayName string
}

The implementation is up for discussion, but one idea is to somehow incorporate inline templating similar to the usage found in the config.

Example: "### Welcome {{.UserDisplayName}} to the Staff {{.Team.DisplayName}} team!",

Integrate GolangCI-Lint

Mattermost is currently in the process of using golangci-lint as the default linter for all go projects. mattermost-community/mattermost-plugin-autolink#108 serves as an example of how the migration should look like:

  1. Copy .golangci.yml from https://github.com/mattermost/mattermost-plugin-autolink/ into this repository.
  2. Copy Makefile from https://github.com/mattermost/mattermost-plugin-autolink/ into this repository.
  3. Copy build/ from https://github.com/mattermost/mattermost-plugin-autolink/ into this repository.
  4. Run go mod tidy and make dist to ensure the build system works fine.
  5. Update linters-settings.goimports.local-prefixes to the go module path i.e. to github.com/mattermost/mattermost-plugin-welcomebot.
  6. Run make golangci-lint and fix all issues that arise.

Fixing an linter issue is sometimes trivial but can also be quite complicated. There might be cases, where ignoring an issue using issues.exclude-rules is needed. If you don't know how to resolve an error, please reach out to @hanzei on the Mattermost Community Server or ask the question here.

Mattermost Reorganizes json

So I will say at first that I admit this is probably not a big deal in the grand scheme of things, and maybe is as much a personal preference issue as anything. The issue is that when you load the config into the Mattermost config.json file, it reorganizes the layout and makes it (in my opinion) more difficult to follow and easier to make a mistake if you need to update it.

What I'm talking about is if you look at the example in the readme, it's pretty easy to follow what's going on. The TeamName is at the top, followed by the Message and so on...

"WelcomeMessages": [
            {
                "TeamName": "your-team-name",
                "DelayInSeconds": 3,
                "Message": [
                    "Your welcome message here. Each list item specifies one line in the message text."
                ],
                "AttachmentMessage": [
                    "Attachment message containing user actions"
                ],
                "Actions" : [
                    {

The problem is that when you start Mattermost, it rearranges everything in to alphabetical order and makes it harder to follow.

"com.mattermost.welcomebot": {
                "welcomemessages": [
                    {
                        "Actions": [
                            {
                                "ActionDisplayName": "I'm a Developer",
                                "ActionName": "developer-action",
                                "ActionSuccessfulMessage": [
                                                                    ],
                                "ActionType": "button",
                                "ChannelsAddedTo": [
                                                      ]
                            },
                            {
                                "ActionDisplayName": "Change and Incident Management",
                                "ActionName": "manager-action",
                                "ActionSuccessfulMessage": [
                                ],
                                "ActionType": "button",
                                "ChannelsAddedTo": [
                                                                  ]
                            },
                            {
                                "ActionType": "automatic",
                                "ChannelsAddedTo": [
                                                                  ]
                            }
                        ],
                        "AttachmentMessage": [
                            "I can help you get started by joining you to some existing channels. Which types of channels would you like to join?"
                        ],
                        "DelayInSeconds": 5,
                        "Message": [
                            "### Welcome to Mattermost!",
],
                        "TeamName": "team"

I cut a lot of stuff out obviously, but hopefully you can see what I'm talking about with the TeamName being at the bottom, and some of the fields being kind of all over the place. Is this something that can be fixed so it doesn't do this?

Again, I admit that this is maybe just my personal preference as much as an actual issue that needs to be addressed and I don't like Mattermost messing with my config.json in general, but I thought it was worth pointing out at least.

Welcome bot message is not triggering on new user

I have added configuration in config.json file as follows:

"Plugins": { "com.mattermost.welcomebot": { "welcomemessages": [ { "DelayInSeconds": 2, "Message": [ "### Welcome {{.UserDisplayName}} to the {{.Team.DisplayName}} team!", "", "If you have any questions about your account, please message your @ibartsindia." ], "TeamName": "workplace" }, { "Actions": [ { "ActionDisplayName": "Director", "ActionName": "director-action", "ActionSuccessfulMessage": [ "### Awesome! I have added you to the following developer channels:", "~core-team - This channel is for core team day to day planning.", "~web-development - To discuss topics related to Web Development", "~app-development - To discuss topics related to App Development", "~hr-work- To discuss HR related topics", "~management-team- To discuss topics related to management" ], "ActionType": "button", "ChannelsAddedTo": [ "core-team", "web-development", "app-development", "hr-work", "management-team" ] }, { "ActionDisplayName": "Supervisor", "ActionName": "supervisor-action", "ActionSuccessfulMessage": [ "### Awesome! I have added you to the following developer channels:", "~core-team - This channel is for core team day to day planning.", "~web-development - To discuss topics related to Web Development", "~app-development - To discuss topics related to App Development", "~hr-work- To discuss HR related topics", "~management-team- To discuss topics related to management" ], "ActionType": "button", "ChannelsAddedTo": [ "core-team", "web-development", "app-development", "hr-work", "management-team" ] }, { "ActionDisplayName": "HR", "ActionName": "hr-action", "ActionSuccessfulMessage": [ "### Awesome! I have added you to the following developer channels:", "~hr-work- To discuss HR related topics" ], "ActionType": "button", "ChannelsAddedTo": [ "hr-work" ] }, { "ActionDisplayName": "Senior Manager", "ActionName": "senior-manager-action", "ActionSuccessfulMessage": [ "### Awesome! I have added you to the following developer channels:", "~core-team - This channel is for core team day to day planning.", "~web-development - To discuss topics related to Web Development", "~app-development - To discuss topics related to App Development", "~hr-work- To discuss HR related topics", "~management-team- To discuss topics related to management" ], "ActionType": "button", "ChannelsAddedTo": [ "core-team", "web-development", "app-development", "hr-work", "management-team" ] }, { "ActionDisplayName": "Assistant Manager", "ActionName": "assistant-manager-action", "ActionSuccessfulMessage": [ "### Awesome! I have added you to the following developer channels:", "~web-development - To discuss topics related to Web Development", "~app-development - To discuss topics related to App Development", "~management-team- To discuss topics related to management" ], "ActionType": "button", "ChannelsAddedTo": [ "management-team", "web-development", "app-development" ] }, { "ActionDisplayName": "Web Developer", "ActionName": "web-developer-action", "ActionSuccessfulMessage": [ "### Awesome! I have added you to the following developer channels:", "~web-development - To discuss topics related to Web Development" ], "ActionType": "button", "ChannelsAddedTo": [ "web-development" ] }, { "ActionDisplayName": "App Developer", "ActionName": "support-action", "ActionSuccessfulMessage": [ "### Awesome! I have added you to the following developer channels:", "~app-development - To discuss topics related to App Development" ], "ActionType": "button", "ChannelsAddedTo": [ "app-development" ] }, { "ActionDisplayName": "SEO Executive", "ActionName": "seo-executive-action", "ActionSuccessfulMessage": [ "### Awesome! I have added you to the following developer channels:", "~web-development - To discuss topics related to Web Development", "~seo-work - To discuss topics related to SEO Work" ], "ActionType": "button", "ChannelsAddedTo": [ "seo-work", "web-development" ] } ], "AttachmentMessage": [ "Let's get started by adding you to key channels! What is your role in the company?" ], "DelayInSeconds": 5, "TeamName": "workplace" } ] } }, "PluginStates": { "com.mattermost.welcomebot": { "Enable": true } }

Here is my team name:

image

Configuring Welcome Bot on Mattermost Cloud

Hi, team.

While the Welcome Bot is configurable on config.json for the self hosted Mattermost Server, how do we go about configuring this on the Mattermost Cloud solution?

image

Any plans on supporting the configuration on the UI level in the future to cater for the Mattermost Cloud system administrator to set up accordingly?

Failed to create welcomebot user

Hi Guys

Noticed an issue here where the welcomebot cannot create the welcombot user if the option for accepted domains is set.

{"level":"error","ts":1561111697.1033537,"caller":"mlog/sugar.go:23","msg":"CreateUser: The email you provided does not belong to an accepted domain. Please contact your administrator or sign up with a different email., ","plugin_id":"com.mattermost.welcomebot"}

Welcome bot user is created with the email: [email protected]

Workaround is to delete the accepted domains from the list or add mattermost.com to the accepted domain list both of these affect the level of security of the instance.

Regards
Lancealot

Action button faulty

I have latest mattermost installed with fresh install of welcomebot. This is mattermost-docker latest stable docker, docker-compose running ubuntu 20.04LTS

I have enabled the plugin. Adapted the config.json as follows:

    "PluginSettings": {
        "Enable": true,
        "EnableUploads": false,
        "AllowInsecureDownloadURL": false,
        "EnableHealthCheck": true,
        "Directory": "./plugins",
        "ClientDirectory": "./client/plugins",
        "Plugins": {
            "com.mattermost.custom-attributes": {
                "customattributes": [
                    {
                        "GroupIDs": "",
                        "Name": "Interests",
                        "TeamIDs": [],
                        "UserIDs": [
                            "fjadklgjaklbdsalj"
                        ]
                    }
                ]
            },
            "com.mattermost.welcomebot": {
                "WelcomeMessages": [
                    {
                        "Actions": [
                            {
                                "ActionDisplayName": "Social Butterfly",
                                "ActionName": "social-butterfly",
                                "ActionSuccessfulMessage": [
                                    "User successfully joined the Telegram and Community channels"
                                ],
                                "ActionType": "button",
                                "ChannelsAddedTo": [
                                    "telegram",
                                    "community"
                                ]
                            }
                        ],
                        "AttachmentMessage": [
                            "Please inform us which roles you are interested in filling. Click the buttons to enable the relevant channels"
                        ],
                        "DelayInSeconds": 3,
                        "Message": [
                            "Welcome to [redacted]. We're happy to have you around."
                        ],
                        "TeamName": "ou-test"
                    }
                ]
            },

I see welcomebot for new user initial login. My custom text is visible. The button does not result in the result message or channel joins.

Here is the output inmattermost.log:

{"timestamp":"2022-01-06 20:45:04.660 Z","level":"debug","msg":"Action integration error.","caller":"web/context.go:101","path":"/api/v4/posts/hrht1jmf3prq9qmotgebjeax8c/actions/jupo71zsxfd4dpx7wypx8g5q7y","request_id":"3n5ju8i47bb3dd85fyhtfmrh6w","ip_addr":"42.42.42.42","user_id":"msjwkk9qoiygtetqrebihwgb4a","method":"POST","err_where":"DoActionRequest","http_code":400,"err_details":"err=Post \"https://[url.redacted]/plugins/com.mattermost.welcomebot/addchannels\": dial tcp 127.0.1.1:443: connect: connection refused"}
{"timestamp":"2022-01-06 20:45:04.661 Z","level":"debug","msg":"Received HTTP request","caller":"web/handlers.go:156","method":"POST","url":"/api/v4/posts/hrht1jmf3prq9qmotgebjeax8c/actions/jupo71zsxfd4dpx7wypx8g5q7y","request_id":"3n5ju8i47bb3dd85fyhtfmrh6w","host":"[url.redacted]","scheme":"https","status_code":"400"}

Are users reporting success with the docker installation? Any ideas where to go from here?

Execute slash commands

I would like to execute slash commands when a new user joins. An example would be to add the new user to the standup bot by issuing /standup addmember [NAME] in the #standup channel.

adding to channels with wildcard

it would be great if it was possible to extend the ChannelsAddedTo syntax to allow wildcards.

as in the following, where the user would get added to bugs, developers, devops, devsecops, devices and devilish

"Actions" : [
{
  "ActionType": "button",
  "ActionDisplayName": "Developer",
  "ActionName": "developer-action",
  "ChannelsAddedTo": ["bugs", "dev*"],
  "ActionSuccessfulMessage": [
    "### Awesome! I have added you to the developer channels:"
  ]
},

Ability to configure outside of the main config.json?

Looking at trying to use WelcomeBot on a large Mattermost instance where each team needs the ability to configure their own WelcomeBot settings. Configuring 100+ WelcomeBot team messages in the main config.json is not ideal. Is there any plan to allow for separate JSON files to be used for each team that is stored outside of the main config.json? Is it even possible or will it require changes to mattermost-server?

[Request] Support adding to channels based on groups, not just teams

Given Teams segregate the workspace and Groups do not, it would be nice to be able to have people added to specific groups be added automatically to corresponding channels. Pretty much the exact 'teams' behavior that is described in the Readme example, except based on groups instead.

From the readme:

Those who join the Staff team should be added to a set of channels based on their role:

Developers added to Bugs, Jira Tasks, and Sprint Planning channels
Account Managers added to Leads, Sales Discussion, and Win-Loss Analysis channels
Support added to Bugs, Customer Support and Leads channels

This type of behavior is highly desirable for groups.

Restricted Direct Message Setting in Server Breaks WelcomeBot

Environment (probably not relevant): Mattermost Team Server ESR 6.3.9, Welcomebot 1.2.0.

There are multiple Teams on the server.

Welcomebot was configured and running and I remember it already worked in the past. It also reacted and reacts to /welcomebot commands.

However, it did NOT (any more) send any welcome message to new users, did NOT add the new users to channels, and did NOT send configured welcome messages to users joining channels with welcome message.

The server logs showed an error message when a user joined, which didn’t really help me:

{"timestamp":"2022-07-11 19:15:43.993 +02:00","level":"error","msg":"failed to query direct message channel","caller":"app/plugin_api.go:928","plugin_id":"com.mattermost.welcomebot","user_id":"xxxxxxxxxxxxxxxxxxxx"}

Fortunately, during debuggin I then tried channel-specific welcome messages I had never used before, and these triggered a more helpful error message:

{"timestamp":"2022-07-12 06:41:34.823 +02:00","level":"info","msg":"{\"level\":\"error\",\"msg\":\"error occured while creating direct channel to the user\",\"fields\":[{\"Key\":\"UserId\",\"Type\":15,\"Integer\":0,\"String\":\"xxxxxxxxxxxxxxxxxxxx\",\"Interface\":null},{\"Key\":\"error\",\"Type\":25,\"Integer\":0,\"String\":\"\",\"Interface\":{\"id\":\"api.channel.create_channel.direct_channel.team_restricted_error\",\"message\":\"A direct channel cannot be created between these users because they do not share a team in common.\",\"detailed_error\":\"\",\"status_code\":403}}]}\n","caller":"io/io.go:425","plugin_id":"com.mattermost.welcomebot","source":"plugin_stderr"}

Actually my server has following setting enabled:

"RestrictDirectMessage": "team"

This was the culprit, after disabling this setting, Welcomebot suddenly worked.

Using the CLI, I was able to add the welcomebot account to the relevant teams, and then it continued to work after re-enabling this setting.

However, several things are fishy here:

  • According to this setting’s description in the GUI, it should ONLY affect the UI and now have any influence on server side permissions:

‘Any member of the team’ limits the ability in the Direct Messages ‘More’ menu to only open Direct Message channels with users who are in the same team. Note: This setting only affects the UI, not permissions on the server.

Don’t get me wrong, I think permission checking on the server would actually be important for this setting, it’s just that the help text does not seem to match implemented behaviour (any more?).

  • I could not find any hint / warning anywhere that the behaviour of Welcomebot would be influenced by this setting, and also didn’t find any configuration instructions for any special measures to take if this setting is enabled.

So I wonder:

  • Did I miss some instructions somewhere?
  • Would Welcomebot be supposed to work “automatically” despite RestrictDirectMessage being enabled? Is this some misconfiguration in my instance (and if so, how could it happen)?
  • May there be other integrations / plugins be affected by this setting?
  • Is it a correct / official solution to add bot accounts to teams using the CLI, or would the correct solution be different?

Maybe someone with more insight into Mattermost permissions / bot accounts can shed some light into this.

From my current understanding, I see at least two documentation bugs:

  1. The help text for the RestrictDirectMessage setting is wrong, it actually DOES influence permission checking on the server.
  2. Welcomebot lacks information about the RestrictDirectMessage setting in its setup documentation, and that additional steps are required like manually adding welcomebot to the Teams it shall be active on.
  • Or is the problem a different one, and shouldn’t the server check Direct Message permissions?
  • Or maybe bot accounts should be excluded from this check?
  • Or maybe the Welcome bot plugin should add the welcomebot account to all Teams mentioned in the config.json automatically?

Welcomebot preview not working (team not found)

Hi there,

not sure this is an issue with Mattermost itself or the welcomebot, but the preview command (/welcomebot preview ABC) won't find the team name:

{"level":"error","ts":1592559079.462729,"caller":"mlog/sugar.go:23","msg":"failed to query team","plugin_id":"com.mattermost.welcomebot","team_name":"ABC","err":"SqlTeamStore.GetByName: Unable to find the existing team., name=ABC,sql: no rows in result set"}

I triple-checked the team name in the team settings and even set it to something else and back again to make sure it is correct. Still does not work. Any ideas?

Mattermost Version: 5.24.0
Database Schema Version: 5.24.0
Database: postgres

Welcomebot 1.2.0

bulk import and welcomebot

Is it possible to get Welcome Bot to deliver the message to users who were added to a team via bulk import?

welcomebot not displaying

i'm running Mattermost-5.26.0, with a single ("Primary") team named chat.

I have installed the welcomebot-1.2.0 and configured it to add new users to a couple of channels (and ask them whether they want to be added to even more channels).

When i run /welcomebot preview chat the messages are displayed nicely (though the DelayInSeconds is ignored; i guess this is itentional).

However, when i create a new user and let them log-in for the first time, no messages are displayed at all.

What could possibly be wrong?

The users are imported with bin/mattermost import bulk /path/to/users.json (as self sign-up has been disabled).

If i set a channel-welcome with /welcomebot set_channel_welcome blablabla this gets displayed nicely.

Any hints?

Neither the preview comand nor welcome message works if team name has a space in it

When a new user joins the team, they are not getting the welcome message.

When I type /welcomebot list, I get

Teams for which welcome messages are defined:

  • Word1 Word2

None of the following work:

  • /welcomebot preview Word1 Word2
  • /welcomebot preview Word1\ Word2
  • /welcomebot preview "Word1 Word2"
  • /welcomebot preview 'Word1 Word2'
  • /welcomebot preview [Word1 Word2]

All of the above produce this:

Please specify a team, for which preview should be made.

Incidentally, the team url is word1-word2 and that doesn't seem to work either; we tried adding it to the config and when trying to do /welcomebot preview word1-word2, it says

team word1-word2 has not been found

even though it's in the config. So it doesn't look like the Welcomebot plugin uses the url, but maybe it should, since that would address the spaces issue?

Can't seem to get commands to work

I've tried for quite some time, and since nobody elase seems to be having this problem, I'm writing here.

I've got a Mattmost 5.19.1 installed, with Welcomebot 1.1.1 enabled.

However, I cannot get /welcomebot help/list/preview to work. When using it, I get the:

Command with a trigger of '/welcomebot' not found

Is there anything setup I've missed?

Testing new messages

We would like to see what our welcome message looks like, but have no way to test this before launching it on the server.

Implement plugin settings in admin console

The configuration for the plugin is currently handled directly in the server's config.json, which makes it difficult to manage since you can't use the MM UI to do so.

The task here is to declare these config settings in the plugin's plugin.json file, and implement any complex settings as a custom setting in the admin console.

Can't use {{.UserDisplayName}} in channel welcome message

Hi,

i can't use {{.UserDisplayName}} in the welcome message. Is it even possible? I tried:

/welcomebot set_channel_welcome :wave_light_skin_tone: Herzlich Willkommen {{.UserDisplayName}} bei uns im Büro. Schön das du dich uns angeschlossen hast. :hugging_face:

Thanks for help.

Regards

How to add welcome message in k8s environment

Hi,
How can i add a welcome message in a k8s environment?
I can control the plugin using mattermost cli, but the config.json management is a bit of an issue to edit cause it will not save in the db

"preview" command not working

Hi all,

I can't seem to set up the welcome message while testing it with /welcomebot preview [team-name] command in my Mattermost.

I've also tried to update my welcomebot to the latest release as of today, but to no avail.

I've used the command:
/welcomebot preview cudy - cudy is my team's name (https://collaborate.cudy.co/v1uY1Pqo)

But i'm always getting an error: team cudy has not been found (https://collaborate.cudy.co/12u4x7jJ)

I tried troubleshooting with the following commands:

  1. /welcomebot preview cudy @[username] and got the response Please specify a team, for which preview should be made. (https://collaborate.cudy.co/z8uOAGWJ)
  2. /welcomebot preview Cudy and got the response team Cudy has not been found
  3. /welcomebot preview CUDY and got the response team CUDY has not been found
  4. /welcomebot set_channel_welcome hello for a public channel, and got the response stored the welcome message: hello (https://collaborate.cudy.co/v1uY1PkP)

Here are my settings in the config.json:
https://collaborate.cudy.co/BluKjb6j

I've also changed the Cudy to cudy and CUDY in the config.json file but it doesn't work too.

Ignore Bot Accounts

I might have missed something in the docs, but is there a way to configure Welcomebot to carry out automatic actions only for new non-bot users. Currently when we add a bot to the team, so that it can be added to a specific private channel to post log messages for example, it gets added to several other channels by the welcome bot.

translatable welcome message

hello,
if you are in a multilingual environment, having welcome message translated would be a very nice feature.

thanks.

Channel welcome message is buggy

If I set a channel welcome message for Town Square as well as have an automatic join channel it appears the welcome message does not appear.

Also, if I set welcome messages for channels and then join that channel via the Welcomebot button clicks I see unread message indicator for channel but upon clicking I see no channel welcome message.

Migrate Welcome Bot plugin to use bot accounts

If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Plugin: Jira" community channel.

New contributors please see our Developer's Guide and our Plugins Guide.


Migrate Welcome Bot plugin to use bot accounts.

For an example, here is a PR that migrated the Demo Plugin to use bot accounts with a helper function mattermost/mattermost-plugin-demo#29

Welcome channel message visibil for all channel members?

Hi,

the welcome channel message is atm "(Only visible to you)".

I want to make an automated channel welcome message for new userser that is visibil for all channel Members. If its like a channelmessage all useres could replay to the message an welcome the new member in our team.

Is this possible?

Regards

Add users to another team when they join any team

Hi, I can't figure out if I'm not seeing it in the docs, or if this is just not supported, but I would like a way to automatically add users to specific Teams when they join other teams.
Scenario: We have a team per department, another for each working group, and an All Staff team. I would like users to be able to join the team for their working group and be automatically added to the team for their department and the all staff team. Any way of doing that with the welcome bot?
Appologies if this is an innapropriate place to post this.

Team not found response when using /welcomebot preview [team-name] [user-name]

@jfrerich End to End testing for this has now completed.

When using /welcomebot preview [team-name] [user-name] the help says preview the welcome message for the given team name. The current user's username will be used to render the template.

This command does not work when passing in a username. You get an error that the team was not found.
The command will work when passing in only a team

getting the error while running the *make* Command for welcome-bot

for the mattermost version 5.37 & 6.0, when i Run make Command then i'm getting below error

qa2@qa-latitude-7480-k:~/github/mattermost/mattermost-plugin-welcomebot$ make
Running golangci-lint
golangci-lint run ./...
WARN [runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner.  
WARN [runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner.  Replaced by revive. 
build/deploy/main.go:116:8: undeclared name: `archiver` (typecheck)
	err = archiver.Unarchive(bundlePath, targetPath)
	      ^
build/deploy/main.go:12:2: "github.com/mholt/archiver/v3" imported but not used (typecheck)
	"github.com/mholt/archiver/v3"
	^
server/command.go:45:8: p.API undefined (type *Plugin has no field or method API) (typecheck)
	_ = p.API.SendEphemeralPost(args.UserId, post)
	      ^
server/command.go:49:20: p.API undefined (type *Plugin has no field or method API) (typecheck)
	user, appErr := p.API.GetUser(userID)
	                  ^
server/command.go:131:27: p.API undefined (type *Plugin has no field or method API) (typecheck)
	channelInfo, appErr := p.API.GetChannel(args.ChannelId)
	                         ^
../../../../../snap/golangci-lint/36/src/runtime/cgo/cgo.go:34:8: could not import C (cgo preprocessing failed) (typecheck)
import "C"
       ^
make: *** [Makefile:47: golangci-lint] Error 1

My go version is go version go1.17.2 linux/amd64
NPM version 7.7.6
node version v15.14.0

Screenshot from 2021-11-23 00-10-34

Not executing for existing users

We launched the welcomebot plugin after we had users on the server. Those users that existed prior to the plugin activation have never saw the welcomebot message (myself included). Is there a way to check if an existing user hasn't received this message, and prompt them as if they were a new user?

allow messages for *all* teams

currently we can specify a welcome-text for each team separately.

however, i would like to be able to send people a welcome-message after their first login - regardless of the team they join.

Probably the simplest solution (from a admin-pov) is to be able to omit the TeamName or use a wild-card.

E.g. the following would remind a user of the code-of-conduct the first time they log-in (the TeamName field has been omitted), and gives a welcome-message for each team they join (the TeamName is *):

"Plugins": {
    "com.mattermost.welcomebot": {
        "WelcomeMessages": [
            {
                "DelayInSeconds": 1,
                "Message": [
                    "### Welcome {{.UserDisplayName}}!",
                    "",
                    "Please check out our [Code-Of-Conduct](https://mm.example.com/coc/) before using MatterMost",
                ]
            },
            {
                "TeamName": "*",
                "DelayInSeconds": 5,
                "Message": [
                    "### Welcome {{.UserDisplayName}} to the {{.Team.DisplayName}} team!",
                    "",
                    "Feel free to discuss off-topic things, but please use the ~off-topic channel for this",
                ]
            }
    ]
  }
}

Action integration error

I’m using Mattermost in a K8S environment, using the operator.

I tried to setup the Welcome Bot, but had to do so directly through the database. Even if it’s not ideal, it seems to be working because I can see my message when I type /welcomebot list or /welcomebot preview myteam.

However, when I click on an action button, there is the following error in the console:

{
  "id": "api.post.do_action.action_integration.app_error",
  "message": "Action integration error.",
  "detailed_error": "",
  "request_id": "pfnd5qg47jyb5ghk7aonip7tre",
  "status_code": 400
}

As you can see, the detailed_error is not very… detailed 😅

Edit: I might also mention that I tried to setup a new account and the same error occurs.

Here is my configuration:

{
  "WelcomeMessages": [
    {
      "TeamName": "myteam",
      "DelayInSeconds": 3,
      "Message": [
        "### Welcome {{.UserDisplayName}} to {{.Team.DisplayName}} team!",
        "",
        "If you have any questions about your account, or Mattermost in general, do not hesitate to ask on ~town-square :slightly_smiling_face:."
      ],
      "AttachmentMessage": [
        "Let’s get started by adding you to key channels! What’s your role in the company?",
        "",
        "Please note that you can always add or leave any channel of your team :wink:"
      ],
      "Actions": [
        {
          "ActionType": "button",
          "ActionDisplayName": "Java Developer",
          "ActionName": "java-developer-action",
          "ActionSuccessfulMessage": [
            "### Awesome! I’ve added you to the following developer channels:",
            "~bugs - To help investigate or report bugs",
            "~help---dev - To ask for help regarding general development issues",
            "~help---java - To ask for help regarding Java related development issues"
          ],
          "ChannelsAddedTo": [
            "bugs",
            "help---dev",
            "help---java"
          ]
        },
        {
          "ActionType": "button",
          "ActionDisplayName": "JavaScript Developer",
          "ActionName": "javascript-developer-action",
          "ActionSuccessfulMessage": [
            "### Awesome! I’ve added you to the following developer channels:",
            "~bugs - To help investigate or report bugs",
            "~help---dev - To ask for help regarding general development issues",
            "~help---js - To ask for help regarding JavaScript related development issues"
          ],
          "ChannelsAddedTo": [
            "bugs",
            "help---dev",
            "help---js"
          ]
        },
        {
          "ActionType": "button",
          "ActionDisplayName": "DevOps",
          "ActionName": "devops-action",
          "ActionSuccessfulMessage": [
            "### Awesome! I’ve added you to the following devops channels:",
            "~bugs - To help investigate or report bugs",
            "~help---devops - To ask for help regarding general devops issues",
            "~help---cloud - To ask for help regarding Cloud Providers related issues",
            "~help---kube - To ask for help regarding Kubernetes related issues"
          ],
          "ChannelsAddedTo": [
            "bugs",
            "help---devops",
            "help---cloud",
            "help---kube"
          ]
        }
      ]
    }
  ]
}

If anyone would be kind enough to point me in the right direction, it would be very much appreciated 🙂

When a user joins a channel, present them with a Welcome message

When a user joins a channel, it would be great if the channel admin could set a "Welcome Message" for new members to the channel.

it woud be cool if there was a /welcome set_channel_welcome "Hi Welcome to this channel, be nice"

The settings could also live in the channel menu bar when we add that to the plugin API.

Internal Server Error when using /welcomebot

We have enabled Welcomebot but whenever we run the /welcomebot commands we get an "internal server error" message. The welcomebot does work when a member joins a team but none of the slash commands for welcomebot work.

We are using the HA E20 version of MM.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.