### Install pyautokakao Source: https://github.com/ddadea/pyautokakao/blob/main/README.md Install the pyautokakao library using pip. ```bash pip install pyautokakao ``` -------------------------------- ### Basic pyautokakao Usage Source: https://github.com/ddadea/pyautokakao/blob/main/README.md Demonstrates core functionalities of pyautokakao including reading and sending messages, adding friends, inviting friends to rooms, and creating new chat rooms. Ensure KakaoTalk is running and chat room names match exactly. ```python import pyautokakao # Read Chat log = pyautokakao.read("Chat room name") print(log) # Send Chat pyautokakao.send("Chat room name", "message") # Add to friends pyautokakao.add_friend("friend name(you determine)", "phone number") # Invite friend to existing room pyautokakao.invite("Chat room name", ["friend name 1","friend name 2",]) # Make new chat room pyautokakao.make_room("Chat room name", ["friend name 1","friend name 2",]) ``` -------------------------------- ### Inspect and Modify Configuration Source: https://context7.com/ddadea/pyautokakao/llms.txt The internal config dictionary controls timing and UI button offsets. Modify these values if default delays or click positions do not match your environment. Subsequent calls to invite() and make_room() will use the new values. ```python import pyautokakao.util as kakao_util # Inspect current config print(kakao_util.config) # { # 'long_delay': 1, # seconds to wait for slow UI operations # 'short_delay': 0.5, # seconds for fast UI operations # 'invite_button_position': (333, 60), # pixel offset for the friend-select checkbox # 'make_button_position': (220, 560), # pixel offset for the "Create room" button # } # Increase delays on a slower machine kakao_util.config["long_delay"] = 2 kakao_util.config["short_delay"] = 1 # Adjust click positions if invite/make_room clicks land on wrong elements kakao_util.config["invite_button_position"] = (340, 65) kakao_util.config["make_button_position"] = (225, 570) # Now subsequent calls to invite() and make_room() use the new values pyautokakao.invite("Team Chat", ["Alice"]) ``` -------------------------------- ### Create a Group Room with Friends Source: https://context7.com/ddadea/pyautokakao/llms.txt Use this function to create a new group chat with a specified name and a list of friends. ```python pyautokakao.make_room( chat_name="Sprint Planning", friend_name=["Alice", "Bob", "Charlie"] ) ``` -------------------------------- ### make_room Source: https://context7.com/ddadea/pyautokakao/llms.txt Creates a new group chat room with specified friends and a name. ```APIDOC ## make_room ### Description Creates a new group chat room. Opens the new chat dialog, selects specified friends, sets the chat room name, and confirms creation. ### Method `make_room(chat_name: str, friend_name: str | list[str])` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python import pyautokakao # Create a room with a single friend (string shorthand) pyautokakao.make_room( chat_name="One-on-One with Alice", friend_name="Alice" ) ``` ### Response #### Success Response (200) None (operation is performed) #### Response Example None ``` -------------------------------- ### Create a new group chat room Source: https://context7.com/ddadea/pyautokakao/llms.txt Creates a new group chat room with specified friends. The `friend_name` can be a single string or a list of strings. The chat room is then named using `chat_name`. This function automates the process of opening the new chat dialog, selecting friends, and finalizing the room creation. ```python import pyautokakao # Create a room with a single friend (string shorthand) pyautokakao.make_room( chat_name="One-on-One with Alice", friend_name="Alice" # string is automatically wrapped in a list ) ``` -------------------------------- ### invite Source: https://context7.com/ddadea/pyautokakao/llms.txt Invites one or more friends to an existing chat room. ```APIDOC ## invite ### Description Invites friends to an existing chat room. Opens the room, triggers the invite dialog, searches for each friend name, selects them, and confirms the invitation. ### Method `invite(destination: str, friend_name: list[str], close_after: bool = True)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python import pyautokakao # Invite one friend to an existing room pyautokakao.invite( destination="Project Alpha", friend_name=["Alice"] ) # Invite multiple friends at once result = pyautokakao.invite( destination="Project Alpha", friend_name=["Alice", "Bob", "Charlie"], close_after=True ) print(result) ``` ### Response #### Success Response (200) - **result** (bool) - True on success. #### Response Example ```json { "example": "True" } ``` ``` -------------------------------- ### Invite friends to an existing chat room Source: https://context7.com/ddadea/pyautokakao/llms.txt Invites specified friends to an existing group chat room. The `destination` must exactly match the room name. Friends are searched by name and selected from the results. The chat window can be closed after the invitation process by setting `close_after=True`. ```python import pyautokakao # Invite one friend to an existing room pyautokakao.invite( destination="Project Alpha", # must match the room name exactly friend_name=["Alice"] ) ``` ```python # Invite multiple friends at once result = pyautokakao.invite( destination="Project Alpha", friend_name=["Alice", "Bob", "Charlie"], close_after=True # close the room window after inviting (default True) ) print(result) # True on success ``` -------------------------------- ### read Source: https://context7.com/ddadea/pyautokakao/llms.txt Reads the full chat history from a specified chat room. It can use the clipboard for faster retrieval or save the log to a file. ```APIDOC ## read ### Description Retrieves the full chat history from the named chat room. By default it uses the clipboard (fast): it opens the room, selects all messages with Ctrl+A, copies them with Ctrl+C, and returns the clipboard text. Alternatively, it can trigger KakaoTalk's built-in log-save dialog (Ctrl+S) and read the saved file from disk. ### Method `read(destination: str, close_after: bool = True, use_clipboard: bool = True, saving_path: str = None)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python import pyautokakao # --- Fast method: clipboard (default) --- chat_log = pyautokakao.read("Team Chat") print(chat_log) # --- Slow method: file save (use_clipboard=False) --- import os os.makedirs("data", exist_ok=True) chat_log = pyautokakao.read( destination="Team Chat", close_after=True, use_clipboard=False, saving_path="data" ) print(chat_log[:500]) ``` ### Response #### Success Response (200) - **chat_log** (str) - The full chat history as a plain string. ``` -------------------------------- ### Read chat log from a chat room Source: https://context7.com/ddadea/pyautokakao/llms.txt Retrieves chat history from a specified room. The default method uses the clipboard for speed. Alternatively, it can use KakaoTalk's save-to-file feature, which is slower but may be more reliable for very large logs. Ensure the 'data' directory exists if using the file save method. ```python import pyautokakao # --- Fast method: clipboard (default) --- # KakaoTalk must be running before calling any function. chat_log = pyautokakao.read("Team Chat") print(chat_log) # Output: full chat history as a plain string ``` ```python # --- Slow method: file save (use_clipboard=False) --- # Saves the log to the 'data' directory (must exist beforehand). import os os.makedirs("data", exist_ok=True) chat_log = pyautokakao.read( destination="Team Chat", close_after=True, # close the chat window after reading (default True) use_clipboard=False, # use KakaoTalk's save-to-file feature instead saving_path="data" # directory where KakaoTalk saves the .txt log file ) print(chat_log[:500]) # print first 500 characters of the log ``` -------------------------------- ### send Source: https://context7.com/ddadea/pyautokakao/llms.txt Sends a text message to a specified chat room. The function can optionally keep the chat window open after sending. ```APIDOC ## send ### Description Sends a message to a specified chat room. Opens the chat room by name, sets the message text in the input control, and simulates pressing Enter to send it. ### Method `send(destination: str, message: str, close_after: bool = True)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python import pyautokakao # Send a simple text message pyautokakao.send("Team Chat", "Hello, everyone!") # Send a message but keep the chat window open afterward pyautokakao.send( destination="Team Chat", message="Deployment complete ✅", close_after=False ) # Send multiple messages in sequence to the same room messages = ["Step 1 done", "Step 2 done", "All steps complete"] for msg in messages: pyautokakao.send("CI/CD Notifications", msg) ``` ### Response #### Success Response (200) None (operation is performed) #### Response Example None ``` -------------------------------- ### Send a message to a chat room Source: https://context7.com/ddadea/pyautokakao/llms.txt Sends a message to a specified chat room. By default, the chat window is closed after sending. Set `close_after=False` to keep the window open. This function is suitable for sending single messages or iterating through a list of messages. ```python import pyautokakao # Send a simple text message pyautokakao.send("Team Chat", "Hello, everyone!") ``` ```python # Send a message but keep the chat window open afterward pyautokakao.send( destination="Team Chat", message="Deployment complete ✅", close_after=False # default is True ) ``` ```python # Send multiple messages in sequence to the same room messages = ["Step 1 done", "Step 2 done", "All steps complete"] for msg in messages: pyautokakao.send("CI/CD Notifications", msg) ``` -------------------------------- ### add_friend Source: https://context7.com/ddadea/pyautokakao/llms.txt Adds a new contact to KakaoTalk by providing their display name and phone number. ```APIDOC ## add_friend ### Description Adds a contact by phone number. Opens the 'Add Friend' dialog, fills in the provided name and phone number, and confirms the dialog. ### Method `add_friend(friend_name: str, phone_number: str)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python import pyautokakao # Add a single friend by phone number pyautokakao.add_friend( friend_name="Alice", phone_number="010-1234-5678" ) # Add multiple contacts from a list contacts = [ ("Bob", "010-9876-5432"), ("Charlie", "010-5555-0000"), ] for name, number in contacts: pyautokakao.add_friend(name, number) ``` ### Response #### Success Response (200) None (operation is performed) #### Response Example None ``` -------------------------------- ### Add a contact by phone number Source: https://context7.com/ddadea/pyautokakao/llms.txt Adds a new contact to KakaoTalk using their phone number. The `friend_name` is a local display name, while the `phone_number` must be linked to an active KakaoTalk account. This function can add single contacts or iterate through a list of contacts. ```python import pyautokakao # Add a single friend by phone number pyautokakao.add_friend( friend_name="Alice", # arbitrary display name you choose phone_number="010-1234-5678" # phone number registered on KakaoTalk ) ``` ```python # Add multiple contacts from a list contacts = [ ("Bob", "010-9876-5432"), ("Charlie", "010-5555-0000"), ] for name, number in contacts: pyautokakao.add_friend(name, number) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.