Size: a a a

Telethon Talks RU

2019 December 13

ᴀ‎

ᴀʀᴛʜᴜʀ ᴡᴀʏɴᴇ ‎ in Telethon Talks RU
botAPI it's just an connector
источник

ᴀ‎

ᴀʀᴛʜᴜʀ ᴡᴀʏɴᴇ ‎ in Telethon Talks RU
Yes, a wrapper
источник

ᴀ‎

ᴀʀᴛʜᴜʀ ᴡᴀʏɴᴇ ‎ in Telethon Talks RU
источник

ᴀ‎

ᴀʀᴛʜᴜʀ ᴡᴀʏɴᴇ ‎ in Telethon Talks RU
источник

B

Bunk 🐈 in Telethon Talks RU
дык я тут смотрел
источник

B

Bunk 🐈 in Telethon Talks RU
один ужас
источник

B

Bunk 🐈 in Telethon Talks RU
один ужас
источник

#

#Leli in Telethon Talks RU
Hi guys
источник

#

#Leli in Telethon Talks RU
Anyone please help i want to know that if i want to skip first 100 people from csv file  that i dont want to add than how can i skip first 100 people to add
источник

#

#Leli in Telethon Talks RU
First of all letme tell you i am adding members from other group to my group so i want to skip first 100 people from the members.csv file
источник

AS

Alexander Shavelev in Telethon Talks RU
#Leli
Anyone please help i want to know that if i want to skip first 100 people from csv file  that i dont want to add than how can i skip first 100 people to add
do it
источник

AS

Alexander Shavelev in Telethon Talks RU
#Leli
First of all letme tell you i am adding members from other group to my group so i want to skip first 100 people from the members.csv file
you are bad person btw
источник

#

#Leli in Telethon Talks RU
Why brooo
источник

#

#Leli in Telethon Talks RU
Alexander Shavelev
you are bad person btw
Why brooo
источник

#

#Leli in Telethon Talks RU
Guys please help i am searching this from a long time but i fund only this group
источник

#

#Leli in Telethon Talks RU
Alex please bro help
источник

#

#Leli in Telethon Talks RU
from telethon.sync import TelegramClient
from telethon.tl.functions.messages import GetDialogsRequest
from telethon.tl.types import InputPeerEmpty, InputPeerChannel, InputPeerUser
from telethon.errors.rpcerrorlist import PeerFloodError, UserPrivacyRestrictedError
from telethon.tl.functions.channels import InviteToChannelRequest
import sys
import csv
import traceback
import time

api_id = 73
api_hash = 'fbdb5cf68a2be2aa'
phone = '+192929'
client = TelegramClient(phone, api_id, api_hash)

client.connect()
if not client.is_user_authorized():
   client.send_code_request(phone)
   client.sign_in(phone, input('Enter the code: '))

r"C:\Users\vishal\members.csv"
users = []
with open(r"C:\Users\vishal\members.csv", encoding='UTF-8') as f:
   rows = csv.reader(f, delimiter=",", lineterminator="\n")
   next(rows, None)
   for row in rows:
       user = {}
       user['username'] = row[0]
       user['id'] = int(row[1])
       user['access_hash'] = int(row[2])
       user['name'] = row[3]
       users.append(user)
       
chats = []
last_date = None
chunk_size = 200
groups = []

result = client(GetDialogsRequest(
   offset_date=last_date,
   offset_id=0,
   offset_peer=InputPeerEmpty(),
   limit=chunk_size,
   hash=0
))
chats.extend(result.chats)

for chat in chats:
   try:
       if chat.megagroup == True:
           groups.append(chat)
   except:
       continue

print('Choose a group to add members:')
i = 0
for group in groups:
   print(str(i) + '- ' + group.title)
   i += 1

g_index = input("Enter a Number: ")
target_group = groups[int(g_index)]

target_group_entity = InputPeerChannel(target_group.id, target_group.access_hash)

mode = int(input("Enter 1 to add by username or 2 to add by ID: "))

for user in users:
   try:
       print("Adding {}".format(user['id']))
       if mode == 1:
           if user['username'] == "":
               continue
           user_to_add = client.get_input_entity(user['username'])
       elif mode == 2:
           user_to_add = InputPeerUser(user['id'], user['access_hash'])
       else:
           sys.exit("Invalid Mode Selected. Please Try Again.")
       client(InviteToChannelRequest(target_group_entity, [user_to_add]))
       print("Waiting 60 Seconds...")
       time.sleep(10)
   except PeerFloodError:
       print("Getting Flood Error from telegram. Script is stopping now. Please try again after some time.")
   except UserPrivacyRestrictedError:
       print("The user's privacy settings do not allow you to do this. Skipping.")
   except:
       traceback.print_exc()
       print("Unexpected Error")
       continue
источник

#

#Leli in Telethon Talks RU
#Leli
from telethon.sync import TelegramClient
from telethon.tl.functions.messages import GetDialogsRequest
from telethon.tl.types import InputPeerEmpty, InputPeerChannel, InputPeerUser
from telethon.errors.rpcerrorlist import PeerFloodError, UserPrivacyRestrictedError
from telethon.tl.functions.channels import InviteToChannelRequest
import sys
import csv
import traceback
import time

api_id = 73
api_hash = 'fbdb5cf68a2be2aa'
phone = '+192929'
client = TelegramClient(phone, api_id, api_hash)

client.connect()
if not client.is_user_authorized():
   client.send_code_request(phone)
   client.sign_in(phone, input('Enter the code: '))

r"C:\Users\vishal\members.csv"
users = []
with open(r"C:\Users\vishal\members.csv", encoding='UTF-8') as f:
   rows = csv.reader(f, delimiter=",", lineterminator="\n")
   next(rows, None)
   for row in rows:
       user = {}
       user['username'] = row[0]
       user['id'] = int(row[1])
       user['access_hash'] = int(row[2])
       user['name'] = row[3]
       users.append(user)
       
chats = []
last_date = None
chunk_size = 200
groups = []

result = client(GetDialogsRequest(
   offset_date=last_date,
   offset_id=0,
   offset_peer=InputPeerEmpty(),
   limit=chunk_size,
   hash=0
))
chats.extend(result.chats)

for chat in chats:
   try:
       if chat.megagroup == True:
           groups.append(chat)
   except:
       continue

print('Choose a group to add members:')
i = 0
for group in groups:
   print(str(i) + '- ' + group.title)
   i += 1

g_index = input("Enter a Number: ")
target_group = groups[int(g_index)]

target_group_entity = InputPeerChannel(target_group.id, target_group.access_hash)

mode = int(input("Enter 1 to add by username or 2 to add by ID: "))

for user in users:
   try:
       print("Adding {}".format(user['id']))
       if mode == 1:
           if user['username'] == "":
               continue
           user_to_add = client.get_input_entity(user['username'])
       elif mode == 2:
           user_to_add = InputPeerUser(user['id'], user['access_hash'])
       else:
           sys.exit("Invalid Mode Selected. Please Try Again.")
       client(InviteToChannelRequest(target_group_entity, [user_to_add]))
       print("Waiting 60 Seconds...")
       time.sleep(10)
   except PeerFloodError:
       print("Getting Flood Error from telegram. Script is stopping now. Please try again after some time.")
   except UserPrivacyRestrictedError:
       print("The user's privacy settings do not allow you to do this. Skipping.")
   except:
       traceback.print_exc()
       print("Unexpected Error")
       continue
This is the script i am using
источник

#

#Leli in Telethon Talks RU
Прежде всего, давайте скажем вам, что я добавляю участников из другой группы в свою группу, поэтому я хочу пропустить первые 100 человек из файла members.csv
источник

#

#Leli in Telethon Talks RU
Кто-нибудь, пожалуйста, помогите, я хочу знать, что если я хочу пропустить первые 100 человек из CSV-файла, который я не хочу добавлять, то как я могу пропустить первые 100 человек, чтобы добавить
источник