File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 66from chatterbot .trainers import ChatterBotCorpusTrainer
77from PyMatcha import redis
88from PyMatcha .models .like import Like
9+ from PyMatcha .models .match import Match
910from PyMatcha .models .message import Message
1011from PyMatcha .models .user import User
1112from PyMatcha .models .view import View
@@ -56,7 +57,12 @@ def botaction_like(bot_user: User):
5657 user_to_like = choice (recommendations )
5758 except IndexError :
5859 return
59- Like .create (liker_id = bot_user .id , liked_id = user_to_like ["id" ])
60+ user_to_like = User .get (id = user_to_like ["id" ])
61+ View .create (profile_id = user_to_like .id , viewer_id = bot_user .id )
62+ Like .create (liker_id = bot_user .id , liked_id = user_to_like .id )
63+
64+ if user_to_like .already_likes (bot_user .id ):
65+ Match .create (user_1 = bot_user .id , user_2 = user_to_like .id )
6066
6167
6268def botaction_unlike (bot_user : User ):
You can’t perform that action at this time.
0 commit comments