Skip to content

Commit 8390a69

Browse files
committed
fix scheudler
1 parent 564fa9a commit 8390a69

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/wechaty/plugin.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ def _load_default_plugins() -> List[WechatyPlugin]:
512512
# TODO: to be implemented
513513

514514

515-
class WechatyPluginManager(WechatyEventMixin, WechatySchedulerMixin): # pylint: disable=too-many-instance-attributes
515+
class WechatyPluginManager: # pylint: disable=too-many-instance-attributes
516516
"""manage the wechaty plugin, It will support some features."""
517517

518518
def __init__(
@@ -589,7 +589,9 @@ def add_plugin(self, plugin: Union[str, WechatyPlugin]) -> None:
589589
log.warning('plugin : %s has exist', plugin.name)
590590
return
591591
plugin_instance = plugin
592-
592+
593+
# set the scheduler
594+
plugin.scheduler = self.scheduler
593595
self._plugins[plugin_instance.name] = plugin_instance
594596
# default wechaty plugin status is Running
595597
self._plugin_status[plugin_instance.name] = PluginStatus.Running
@@ -662,6 +664,7 @@ async def start(self) -> None:
662664
plugin.set_bot(self._wechaty)
663665
await plugin.init_plugin(self._wechaty)
664666
await plugin.blueprint(self.app)
667+
self.scheduler.start()
665668
# check the host & port configuration
666669

667670
# pylint: disable=W0212

0 commit comments

Comments
 (0)