微信群发工具-含源代码分享

本工具可实现定制消息内容,向微信通讯录中的好友群发消息,过年过节用它群发祝福微信消息非常方便。

群发信息excel文件

可将群发信息提前编辑到Excel中,确保程序与excel表处于同一目录,运行程序即可实现群发。

使用说明:

1.运行grpmsg.exe之前需做好如下准备工作:

1)确保groupmsg.xlsx和grpmsg.exe程序文件在同一文件夹内;

2)编辑groupmsg.xlsx文件,录入需群发人员及祝福语等信息。

信息字段说明:

朋友昵称:微信通讯录中存储的好友昵称,必填项,不可为空;

称呼:对群发对象的尊称或爱称,可为空;

消息:要发送的祝福语;

签名:可留下自己的名字或者签名档,可选项可为空;

2.运行程序前保持电脑中微信处于已登录状态;

3.运行工具群发消息

在命令行中输入grpmsg.exe或者直接在windows窗口中双击运行grpmgs.exe群发工具,等待程序逐条发送信息,即可完成微信群发。

注意:本工具用python语言开发,程序运行如果出现错误提示,请检查运行环境,python3.9版本。

工具下载:https://download.csdn.net/download/urhero/87403958

代码分享

#!/usr/bin/env python
# coding=utf-8
# Copyright(C)2018-2020 BowenCentury
# All right reserved. 
# 文件名称:wxgrpsend.py
# 摘    要:微信群发工具V0.0.1
# 作者:fantastico
# 邮箱:fantastico@126.com
# 创建日期:2023-01-16 09:58:02
# 修改记录:
##
import pyautogui as pauto
import pyperclip
import time
from pyexcel.pyexcel import *
# 向好友窗口发送信息
def messagesend(strfriendname, strmessage):
    openchat(strfriendname)
    pyperclip.copy(strmessage)  
    time.sleep(0.5)  # 延迟0.5秒
    pauto.hotkey('ctrl', 'v')  # 发送消息
    time.sleep(0.5)  # 延迟0.5秒
    pauto.hotkey('alt', 's')  # 发送消息
    openchat(strfriendname)
# 从Excel文件中读取群发信息列表:好友昵称(用来查找定位好友)
# 称呼(如:XX总,可为空)、祝福语、落款签名
def readinfo(strfile, strsheet):
    mxls = pyexcel(strfile)
    lstdata = mxls.read(strsheet)
    return lstdata
# 切换到朋友聊天窗口
def openchat(strfriendname):
    pauto.hotkey('ctrl', 'alt', 'w')    # Ctrl + alt + w 打开微信
    time.sleep(0.5)  # 延迟0.5秒
    pauto.hotkey('ctrl', 'f')           # 搜索好友
    pyperclip.copy(strfriendname)  
    pauto.hotkey('ctrl', 'v')           # 粘贴定位好友
    time.sleep(0.5)
    pauto.press('enter')                # 进入好友消息界面
    
# 按从excel文件中读取的朋友列表和消息清单,向朋友发送消息
def sendmsglst(lstdata):
    i = 0
    for row in lstdata:
        if(i == 0):
            i+=1;
            continue
        if(row[1] == None):
            row[1] = ''
        messagesend(row[0], row[1]+row[2]+'\n'+row[3])
        time.sleep(0.3)
def wxgrpsend(strfilename):
    lstinfo = readinfo(strfilename, 'Messages')
    sendmsglst(lstinfo)
# 主程序
if __name__ == '__main__':
    strfilename = 'groupmsg.xlsx'
    wxgrpsend(strfilename)

免责声明:

1.本工具为个人兴趣开发,免费分享给大家使用,本程序采用pyinstaller打包生成.exe可执行文件,在某些电脑360可能会提示安全警告,本人承诺本人所写代码安全,与本作者无关,但无法保证引用的pyautogui及pyperclip开源模块的软件安全。

2.声明以上文章中公开的源代码,任何程序员可以使用并按自己需求更改发布,不受代码中版权约束。

3.如因使用本工具产生的一切不良后果,本工具作者不承担任何责任。

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
心中带点小风骚的头像心中带点小风骚普通用户
上一篇 2023年11月6日
下一篇 2023年11月6日

相关推荐