Simple Echo Bot¶
A minimal echo bot with zero external dependencies. It receives text messages and echoes them back.
See examples/simple_echo.py in the repository.
Usage¶
How It Works¶
- Creates a
WeiLinkinstance and logs in via QR code. - Enters a polling loop with
wl.recv(timeout=35.0). - For each incoming text message, replies with
"Echo: <text>"usingwl.send().
Key Features Demonstrated¶
- Login flow --
WeiLink()+wl.login()to authenticate. - Long-polling --
wl.recv(timeout=...)blocks until messages arrive or the timeout elapses. - Sending text --
wl.send(user, text)sends a plain text reply. - Graceful shutdown -- catches
KeyboardInterruptand callswl.close().