[Python Project] Python implements WeChat to send New Year greetings and reply to blessings. Mass sending is meaningless | Source code attached

Preface

Please use it with caution, there may be a risk of account ban.
In view of the fact that the analysis cost of information such as pictures/emoticons is too high, and the accuracy cannot be guaranteed. Currently only text message processing is supported.
If you have time before using it, it is recommended to look at the code first.
Get (send) blessings from (group): auto_send_wish
Reply blessings in seconds: auto_reply_wish, the text of blessings in seconds is simplified and appears more natural.
The source of the underlying robot is itchat.

Related documents

Follow the editor and send a private message to the editor to get it!
Of course, don’t forget one triple link~~
Click for source codeBlue fontReceive

User experience

First run the group sending function, and then manually handle the follow-up processing. Not many people will reply in seconds, so you can do it in time.
After the time has passed, turn on the instant recovery function, and then you can do other things with peace of mind.
If you are a social expert and can receive many blessings even while sitting, but you are not so proactive in replying, then implement the instant reply function.
The automatic piecing together of blessings is implemented in randomWish in wish_txt.py. The addition of emoji makes the blessings more lively. The blessing text is very common. If necessary, you can replace it here.

development tools

Python version: 3.7.8
Related modules:
pygame module;
random module;
and some python built-in modules.

Environment setup

Install Python and add it to the environment variables, and pip to install the required relevant modules.

run

View current friends list

python3 list-friends.py

Send individual blessings to your friends one by one.
In order to facilitate debugging and privacy issues, it is recommended to introduce this module and then call it by passing parameters. The example is as follows:

源码+课件+学习解答加群:494958217
import auto_send_wish

def main():
    auto_send_wish.sendWish(send=True, me='你的名字')

if __name__ == "__main__":
    main()

Respond to friends’ blessings instantly.

python3 auto_reply_wish.py

Show results

Source code collection

Code display

list-friends

View current friends list

import itchat


def listFriend():
    itchat.login(enableCmdQR=2)
    flist = itchat.get_friends(update=True)
    for f in flist:
        print(
            '名称 "%s",备注 "%s", DisplayName "%s&#

Guess you like

Origin blog.csdn.net/Gtieguo/article/details/128797013