This commit is contained in:
2023-08-13 20:39:36 +07:00
parent 2889f35a3d
commit 1e3f5eb91d
2 changed files with 97 additions and 2 deletions
+5 -2
View File
@@ -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(