UsernameNotOccupiedError in python Telethon when a group is deleted
I am using telethon 1.36.0
python library to listen for new telegram messages of specific groups.
This is my relevant code:
How to get messages of a group with chat_id and access_hash?
I have a Python script where I fetch messages of a channel using the following code:
Telethon API – How to get channel info and messages with only channel ID and name?
I have a simple question about the Telethon API for a personal project of mine.
telethon send_read_acknowledge doesn’t work for megagroup
I have some function for marking archived dialogs as read in my telegram account, but it doesn’t work if this dialog is megagroup. I suspect there is no way to do it, if it not, please help me
how to parse the text of a message and buttons from a message that has been edited it telegram
async def exped(self): while self.config.get(“expedition”, False): if self.nextexp is None or datetime.now() >= datetime.strptime(self.nextexp, “%Y-%m-%d %H:%M:%S”): await self.client.send_message(“@game_bot”, “Expeditions”) await asyncio.sleep(3) msg = await self.client.get_messages(“@game_bot”) if “Current Expedition” in msg[0].message: wait_time_match = re.search(r”After : s+(d+)h.s+(d+)min.s+(d+)sec”, msg[0].message) if wait_time_match: hours, minutes, seconds = map(int, wait_time_match.groups()) next_exp_time = datetime.now() + timedelta(hours=hours, minutes=minutes, seconds=seconds) self.set(“nextexp”, next_exp_time.strftime(“%Y-%m-%d %H:%M:%S”)) self.nextexp […]