python-wechaty
python-wechaty copied to clipboard
๐๐ Bug Report: plugin cannot obtain self.name
requirements
- token type๏ผpadlocal docker 0.65
- version of python-wechaty :0.8.62
Plugins cannot get self.name
File "/home/bigbrother666/CommunityAssistant/run.py", line 22, in <module>
TrainingPlugin(),
File "/home/bigbrother666/CommunityAssistant/antigen_bot/plugins/training.py", line 28, in __init__
self.cache_dir = f'./.{self.name}'
AttributeError: can't set attribute
Reproduce your problem
def __init__(self, options: Optional[WechatyPluginOptions] = None):
super().__init__(options)
# 2. save the log info into <plugin_name>.log file
self.cache_dir = f'./.{self.name}'
self.file_cache_dir = f'{self.cache_dir}/file'
os.makedirs(self.file_cache_dir, exist_ok=True)
log_file = os.path.join(self.cache_dir, 'log.log')
self.logger = get_logger(self.name, log_file)
This issue has been fixed by the latest package, you can upgrade it to fix it.