Trying to do some stuff with telebot + telethon.
-------------------- Code --------------------
FILE: All.py
if bot.get_chat_member(message.chat.id, message.from_user.id).status != 'member':
f = open("assets/database/" + str(message.chat.id) + '.txt', 'w+')
invite = bot.export_chat_invite_link(message.chat.id)
bot.get_chat(message.chat.id)
f.close()
chat_id = str(message.chat.id)
f = open("assets/transfer/" + str(message.chat.id) + '.txt', 'w+')
f.write(str(invite) + " " + str(message.from_user.id))
f.close()
a = bot.send_message(message.chat.id, message.chat.id)
mess_id = a.message_id
bot.delete_message(message.chat.id, mess_id)
GetMember = bot.get_chat_member(message.chat.id, message.from_user.id)
f = open("assets/transfer/chat_id.txt", 'w+')
f.write(str(message.chat.id))
f.close()
import Test.py
bot.send_message(message.chat.id, 'Запись проведена успешно. Спасибо!')
FILE Test.py
client = TelegramClient('Bot-Helper', api_id, api_hash).start(bot_token=bot_token)
ch = open('assets/transfer/chat_id.txt', 'r+')
chat_id = ch.readline()
f = open('assets/transfer/' + str(chat_id) + '.txt', 'r+')
fn = open('assets/database/' + str(chat_id) + '.txt', 'w+')
stroka = f.readline().split()
f.close()
parti = client.get_participants(str(stroka[0]))
for x in parti:
if x.bot == False:
fn.write(str(x.id) + " ")
else:
pass
fn.close()
Error screenshot:
Please, help me. I really need it.