to more groups and it sees commands but when i add to one group that is public and over 100k people it doesn't answer to messages. Why?
if bot isn't admin there, and you have no faults in your code, make sure you have disabled group privacy
what is group privacy ? it happend in private chat not a group
that's not a reply to you, and show the events.NewMessage part of the code
:) sorry for that. wait
@client.on(events.NewMessage(pattern=r'/?tts (.*)', outgoing=True)) async def tts(event): if event.fwd_from: return text = event.pattern_match.group(1) print(text) tts = gTTS(text=text, lang='en') tts.save('tts.mp3') await client.send_file(event.chat_id, 'tts.mp3', voice_note=True) await event.delete() os.remove('tts.mp3')
it can't happen. you've mostly mixed clients, try as await event.client.send_file instead
i also used event.chat instead of chat_id but event.chat is NoneType
and as for that try to: print(event.input_chat, event.sender) later
event.input_chat is None and it returns same error with event.sender_id
sender is me !! i want send the file to chat
I know. try using the print(await event.get_input_chat()) afaik UpdateShortMessage (the one that has chat as None) can't include min entities, so it shouldn't be raising a ValueError, if it does, you have no way of using id, passing event.peer_id usage may help
Already did that...
Server is cockblocking your bot for some reason, but it should be expected if it's not admin, there are many hidden limitations
Обсуждают сегодня