MM-31063: Change constants to use CamelCase (#16608)
* MM-31063: Change constants to use CamelCase * store package * change allcaps to camel case (#16615) * New tools.mod Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
8b6ac5f5d2
Коммит
c1dd23a3c8
@@ -133,7 +133,7 @@ func (p *HelpersImpl) ShouldProcessMessage(post *model.Post, options ...ShouldPr
|
||||
option(messageProcessOptions)
|
||||
}
|
||||
|
||||
botIDBytes, kvGetErr := p.API.KVGet(BOT_USER_KEY)
|
||||
botIDBytes, kvGetErr := p.API.KVGet(BotUserKey)
|
||||
if kvGetErr != nil {
|
||||
return false, errors.Wrap(kvGetErr, "failed to get bot")
|
||||
}
|
||||
@@ -212,7 +212,7 @@ func (p *HelpersImpl) ensureBot(bot *model.Bot) (retBotID string, retErr error)
|
||||
var botIDBytes []byte
|
||||
|
||||
err = utils.ProgressiveRetry(func() error {
|
||||
botIDBytes, err = p.API.KVGet(BOT_USER_KEY)
|
||||
botIDBytes, err = p.API.KVGet(BotUserKey)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -226,7 +226,7 @@ func (p *HelpersImpl) ensureBot(bot *model.Bot) (retBotID string, retErr error)
|
||||
}
|
||||
}()
|
||||
|
||||
botIDBytes, kvGetErr := p.API.KVGet(BOT_USER_KEY)
|
||||
botIDBytes, kvGetErr := p.API.KVGet(BotUserKey)
|
||||
if kvGetErr != nil {
|
||||
return "", errors.Wrap(kvGetErr, "failed to get bot")
|
||||
}
|
||||
@@ -252,7 +252,7 @@ func (p *HelpersImpl) ensureBot(bot *model.Bot) (retBotID string, retErr error)
|
||||
// Check for an existing bot user with that username. If one exists, then use that.
|
||||
if user, userGetErr := p.API.GetUserByUsername(bot.Username); userGetErr == nil && user != nil {
|
||||
if user.IsBot {
|
||||
if kvSetErr := p.API.KVSet(BOT_USER_KEY, []byte(user.Id)); kvSetErr != nil {
|
||||
if kvSetErr := p.API.KVSet(BotUserKey, []byte(user.Id)); kvSetErr != nil {
|
||||
p.API.LogWarn("Failed to set claimed bot user id.", "userid", user.Id, "err", kvSetErr)
|
||||
}
|
||||
} else {
|
||||
@@ -267,7 +267,7 @@ func (p *HelpersImpl) ensureBot(bot *model.Bot) (retBotID string, retErr error)
|
||||
return "", errors.Wrap(createBotErr, "failed to create bot")
|
||||
}
|
||||
|
||||
if kvSetErr := p.API.KVSet(BOT_USER_KEY, []byte(createdBot.UserId)); kvSetErr != nil {
|
||||
if kvSetErr := p.API.KVSet(BotUserKey, []byte(createdBot.UserId)); kvSetErr != nil {
|
||||
p.API.LogWarn("Failed to set created bot user id.", "userid", createdBot.UserId, "err", kvSetErr)
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user