帮助:相对较新的电视节目并且遇到delete_messages()
功能问题。它“似乎”对我无济于事......
最初,我从返回对象的 id 值中从 send_message 获取消息 id。它返回 1、2 等值。但不确定这是消息 ID。
我把它发送delete_messages
给delete_messages(channel, [id])
我从以下渠道获得频道(这是一个私人频道):
def resolve_channel_id(self, name):
try:
if name in self.__channel_ids:
return self.__channel_ids[name]
channel_id = self.client(ResolveUsernameRequest(name))
self.__channel_ids[name] = channel_id
return channel_id
# except UserNameNotOccupiedError as err:
except Exception as err:
# try for private channel
chatinvite = self.client(CheckChatInviteRequest(name))
channel_id = chatinvite.chat.id
access_hash_channel = chatinvite.chat.access_hash
channel_id = InputChannel(channel_id, access_hash_channel)
self.__channel_ids[name] = channel_id
return channel_id