how to send auto message on skype using python on one click

 Guys, as requested by my subscribers, I tried to share some basic Python code for sending a Skype auto-message with a single click. Before running the Python script, you have to install Python and some basic libraries. Hope you know the basics of Python programming. 

Apart from this, we are introducing the step that how you Convert the same Python Script to .exe File and share the same with your SALE person so that He/She can easily send the bulk message to the clients instead of one to one.

Step 1.

Install the python 

Step 2.

# # Install the required libraries using CMD or window power shell 
       pip install skpy
       pip install -U -q pandas

Step 3.

Execute the below Python code.

#!/usr/bin/env python

# coding: utf-8


import pandas as pd

import getpass

import tkinter as tk

from skpy import Skype, SkypeChats


# Create a tkinter GUI window

window = tk.Tk()

window.title("Skype Message Sender")

window.geometry("400x400")


# Define a function to send the message

def send_message(): 

  excel_path = excel_file_path.get()


    # Read Excel file using pandas

  df = pd.read_excel(excel_path, sheet_name="Grid")    

    

  # Load the data from the Excel file into a pandas DataFrame

  # Filter the sheet and extract all the skype id's where we want to send the message

  my_list = df.loc[df['Send Message'] == "Yes", 'Chat ID'].tolist()

  message = message_box.get("1.0", "end-1c")

  userid = skype_id_box.get()

  password = password_box.get()


  # Skype Login

  slogin = Skype(userid, password)


  # Send message to Skype individual chat

  for i in my_list:

    contact = slogin.chats[i]

    contact.sendMsg(message)    

  status_text.set("Message sent successfully!")


# # Add GUI elements to the window

excel_file_label = tk.Label(text="Excel file path:")

excel_file_label.pack()

excel_file_path = tk.Entry(width=30)

excel_file_path.pack()

skype_id_label = tk.Label(text="Skype ID:")

skype_id_label.pack()

skype_id_box = tk.Entry(width=30)

skype_id_box.pack()

password_label = tk.Label(text="Password:")

password_label.pack()

password_box = tk.Entry(width=30, show="*")

password_box.pack()

message_label = tk.Label(text="Message:")

message_label.pack()

message_box = tk.Text(height=10, width=30)

message_box.pack()

send_button = tk.Button(text="Send message", command=send_message)

send_button.pack()

status_text = tk.StringVar()

status_label = tk.Label(textvariable=status_text)

status_label.pack()

# Start the GUI event loop

window.mainloop()


Above code is based on GUI and its contains the following inputs
  1. Excel file path
  2. Skype ID
  3. Skype Password
  4.  Message
Fig.1 




 




















Step 4.

Its very important step where we have collected Chat Id, Contact name, Send message and Chat type
in Microsoft Excel . 

Fig 2. 





Since Sale Guys are typically non-technical, creating an.exe file and sharing it with them is a great way to implement the Skype send the bulk message to the clients. So we to understand the how we can achieve the same .

Step 1.

Install the library pyinstaller and type below command in the command prompt

pip install pyinstaller

Step 2.
Go into the directory where your ‘.py’ file is located 

Step 3.

till .py path should be in the command prompt

E.g  

PS D:\skype> pyinstaller --onefile -w Skype.py 


Run the above command and you can see the file hierarchy as below , after if you go to the dist directory. You will see that an .exe file will be generated accordingly.

PS D:\skype> tree /F
Folder PATH listing for volume New Volume
Volume serial number is 8413-049D
D:.
│   Skype.py
│   Skype.spec
│   skype_id_map.xlsx
├───build
│   └───Skype
│       │   Analysis-00.toc
│       │   base_library.zip
│       │   EXE-00.toc
│       │   PKG-00.toc
│       │   PYZ-00.pyz
│       │   PYZ-00.toc
│       │   Skype.exe.manifest
│       │   Skype.pkg
│       │   Tree-00.toc
│       │   Tree-01.toc
│       │   Tree-02.toc
│       │   warn-Skype.txt
│       │   xref-Skype.html
│       │
│       └───localpycs
│               pyimod01_archive.pyc
│               pyimod02_importers.pyc
│               pyimod03_ctypes.pyc
│               pyimod04_pywin32.pyc
│               struct.pyc
└───dist
        Skype.exe

happy learning !!!






 





Comments