-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
27 lines (21 loc) · 779 Bytes
/
test.py
File metadata and controls
27 lines (21 loc) · 779 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
import os
import django
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings')
django.setup()
from backend.tasks import parser_chat_members
from backend.models import ParseredChat, Mailing, User, TelegramUser
from social_django.models import UserSocialAuth
from pyrogram import Client
#user = User.objects.first()
# user.social_auth.set(UserSocialAuth.objects.all())
# user.social_auth
# print(user.social_auth.first().extra_data['id'][0])
telegram_user = TelegramUser.objects.first()
# client.set_send_as_chat
client = Client(':memory:',
telegram_user.api_id,
telegram_user.api_hash,
session_string=telegram_user.session_string,
in_memory=True)
client.start()
print(client.get_send_as_chats('me'))