forked from LCTT/LCBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexport_puid.py
More file actions
33 lines (25 loc) · 826 Bytes
/
export_puid.py
File metadata and controls
33 lines (25 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python3
# coding: utf-8
from wxpy import *
import platform
'''
使用 cache 来缓存登陆信息,同时使用控制台登陆
'''
console_qr=(False if platform.system() == 'Windows' else True)
bot = Bot('bot.pkl', console_qr=console_qr)
'''
开启 PUID 用于后续的控制
'''
bot.enable_puid('wxpy_puid.pkl')
friends = bot.friends()
groups = bot.groups()
with open('data', 'w',encoding='UTF-8') as output:
output.write("-----Bots-------\n")
output.write(str(bot.self.name + '--->'+ bot.self.puid + "\n"))
output.write("-----Friends-------\n")
for i in friends:
output.write(str(i.nick_name + " ---> " + i.puid + "\n"))
output.write("-----Groups-------\n")
for i in groups:
output.write(str(i.name + " ---> " + i.puid + "\n"))
print("数据输出成功!")