Hi, I've just helped on debugging someone's issue and find the use of PluginMetadata is wrong:
Check your __init__.py:L24
You should always use nonebot.plugin.PluginMetadata instead of define a new one.
This will cause errors when users are using other help plugins and accessing fields like extra with default values assumed in nonebot.plugin.PluginMetadata while your defined one does not have. For example, nonebot-plugin-picmenu will always read extra field of meta without protection (because this field is always there when using nonebot.plugin.PluginMetadata) and will lead to an error like
funcs=_meta_data.extra['menu_data'] if 'menu_data' in _meta_data.extra else None,
AttributeError: 'PluginMetadata' object has no attribute 'extra'
Hi, I've just helped on debugging someone's issue and find the use of PluginMetadata is wrong: Check your __init__.py:L24
You should always use
nonebot.plugin.PluginMetadata
instead of define a new one.This will cause errors when users are using other help plugins and accessing fields like
extra
with default values assumed innonebot.plugin.PluginMetadata
while your defined one does not have. For example, nonebot-plugin-picmenu will always readextra
field of meta without protection (because this field is always there when using nonebot.plugin.PluginMetadata) and will lead to an error like