Welcome to the magical world of WhatsApp Web automation using the Demon
class! Embrace the power of the digital realm. 😎
Unleash the demon within to navigate the WhatsApp Web universe and experience the following enchanting features! 🌟
-
🌟 Purpose: Create an instance of the
Demon
class and choose your portal to the browser's kingdom. -
browser
(str): The browser of your choice (e.g., 'chrome', 'firefox'). -
browser_path
(str): The secret path to the browser's lair (user data directory). -
driver_path
(str): The enchanted path to the browser's driver executable.
Usage Example:
whatsapp_demon = Demon(browser='chrome', browser_path='path/to/browser', driver_path='path/to/driver')
-
🪄 Purpose: Summon the Selenium driver tailored to your browser and let the magic unfold.
-
Returns: A Selenium WebDriver instance ready to serve your digital incantations. 🧙
Usage Example:
whatsapp_demon.load_driver() # Prepare the gateway to WhatsApp Web! 🪄
- 🔑 Purpose: Initiate your grand WhatsApp Web adventure. Enter the realm of chats and connections. 👑
Usage Example:
whatsapp_demon.login() # Begin your epic quest! 🛡️
-
💬 Purpose: Send text messages to your allies and friends, for words have the power to unite! 📜
-
contact_name
(str): The name of your contact or group. -
message
(str): The message to transmit. ✉️
Usage Example:
whatsapp_demon.send_message("Fellow Adventurers", "Brace yourselves, a new quest awaits! 🌄")
-
📸 Purpose: Share images with your comrades. Paint your digital canvases with memories! 🖼️🌌
-
contact_name
(str): The name of your contact or group. -
picture
(Path): The path to your image. -
message
(Optional[str]): A secret message accompanying your masterpiece. 🤫
Usage Example:
whatsapp_demon.send_image("Fellow Explorers", "path/to/your/image.jpg", "A glimpse of our adventure! 📸")
-
🎥 Purpose: Share videos to capture and relive moments with your companions. Videos are the moving art of the modern era! 🎬📖
-
contact_name
(str): The name of your contact or group. -
video
(Path): The path to your video masterpiece. -
message
(Optional[str]): An enchanting message to accompany your video. 🎉
Usage Example:
whatsapp_demon.send_video("Adventurers Guild", "path/to/your/video.mp4", "Our adventures await! 🌟")
-
🔥 Purpose: Erase unwanted messages from group chats, leaving no trace behind. Time to cleanse your story! 🗑️
-
group_name
(str): The name of the group. -
message
(str): The text of the message to be vanquished. 💥
Usage Example:
whatsapp_demon.delete_message("Secret Society", "This message is better left unsaid.")
-
🏷️ Purpose: Summon all members of a group chat to heed your call, like a charismatic anime character rallying their comrades. Unite for a common cause! ⚔️🛡️
-
group_name
(str): The name of the group. 📣
Usage Example:
whatsapp_demon.tag_all("Guild Members") # Gather, brave souls! 🚀
-
📜 Purpose: Uncover the history of your chat adventures, retrieving a list of messages from your chat kingdom. Time travel in your chat box! ⏳📚
-
Returns: A list of message objects with details like sender, timestamp, and content. 🧙♂️
Usage Example:
messages = whatsapp_demon.get_list_of_messages()
for message in messages:
print(f"Sender: {message.sender}, Timestamp: {message.timestamp}, Content: {message.content}")
-
📂 Purpose: Dispatch magical files (documents) to your chosen contacts or groups. Share knowledge and wisdom! 📚✨
-
contact_name
(str): The name of your contact or group. -
filename
(Path): The path to your sacred document. -
message
(Optional[str]): A secret message to accompany your file. 🕵️
Usage Example:
whatsapp_demon.send_file("Scroll Keepers", "path/to/ancient-scroll.pdf", "The wisdom of the ancients. 📜")
-
🔍 Purpose: Embark on a quest to discover unread chat messages, unearthing hidden treasures. A digital adventure awaits! 🏴☠️
-
limit
(bool): Set toTrue
to limit the number of chat messages fetched. -
top
(int): Number of chat messages to retrieve iflimit
is set to `True. 🔎
Usage Example:
unread_chats = whatsapp_demon.fetch_all_unread_chats(top=10) # The uncharted chats reveal their secrets! 🌟
- 🚪 Purpose: When your adventure reaches its conclusion, close the WhatsApp Web realm gracefully. Until the next epic quest! 👋🌄
Usage Example:
whatsapp_demon.logout() # Farewell, brave adventurer! Your journey continues elsewhere. 🏰
- 👋 Purpose: Close the magical gateway, freeing your browser from the spells and releasing the captive resources. Break the spell of the digital world! 👋
Usage Example:
whatsapp_demon.close() # Farewell, until we meet again! 👋
Experience the magic and explore the world of WhatsApp Web with Demon
. Your digital adventure awaits! 🌐🌟