qinglong/repo/dockerbot/jbot/diy/example.py
2021-06-09 18:47:34 +08:00

10 lines
407 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#引入库文件基于telethon
from telethon import events
#从上级目录引入 jdbot,chat_id变量
from .. import jdbot,chat_id
#格式基本固定本例子表示从chat_id处接收到包含hello消息后要做的事情
@jdbot.on(events.NewMessage(chats=chat_id,pattern=('hello')))
#定义自己的函数名称
async def hi(event):
#do something
await jdbot.send_message(chat_id,'hello')