// OnActivate sets the bot user up
OnActivate sets the bot user up
// OnActivate sets the bot user up
func (p *RollbarPlugin) OnActivate() error {
	botUserID, err := p.Helpers.EnsureBot(&model.Bot{
		Username:    botUserName,
		DisplayName: botDisplayName,
		Description: botDescription,
	})
	if err != nil {
		return errors.Wrap(err, "failed to ensure bot account")
	}
	p.botUserID = botUserID
	bundlePath, err := p.API.GetBundlePath()
	if err != nil {
		return errors.Wrap(err, "couldn't get bundle path")
	}
	profileImage, err := ioutil.ReadFile(filepath.Join(bundlePath, "assets", "profile.png"))
	if err != nil {
		return errors.Wrap(err, "couldn't read profile image")
	}
	if appErr := p.API.SetProfileImage(botUserID, profileImage); appErr != nil {
		return errors.Wrap(appErr, "couldn't set profile image")
	}
	return nil
}
func ( p * RollbarPlugin ) OnActivate ( ) error { botUserID , err := p . Helpers . EnsureBot ( & model . Bot { Username : botUserName , DisplayName : botDisplayName , Description : botDescription , } ) if err != nil { return errors . Wrap ( err , " " ) } p . botUserID = botUserID bundlePath , err := p . API . GetBundlePath ( ) if err != nil { return errors . Wrap ( err , " " ) } profileImage , err := ioutil . ReadFile ( filepath . Join ( bundlePath , " " , " " ) ) if err != nil { return errors . Wrap ( err , " " ) } if appErr := p . API . SetProfileImage ( botUserID , profileImage ) ; appErr != nil { return errors . Wrap ( appErr , " " ) } return nil }
OnActivate sets the bot user up
OnActivate sets the bot user up