pepperbot/bot.py

41 lines
881 B
Python
Raw Normal View History

2023-08-13 18:31:28 +08:00
from pepperbot import PepperBot
from pepperbot.store.meta import BotRoute
from apps.wuhu_takeoff import WuHuTakeoff
2023-08-13 19:48:16 +08:00
from apps.riic_report_analysis import RIICReportAnalysis
2023-08-13 18:31:28 +08:00
bot = PepperBot(port=5800)
bot.register_adapter(
bot_protocol="onebot",
receive_protocol="websocket",
backend_protocol="http",
backend_host="127.0.0.1",
backend_port=5700,
)
bot.apply_routes(
[
BotRoute(
groups="*",
friends=None,
handlers=[WuHuTakeoff],
),
2023-08-13 19:48:16 +08:00
BotRoute(
groups={
"onebot": [
"810857924", # 测试群
"239200680", # mower 1群
"838353939", # mower 2群
]
},
2023-08-13 19:48:16 +08:00
friends=None,
handlers=[RIICReportAnalysis],
),
2023-08-13 18:31:28 +08:00
]
)
2023-08-13 18:36:01 +08:00
2023-08-13 18:41:10 +08:00
if __name__ == "__main__":
bot.run()