8.0轰炸pip install itchat
pip install itchat-uos #跳过⽹页登录
:可以python带参数运⾏,或者修改默认default运⾏,参考原作者
import itchat
import argparse
def get_arguments():
parser = argparse.ArgumentParser(description='⽂献表情包发送')
parser.add_argument('--name', type=str, default="name",
help='要发送的⼈的备注')
parser.add_argument('--group', type=str, default="person",
help='要发送到个⼈还是组,默认个⼈')
parser.add_argument('--number', type=int, default=100,
help='发送次数')
parser.add_argument('--expression', type=str, default='[]',
help='要发送的表情/⽂本')
return parser.parse_args()
if__name__ == '__main__':
args = get_arguments()
name = args.name
number = args.number
expression = pression
group = up
itchat.auto_login(hotReload=True)
if group == 'person':
to_name = itchat.search_friends(name=name)
if to_name:
print(to_name)
for i in range(number):
itchat.send(expression, toUserName=to_name[0]['UserName'])
else:
print("查⽆此⼈,请重试")
elif group == 'group':
to_room = itchat.search_chatrooms(name=name)
print(to_room)
if to_room:
for i in range(number):
itchat.send(expression, toUserName=to_room[0]['UserName'])
朋友圈发表情else:
print("查⽆此,请重试")
else:
print("请输⼊group为:person代表个⼈,group代表组,其他字符不识别")
发布评论