songtianyi / wechat-go

go version wechat web api and message framework for building wechat robot
MIT License
1.84k stars 343 forks source link

add to switcher the 管理插件的插件 #36

Closed suntong closed 6 years ago

suntong commented 6 years ago

Hi @songtianyi,

The new plugin that I'm writting (https://github.com/songtianyi/wechat-go/issues/34) need more functionalities to switcher the 管理插件的插件. So far it supports:

关闭某个插件, 在微信聊天窗口输入

disable faceplusplus

开启某个插件, 在微信聊天窗口输入

enable faceplusplus

查看所有插件信息, 在微信聊天窗口输入

dump

Please (consider) adding one more command to it,

config [plugin] more config strings for the plugin

and have a way for the plugin to take the more config strings for the plugin and do its own configuration.

I need to pass two integers to my plugin for its configuration, which I can take care of it myself when I get the string.

Thanks for consideration!

songtianyi commented 6 years ago
session.HandlerRegister.GetByName(string).SetConfig(string,  interface{})
session.HandlerRegister.GetByName(string).GetConfig(string) interface{}

It's that ok for you?

songtianyi commented 6 years ago

I prefer to add a local(or remote) memory config store module to manage user configurations, and add a new plugin to do getter or setter things.

suntong commented 6 years ago

I trust you'd make the best decision, so whatever you decide and implement, I'll use it.

Thanks for doing that.

songtianyi commented 6 years ago

Sorry, i'll implement the feature this weekend.

suntong commented 6 years ago

NP. Take your time.

Your first proposal is more aiming towards back-end configurations, and I'm glad that you've also planned for the user front-end configurations. :+1:

songtianyi commented 6 years ago

Done. Please check the updated source code and README for usages.

suntong commented 6 years ago

Cool!

I'll take a look this weekend -- I was recovering from the jet-lag after a short trip to China...