MCPcopy
hub / github.com/wechaty/python-wechaty / change_status

Method change_status

src/wechaty/plugin.py:654–667  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

652
653 @app.route('/plugins/status', methods=["POST", 'PUT'])
654 async def change_status() -> Response:
655 data = await request.get_json()
656 name = data.get('plugin_name', None)
657 status = data.get('status', None)
658 if name is None or status is None:
659 return error('the plugin_name and status field is required ...')
660 status = int(status)
661 if status == 0:
662 await self.stop_plugin(name)
663 elif status == 1:
664 await self.start_plugin(name)
665 else:
666 return error("unexpected plugin status, which should be one of<Stopped, Running>")
667 return success('changes success ...')
668
669 @app.route('/plugins/setting', methods=['GET'])
670 async def get_plugin_setting() -> Response:

Callers

nothing calls this directly

Calls 5

stop_pluginMethod · 0.95
start_pluginMethod · 0.95
errorFunction · 0.90
successFunction · 0.90
getMethod · 0.80

Tested by

no test coverage detected