4/1/2023 0 Comments Chat for tinder![]() ![]() ![]() create( body = "After talking with \'you\' for a bit, " name " " message "\n \n if you might want to hangout, check out the interaction on tinder! \n \n if not, please reply with the ID of the person. Here we can connect it to our Tinder Bot: def twilioMsg(name, pic, message, id): message = ssages \. create( body="Text Message", from_='SETUP ON TWILIO', to='YOUR OWN PHONE NUMBER' ) print(message.sid) Here’s a test script that will send us a text message: from twilio.rest import Client # Your Account Sid and Auth Token from /console account_sid = '' auth_token = '' client = Client(account_sid, auth_token) message = ssages \. To do this, we’re going to be using Twilio, an API for dealing with SMS. Again, the idea is that if the person asks to hangout after talking for a while, we’ll get a text message with their profile and be able to setup a date with them or decline the request. This happened because our chatbot doesn’t know what he’s talking about, and I set the default response to laugh.Īll we need to do now is add more Intents and let our chatbot talk to more people, as it‘ll automatically grow smarter with each conversation it has.Īs we let that run, we’re going to implement the “last” part, which is integrating SMS. This outputs the most recent messages that people have sent to Jenny: To do this, we can run: from tinder_api_sms import * from features import * import pprint import datetime import string printer = pprint.PrettyPrinter(indent=4) #recs = get_recommendations() count = "50" match_dict = all_matches(count) date = str(()).replace(" ", "") #print(date) self_dict = get_self() selfId = self_dict matches = match_dict #find last message that we didnt send for each user for user in matches: userId = user if user: lastMessage = user if lastMessage != selfId: message = lastMessage printer.pprint(message) So, now we have to pull the unread messages that people have sent Jenny on Tinder. To connect the DialogFlow to our Tinder account, I wrote this script: import dialogflow import os from google.api_core.exceptions import InvalidArgument DIALOGFLOW_PROJECT_ID = '#' DIALOGFLOW_LANGUAGE_CODE = 'en-US' GOOGLE_APPLICATION_CREDENTIALS = 'C:\\UsersĪtha\\Documents\\TinderAPI\\Tinder\\#.json' credential_path = "C:\\UsersĪtha\\Documents\\TinderAPI\\Tinder\\#.json" os.environ = credential_path text_to_be_analyzed = "hyd" #this would be a message from Tinder session_client = dialogflow.SessionsClient() session = session_ssion_path(DIALOGFLOW_PROJECT_ID, SESSION_ID) text_input = (text=text_to_be_analyzed, language_code=DIALOGFLOW_LANGUAGE_CODE) query_input = (text=text_input) try: response = session_tect_intent(session=session, query_input=query_input) except InvalidArgument: raise print("Query text:", response.query_result.query_text) print("Detected intent:", response.query_name) print("Detected intent confidence:", response.query_result.intent_detection_confidence) print("Fulfillment text:", response.query_result.fulfillment_text) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |