Вот сам код
import telebot
bot = telebot.TeleBot('Пукнул')
joinedFile = open("C:/Users/TupaBan/Desktop/MyTelegramBot/joined.txt", "r")
joinedUsers = set ()
for line in joinedFile.readLines():
joinedUsers.add(line.strip())
joinedFile.close()
@bot.message_handler(commands=['start'])
def startJoin(message):
if not str(message.chat.id) in joinedUsers:
joinedFile = open("C:/Users/TupaBan/Desktop/MyTelegramBot/joined.txt", "a")
joinedFile.write(str(message.chat.id) + "\n")
joinedUsers.add(message.chat.id)
@bot.message_handler(commands=['TupaBanS'])
def mess(message):
for user in joinedUsers:
bot.send_message(user, message.text[message.text.find(' '):])
Вот ошибка:
File "C:\Users\TupaBan\Desktop\MyTelegramBot\bot.py", line 7, in
from rassilka import *
File "C:\Users\TupaBan\Desktop\MyTelegramBot\rassilka.py", line 5, in
for line in joinedFile.readLines():
AttributeError: '_io.TextIOWrapper' object has no attribute 'readLines'