如何在 Python Telethon 上使用 while 阅读最后一篇文章

问题描述

当再次从群组中写入消息时,我无法收到新写入的消息。我该如何解决这个问题?

from telethon import TelegramClient
from time import sleep

class proje():

 def __init__(self,):

  self.name="anon"
  self.api_id = 
  self.api_hash = ''
  self.chat = ""

  self.coin_name = []
  with TelegramClient(self.name,self.api_id,self.api_hash) as self.client:
      for self.message in self.client.iter_messages(self.chat,limit=1):
        self.x = self.message.text
        self.y = self.x.split()
        self.coin_name.append(self.y[3])
        print(self.coin_name[0])

  while(True):
   self.client


if __name__=="__main__":
 pr = proje()

输出我的程序:

last message and while loop contunie

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)