简体   繁体   English

如何使用 Telethon 从电报频道中的消息中刮取微笑

[英]How to scrape smiles from a messages in telegram channel with telethon

I scrape messages from a telegram channel with telethon我用 Telethon 从电报频道抓取消息

with TelegramClient('session_name', api_id, api_hash) as client:
   for message in client.iter_messages(chat):
      print(message.sender_id, ':', message.text)

and i have a problem with scrape interactive smiles from a messages, how i get to fix it?我在从消息中抓取交互式微笑时遇到问题,我该如何解决?

Screenshot: in a empty spaces should have been a interactive smiles from telegram截图:在一个空白的地方应该是来自电报的互动微笑

()

I need this smile to scrape Interactive Dice Smile我需要这个微笑来刮互动骰子微笑

There is in telethon type 'InputMediaDice' with it you can catch all interactive emoticons在电视节目类型“InputMediaDice”中,您可以捕捉所有交互式表情符号

with TelegramClient('session_name', api_id, api_hash) as client:
   for message in client.iter_messages(channel_link, reply_to = post_num, filter = InputMediaDice('🎲')):
       if type(message.media) == MessageMediaDice and message.media.emoticon == '🎲' and message.media.value == 5:
           print(message.media.emoticon)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM