Files
mattermost/plugin/helpers.go
Christopher Speller 6d336e0666 Adding EnsureBot plugin helper. (#10542)
* Adding EnsureBot plugin helper.

* Removing unessisary GetBot call.

* Moving to own file and error handling cleanup.

* Removing patch functionaliy. Plugins should manage their own bot account updates for now.

* Adding tests and cleaning up errors.

* Modify to not shadow err.

* Moving helpers to seperate interface.

* Feedback fixes
2019-05-06 12:44:38 -07:00

18 lines
462 B
Go

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package plugin
import "github.com/mattermost/mattermost-server/model"
type Helpers interface {
// EnsureBot ether returns an existing bot user or creates a bot user with
// the specifications of the passed bot.
// Returns the id of the bot created or existing.
EnsureBot(bot *model.Bot) (string, error)
}
type HelpersImpl struct {
API API
}