Commit bfd9284f authored by Benjamin Pill's avatar Benjamin Pill

Add mention setting to configuration

parent d63249eb
......@@ -33,6 +33,27 @@
"type": "bool",
"help_text": "Trigger the bot for new private channels too",
"default": false
},
{
"key": "Mention",
"display_name": "Mention",
"type": "dropdown",
"help_text": "Who gets mentioned.",
"default": "@channel ",
"options": [
{
"display_name": "@channel",
"value": "@channel "
},
{
"display_name": "@here",
"value": "@here "
},
{
"display_name": "None",
"value": ""
}
]
}
]
}
......
......@@ -24,6 +24,7 @@ type configuration struct {
ChannelToPost string
BotUserName string
IncludePrivateChannels bool
Mention string
}
// Clone shallow copies the configuration. Your implementation may require a deep copy if
......
......@@ -69,7 +69,7 @@ func (p *NewChannelNotifyPlugin) ChannelHasBeenCreated(c *plugin.Context, channe
post, err := p.API.CreatePost(&model.Post{
ChannelId: mainChannel.Id,
UserId: bot.Id,
Message: fmt.Sprintf("@channel Hello there :wave:. You might want to check out the new channel ~%s created by @%s :).", newChannelName, creator.Username),
Message: fmt.Sprintf("%sHello there :wave:. You might want to check out the new channel ~%s created by @%s :).", config.Mention, newChannelName, creator.Username),
})
p.API.LogDebug(fmt.Sprintf("Created post %s", post.Id))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment