@bot.message_handler(commands = ['sendall'])
def send_welcome(message):
if message.from_user.id == int(adm_id):
print("")
print("------------------------------------------------------")
print("")
num = 0
with open('all_users.txt', 'r') as f:
for line in f:
i = line.strip()
with open('rassylka.txt', 'r', encoding='UTF-8') as fp:
for line in fp:
num += 1
bot.send_message(i, str(f"{line.strip()}"))
print(i + ": Sent! " + str(current_data))
print("")
print("------------------------------------------------------")
else:
print("Error! Line 66")
Один
два
@bot.message_handler(commands = ['sendall'])
def send_welcome(message):
if message.from_user.id == int(adm_id):
print("")
print("------------------------------------------------------")
print("")
num = 0
with open('all_users.txt', 'r') as f:
for line in f:
i = line.strip()
with open('rassylka.txt', 'r', encoding='UTF-8') as fp:
num += 1
bot.send_message(i, fp.read())
print(i + ": Sent! " + str(current_data))
print("")
print("------------------------------------------------------")
else:
print("Error! Line 66")