add test
This commit is contained in:
@@ -37,8 +37,11 @@ func (bot *botAll) Process(ctx context.Context, msg messenger.Message) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
usernames := lo.Map(users, func(item storage.User, _ int) string {
|
||||
return item.UserID
|
||||
usernames := lo.FilterMap(users, func(item storage.User, _ int) (string, bool) {
|
||||
if item.UserID == msg.UserID {
|
||||
return "", false
|
||||
}
|
||||
return item.UserID, true
|
||||
})
|
||||
if len(usernames) > 0 {
|
||||
bot.messenger.SendMessage(
|
||||
|
||||
Reference in New Issue
Block a user