As you all know skype doesn’t have any auto-reply feature when you are offline Many organizations use it for customer support and they need that feature when offline. So in this tutorial, I will show you that how you can make a simple skype auto-reply software in Python.
A client asks me to find something for a skype auto-responder I searched on google and found Pamela for skype (Pamela for skype was used to record calls, chat, video calls, and many more features.) but it discontinued in mid of 2017.
So I have decided to make an autoresponder as I make for WhatsApp Chatbot in Python use the same pattern and make a skype auto-reply bot in python.
Source Code
Download Windows software
Here is the video demo:
Coding:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
import time
driverPath = "chrome/chromedriver"
driver = webdriver.Chrome(executable_path=driverPath)
driver.get('https://web.skype.com')
print('Please login and press enter.......')
input()
with open('message.txt') as f:
message = f.read()
f.close()
def send_message(msg):
whatsapp_msg = driver.find_element_by_xpath('//div[@aria-label="Type a message"]')
for part in msg.split('\n'):
whatsapp_msg.send_keys(part)
ActionChains(driver).key_down(Keys.SHIFT).key_down(Keys.ENTER).key_up(Keys.SHIFT).key_up(Keys.ENTER).perform()
ActionChains(driver).send_keys(Keys.RETURN).perform()
def unreadMessageProcess():
try:
unread_chat = driver.find_element_by_xpath('//div[contains(@id, "rx-vlv")]/div/div/div/div[3]/div[2]/div')
unread_chat = unread_chat.find_element_by_xpath('./..')
unread_chat.click()
time.sleep(1)
send_message(message)
except Exception:
return False
while True:
print("checking new unread message....")
unreadMessageProcess()
time.sleep(10)
The above code uses Selenium (automate browsers) with Google chrome webdriver.
It will open your skype on the web and check if there is any unread message it will open that message and get your custom message from the message.txt file and send that message to that person.
Leave a Reply