mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
refine example doc and address https://github.com/deltachat/deltachat-core-rust/pull/1307#pullrequestreview-380876587
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
|
||||
# content of echo_and_quit.py
|
||||
|
||||
import deltachat
|
||||
from deltachat import account_hookimpl, run_cmdline
|
||||
|
||||
|
||||
class EchoPlugin:
|
||||
@deltachat.hookspec.account_hookimpl
|
||||
@account_hookimpl
|
||||
def process_incoming_message(self, message):
|
||||
print("process_incoming message", message)
|
||||
if message.text.strip() == "/quit":
|
||||
@@ -17,13 +17,13 @@ class EchoPlugin:
|
||||
text = message.text
|
||||
message.chat.send_text("echoing from {}:\n{}".format(addr, text))
|
||||
|
||||
@deltachat.hookspec.account_hookimpl
|
||||
@account_hookimpl
|
||||
def process_message_delivered(self, message):
|
||||
print("process_message_delivered", message)
|
||||
|
||||
|
||||
def main(argv=None):
|
||||
deltachat.run_cmdline(argv=argv, account_plugins=[EchoPlugin()])
|
||||
run_cmdline(argv=argv, account_plugins=[EchoPlugin()])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user