【发布时间】:2020-10-10 05:40:45
【问题描述】:
我正在寻找在 Telethon 中创建特定事件
@client.on(events.NewMessage(incoming=True))
async def my_event_handler(event):
if event.is_private:
print("ok")
在这段代码中,我需要在 NewMessage 中有“is_private”,我该怎么做?
以及如何创建具有特定条件的事件?例如,我想在每天 12:00 发送消息,我该怎么做? *注意我有一个事件,所以我不能运行例如
client.send_message(chat_id, "message") # i want 2 this at 12:00 for example
【问题讨论】:
标签: python-3.x telegram telethon