This represent the Telethon request to send the reaction on the post of the public channel.when run the code I got some error when the code try to run this "SendReactionRequest" they catch the error of TLC object
import asyncio
from telethon.sync import TelegramClient
from telethon.tl.functions.channels import GetFullChannelRequest
from telethon.tl.functions.messages import SendReactionRequest
async def send_reaction(client, chat_id, message_id):
try:
await client(SendReactionRequest(
peer=chat_id,
msg_id=message_id,
big=True,
add_to_recent=True,
reaction=''
))
print('Reaction sent successfully')
except Exception as e:
print("Error sending reaction:", str(e))
async def main(phone):
async with TelegramClient(f'sessions/{phone}', APIID, 'HashXXXX') as client:
if not await client.is_user_authorized():
print(f'{phone} needs to be authenticated by OTP')
return
chat_id = 'ViewTestChannel12'
message_id = 9
await send_reaction(client, chat_id, message_id)
with open('phone.csv', 'r') as file:
phones = file.read().splitlines()
async def run_main():
for phone in phones:
await main(phone)
asyncio.run(run_main())