主頁 > 知識庫 > Python實現(xiàn)微信表情包炸群功能

Python實現(xiàn)微信表情包炸群功能

熱門標(biāo)簽:智能電話機(jī)器人調(diào)研 天津塘沽區(qū)地圖標(biāo)注 江門智能電話機(jī)器人 400電話在線如何申請 如何申請400電話代理 杭州房產(chǎn)地圖標(biāo)注 甘肅高頻外呼系統(tǒng) 滴滴地圖標(biāo)注公司 地圖標(biāo)注可以遠(yuǎn)程操作嗎

Python實現(xiàn)微信表情包炸群效果,具體代碼如下所示;

# -*- coding = utf-8 -*-
# @Time : 2021/1/26 15:19
# @Author : 陳良興
# @File : 微信表情包炸群.py
# @Software : PyCharm

# 運(yùn)行程序 > 輸入次數(shù) > 回車 > 打開微信對話框 > 將鼠標(biāo)放置在“發(fā)送”按鈕處即可

from pynput.keyboard import Controller as KB        #控制鍵盤輸入
from pynput.mouse import Controller,Button         #控制鼠標(biāo)點擊
import time
import random

Wechat_expression = [
  "[微笑]","[撇嘴]","[色]","[發(fā)呆]","[得意]","[流淚]","[害羞]","[閉嘴]","[睡]","[大哭]","[尷尬]",
  "[發(fā)怒]","[調(diào)皮]","[呲牙]","[驚訝]","[難過]","[囧]","[抓狂]","[吐]","[偷笑]","[愉快]","[白眼]",
  "[傲慢]","[困]","[驚恐]","[憨笑]","[悠閑]","[咒罵]","[疑問]","[噓]","[暈]","[衰]","[骷髏]","[豬頭]",
  "[敲打]","[再見]","[擦汗]","[摳鼻]","[鼓掌]","[壞笑]","[右哼哼]","[鄙視]","[委屈]","[快哭了]",
  "[陰險]","[親親]","[可憐]","[笑臉]","[生病]","[臉紅]","[破涕為笑]","[恐懼]","[失望]","[無語]",
  "[嘿哈]","[捂臉]","[奸笑]","[機(jī)智]","[皺眉]","[耶]","[吃瓜]","[加油]","[汗]","[天啊]","[Emm]",
  "[社會社會]","[旺柴]","[好的]","[打臉]","[哇]","[翻白眼]","[666]","[讓我看看]","[嘆氣]","[苦澀]",
  "[裂開]","[嘴唇]","[愛心]","[心碎]","[擁抱]","[強(qiáng)]","[弱]","[握手]","[勝利]","[抱拳]","[勾引]",
  "[拳頭]","[OK]","[合十]","[啤酒]","[咖啡]","[蛋糕]","[玫瑰]","[凋謝]","[菜刀]","[便便]","[月亮]",
  "[太陽]","[禮物]","[紅包]","[發(fā)]","[福]","[跳跳]","[發(fā)抖]","[轉(zhuǎn)圈]","[炸彈]","[慶祝]","[煙花]"
]

#鍵盤控制函數(shù)
def keyboardInput(string):
  keyboard = KB()
  keyboard.type(string)

#鼠標(biāo)控制函數(shù)
def mouseClick():
  mouse = Controller()
  mouse.press(Button.left)
  mouse.release(Button.left)

#響應(yīng)函數(shù)
def response(number):
  time.sleep(5)             #延遲5s響應(yīng)
  for i in range(number):
    sentence = random.choice(Wechat_expression)
    keyboardInput(sentence)
    mouseClick()
    time.sleep(0.4)           #每條消息間隔0.4秒


if __name__ == "__main__":
  while True:
  	print("\033[1;32m發(fā)動機(jī)已啟動,隨時可以出發(fā)!\033[0m")
    Num = input("\033[1;32m請輸入轟炸次數(shù):\033[0m")
    if Num.isdigit():
      response(int(Num))
      print("\033[1;33m報告長官,轟炸完畢,請求下一步作戰(zhàn)計劃?。?!\033[0m")
    else:
      print("\033[1;31m輸入錯誤,請重新輸入一個整數(shù)?。。033[0m")

    #詢問是否繼續(xù)
    answer = input("\033[1;34m是否執(zhí)行下一次作戰(zhàn)計劃?(y 或者 n):\033[0m")
    if answer == "y":
      print("\033[1;33m繼續(xù)轟炸!!!\033[0m")
      continue
    if answer == "n":
      print("\033[1;33m停止轟炸,給他們喘口氣?。。033[0m")
      break
    else:
      print("\033[1;31m輸入錯誤,請輸入“y”或者“n”!!!\033[0m")

操作如下:

首先,運(yùn)行代碼,輸入次數(shù)。

然后,打開微信對話框,將鼠標(biāo)放置在“發(fā)送”按鈕處,即可實現(xiàn)自動隨機(jī)發(fā)送表情包。

最后,根據(jù)自己的選擇是否繼續(xù)執(zhí)行操作。

到此這篇關(guān)于Python實現(xiàn)微信表情包炸群功能的文章就介紹到這了,更多相關(guān)Python微信表情包炸群內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

您可能感興趣的文章:
  • Python基于百度AI實現(xiàn)抓取表情包
  • Python模擬登錄微博并爬取表情包
  • Python基礎(chǔ)進(jìn)階之海量表情包多線程爬蟲功能的實現(xiàn)
  • Python自動生產(chǎn)表情包
  • python實戰(zhàn)之制作表情包游戲

標(biāo)簽:德宏 長春 河池 臨汾 東莞 漢中 廊坊 重慶

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Python實現(xiàn)微信表情包炸群功能》,本文關(guān)鍵詞  Python,實現(xiàn),微信,表情,包炸群,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《Python實現(xiàn)微信表情包炸群功能》相關(guān)的同類信息!
  • 本頁收集關(guān)于Python實現(xiàn)微信表情包炸群功能的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章