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

Method update_plugin_setting

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

Source from the content-addressed store, hash-verified

680
681 @app.route('/plugins/setting', methods=['POST', 'PUT'])
682 async def update_plugin_setting() -> Response:
683 data: dict = await request.get_json()
684 if 'setting' not in data:
685 return error("setting field is required ...")
686
687 name = data.get('plugin_name', None)
688 if not name:
689 return error("plugin_name field is required ...")
690
691 if name not in self._plugins:
692 return error(f'plugin<{name}> not exist ...')
693
694 plugin: WechatyPlugin = self._plugins[name]
695 plugin.setting = data['setting']
696 return success(None)
697
698 @app.route("/js/<string:name>", methods=['GET'])
699 @app.route("/css/<string:name>", methods=['GET'])

Callers

nothing calls this directly

Calls 3

errorFunction · 0.90
successFunction · 0.90
getMethod · 0.80

Tested by

no test coverage detected