File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change 22
22
import asyncio
23
23
24
24
from wechaty import (
25
+ Contact ,
25
26
FileBox ,
26
27
Message ,
27
28
Wechaty ,
@@ -43,6 +44,22 @@ async def on_message(msg: Message):
43
44
await msg .say (file_box )
44
45
45
46
47
+ async def on_scan (qrcode : str , status : int ):
48
+ """
49
+ Scan Handler for the Bot
50
+ """
51
+ print (qrcode , status )
52
+ # TODO: To be written
53
+
54
+
55
+ async def on_login (user : Contact ):
56
+ """
57
+ Login Handler for the Bot
58
+ """
59
+ print (user )
60
+ # TODO: To be written
61
+
62
+
46
63
async def main ():
47
64
"""
48
65
Async Main Entry
@@ -58,7 +75,11 @@ async def main():
58
75
''' )
59
76
60
77
bot = Wechaty ()
61
- bot .on ('message' , on_message )
78
+
79
+ bot .on ('scan' , on_scan )
80
+ bot .on ('login' , on_login )
81
+ bot .on ('message' , on_message )
82
+
62
83
await bot .start ()
63
84
64
85
print ('[Python Wechaty] Ding Dong Bot started.' )
You can’t perform that action at this time.
0 commit comments