errbot-pomodoro-timerの修正メモ
公開している
出てたエラー
❯ errbot -c demo.py
(略)
21:25:50 ERROR yapsy Unable to create plugin object: ~~/errbot-pomodoro-timer/pomodoro
Traceback (most recent call last):
File "~/venv/lib/python3.6/site-packages/yapsy/PluginManager.py", line 512, in loadPlugins
plugin_info.plugin_object = self.instanciateElement(element)
File "~/venv/lib/python3.6/site-packages/errbot/plugin_manager.py", line 265, in instanciateElement
return element(self.bot, name=self._current_pluginfo.name)
TypeError: __init__() got an unexpected keyword argument 'name'
(略)
>>> !pomodoro start
Command "pomodoro" not found.
何が悪いのか
プラグインの
def instanciateElement(self, element) -> BotPlugin:
"""Overrides the instanciation of plugins to inject the bot reference."""
return element(self.bot)
def instanciateElement(self, element) -> BotPlugin:
"""Overrides the instanciation of plugins to inject the bot reference."""
return element(self.bot, name=self._current_pluginfo.name)
そして、
class Pomodoro(BotPlugin):
WORK_MIN = 25
REST_MIN = 5
def __init__(self, bot):
super().__init__(bot)
self._runners = {}
直す
冷静に
GitLab Meetup Tokyo #2 でLTデビューしてきた
errbot-cloudfront: first