You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/dev/star/plugin-new.md
+48Lines changed: 48 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,54 @@ You can add a `logo.png` file in the plugin directory as the plugin's logo. Plea
53
53
54
54
You can modify (or add) the `display_name` field in the `metadata.yaml` file to serve as the plugin's display name in scenarios like the plugin marketplace, making it easier for users to read.
55
55
56
+
### Declare Supported Platforms (Optional)
57
+
58
+
You can add a `support_platforms` field (`list[str]`) to `metadata.yaml` to declare which platform adapters your plugin supports. The WebUI plugin page will display this field.
59
+
60
+
```yaml
61
+
support_platforms:
62
+
- telegram
63
+
- discord
64
+
```
65
+
66
+
The values in `support_platforms` must be keys from `ADAPTER_NAME_2_TYPE`. Currently supported:
67
+
68
+
- `aiocqhttp`
69
+
- `qq_official`
70
+
- `telegram`
71
+
- `wecom`
72
+
- `lark`
73
+
- `dingtalk`
74
+
- `discord`
75
+
- `slack`
76
+
- `kook`
77
+
- `vocechat`
78
+
- `weixin_official_account`
79
+
- `satori`
80
+
- `misskey`
81
+
- `line`
82
+
83
+
### Declare AstrBot Version Range (Optional)
84
+
85
+
You can add an `astrbot_version` field in `metadata.yaml` to declare the required AstrBot version range for your plugin. The format follows dependency specifiers in `pyproject.toml` (PEP 440), and must not include a `v` prefix.
86
+
87
+
```yaml
88
+
astrbot_version: ">=4.16,<5"
89
+
```
90
+
91
+
Examples:
92
+
93
+
- `>=4.17.0`
94
+
- `>=4.16,<5`
95
+
- `~=4.17`
96
+
97
+
If you only want to declare a minimum version, use:
98
+
99
+
- `>=4.17.0`
100
+
101
+
If the current AstrBot version does not satisfy this range, the plugin will be blocked from loading with a compatibility error.
102
+
In the WebUI installation flow, you can choose to "Ignore Warning and Install" to bypass this check.
103
+
56
104
### Debugging Plugins
57
105
58
106
AstrBot uses a runtime plugin injection mechanism. Therefore, when debugging plugins, you need to start the AstrBot main application.
0 commit comments