forked from Infiziert90/Discord-Skype-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
skype-get.py
31 lines (22 loc) · 941 Bytes
/
skype-get.py
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
import os
import sys
from skpy import Skype
from config import *
if not sys.version_info[:2] >= (3, 6):
print("Error: requires python 3.6 or newer")
exit(1)
output_name = os.path.splitext(os.path.basename(__file__))[0]
def main():
load_config()
sk = Skype(config.MAIN.skype_email, config.MAIN.skype_password)
skype_chats_recent = []
for keys, chat in sk.chats.recent().items():
if chat.__class__.__name__ == "SkypeSingleChat":
skype_chats_recent.append(f"SkypeSingleChat:\nName = {chat.user.name}\nChat_ID = 8:{chat.user.id}\n\n")
if chat.__class__.__name__ == "SkypeGroupChat":
skype_chats_recent.append(f"SkypeGroupChat:\nName = {chat.topic}\nChat_ID = {chat.id}\n\n")
recent_chats = "".join(skype_chats_recent)
with open(f"{output_name}-information.txt", "w") as skype_info:
skype_info.writelines(recent_chats)
if __name__ == "__main__":
main()