We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ee5ba2 commit bd5737dCopy full SHA for bd5737d
examples/auto-reply-bot.py
@@ -0,0 +1,29 @@
1
+"""daily plugin bot examples"""
2
+import asyncio
3
+from typing import List
4
+
5
+from wechaty import Wechaty # type: ignore
6
7
+from wechaty_plugin_contrib import (
8
+ AutoReplyRule,
9
+ AutoReplyPlugin,
10
+ AutoReplyOptions
11
+)
12
13
14
+def get_rules() -> List[AutoReplyRule]:
15
+ """get the default auto-reply configuration"""
16
+ return [
17
+ AutoReplyRule(keyword='ding', reply_content='dong'),
18
+ AutoReplyRule(keyword='wechaty', reply_content='hello-wechaty')
19
+ ]
20
21
22
+async def run():
23
+ """async run method"""
24
25
+ plugin = AutoReplyPlugin(AutoReplyOptions(rules=get_rules()))
26
+ bot = Wechaty().use(plugin)
27
+ await bot.start()
28
29
+asyncio.run(run())
0 commit comments