func (p *Plugin) ServeHTTP(c *plugin.Context, w http.ResponseWriter, r *http.Request) {
	p.handleHTTPRequest(w, r)
}
ServeHTTP serve the post actions for the shuffle command
package main
import (
	"fmt"
	"net/http"
	"strings"
	"sync"
	pluginConf "github.com/moussetc/mattermost-plugin-giphy/server/internal/configuration"
	pluginError "github.com/moussetc/mattermost-plugin-giphy/server/internal/error"
	provider "github.com/moussetc/mattermost-plugin-giphy/server/internal/provider"
	"github.com/mattermost/mattermost-server/v5/model"
	"github.com/mattermost/mattermost-server/v5/plugin"
	"github.com/pkg/errors"
)
const (
	contextKeywords = "keywords"
	contextCaption  = "caption"
	contextGifURL   = "gifURL"
	contextCursor   = "cursor"
	contextRootId   = "rootId"
)
type Plugin struct {
	plugin.MattermostPlugin
	configurationLock sync.RWMutex
	configuration     *pluginConf.Configuration
	errorGenerator pluginError.PluginError
	gifProvider    provider.GifProvider
	httpHandler    pluginHTTPHandler
	botId          string
	rootURL        string
}
func (p *Plugin) OnActivate() error {
	p.rootURL = fmt.Sprintf("/plugins/%s", manifest.Id)
	if err := p.OnConfigurationChange(); err != nil {
		return errors.Wrap(err, "Could not load plugin configuration")
	}
	p.httpHandler = &defaultHTTPHandler{}
	return p.RegisterCommands()
}
func (p *Plugin) ExecuteCommand(c *plugin.Context, args *model.CommandArgs) (*model.CommandResponse, *model.AppError) {
	config := p.getConfiguration()
	if strings.HasPrefix(args.Command, "/"+config.CommandTriggerGifWithPreview) {
		keywords, caption, parseErr := parseCommandLine(args.Command, config.CommandTriggerGifWithPreview)
		if parseErr != nil {
			return nil, p.errorGenerator.FromMessage(parseErr.Error())
		}
		return p.executeCommandGifWithPreview(keywords, caption, args)
	}
	if strings.HasPrefix(args.Command, "/"+config.CommandTriggerGif) {
		keywords, caption, parseErr := parseCommandLine(args.Command, config.CommandTriggerGif)
		if parseErr != nil {
			return nil, p.errorGenerator.FromMessage(parseErr.Error())
		}
		return p.executeCommandGif(keywords, caption)
	}
	return nil, p.errorGenerator.FromMessage("Command trigger " + args.Command + "is not supported by this plugin.")
}