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
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
2d3fb4f426
Коммит
6d336e0666
17
plugin/helpers.go
Обычный файл
17
plugin/helpers.go
Обычный файл
@@ -0,0 +1,17 @@
|
||||
// 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
|
||||
}
|
||||
Ссылка в новой задаче
Block a user