File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -192,7 +192,13 @@ bot开发配置中的 `Token`。
192
192
<def title =" type='nameBased' " >
193
193
194
194
通过名称寻找所有可用的 ` EventIntents ` 并合并为最终的 ` intents ` 。
195
- 名称基于继承了 ` EventIntents ` 的 object 的简单类名,例如 ` Guilds ` 。
195
+ 名称基于继承了 ` EventIntents ` 的 object 的简单名称,例如 ` Guilds ` 。
196
+
197
+ 名称支持开头大写或小写的驼峰,例如 ` Guilds ` , ` guilds ` ,
198
+ 或者全大写或全小写的snack(下划线)格式,例如 ` PUBLIC_GUILD_MESSAGES ` , ` public_guild_messages ` 。
199
+
200
+ 虽然支持的格式比较宽松,但名称匹配仍然是** 区分大小写** 的,
201
+ 比如一个混用大小写的snack格式就是不允许的:` public_GUILD_messages ` ❌。
196
202
197
203
``` json
198
204
{
@@ -201,6 +207,23 @@ bot开发配置中的 `Token`。
201
207
}
202
208
```
203
209
210
+ </def >
211
+ <def title =" type='bitBased' " >
212
+ <note >自 <code >4.0.0-beta7</code > 开始支持</note >
213
+
214
+ 通过 ` intents ` 的位索引值来配置 ` intents ` 的结果。
215
+
216
+ ``` json
217
+ {
218
+ "type" : " bitBased" ,
219
+ "bits" : [0 , 1 , 30 ]
220
+ }
221
+ ```
222
+
223
+ 上面的 ` 0, 1, 30 ` 即代表订阅 ` 1<<0 | 1<<1 | 1<<30 ` 。
224
+
225
+ ` bits ` 的元素值应当在 0 ~ 31 之内,但是代码内不做校验。
226
+
204
227
</def >
205
228
</deflist >
206
229
You can’t perform that action at this time.
0 commit comments