使用blockly-null获取群友资料、群聊列表,进行剔除群友、全员禁言等

如题

这两天倒腾的时候发现,blockly对于onebot目前好像只有禁言块是现成的,其他的块比如踢人、禁全员、扒群友头像等等得自个写

写都写了那就在这码一下|∀` )

注意以下适用于onebot适配器


获取某个群友的资料信息

指令:群成员资料 (群号) (成员qq号)
图片

依次返回其头像、id、用户名、群昵称、群职位。
第一个空白块里使用的函数是:

这个函数返回的对象结构如下:

{
"user": 
    {
    "id": "qq号",
    "name": "qq昵称",
    "userId": "qq号",
    "avatar": "头像链接",
    "username": "qq昵称"
    },
"nick": "群昵称",
"roles": ["群职位"]
},

随后处理成了图1的格式。如果需要自定义,在第二个空白块里更改就好


获取所有群友的资料信息

指令:全群成员资料 (群号)

图片

和上面类似,将获取的对象列表处理成如图格式,使用函数:


获取群聊名称和id

指令:群资料 (群号)
图片

图片

用的函数返回信息的原格式是:

{"id":"609656476","name":"test"}


获取全部群的资料

指令:全群资料 (群号)
图片
这会输出你的bot加入的所有群聊列表
图片


全员禁言和全员解除禁言

blockly目前已经有单个群员禁言了,补充一下全员禁言


图片

图片

使用的函数:


比起禁言单个成员没有时长参数,有定时需要的话得自己额外套代码块


剔除群成员

图片
图片
踢管理员和群主都是无效的

导入

插件名称: onebot接口
导出时间: 2024/12/19 20:30:08
-=-=-=-=–=-=-=-=- BEGIN KOISHI BLOCKLY BLOCK V1 -=-=–=-=-=–=-=–=-=-=-
H4sIAAAAAAAAA+1dZ5OqTLD+LZZ6yyyoqGhZqwjmuOb9YhlQMYAixg/7228Pipld
d9f03ntOeVaECT093c909wT0HkrvcMxZccoJPFz5cAv8HQ9nXY6vH9yG/7jNYcNd
cGGRc/BtQZzKjwhKT9DoZlNor+Q7cqHNodAaTPe/hw2+O2t02fK+VMxynA5KkpNK
qzG7rbUljEYNvr2tlmtvby+HngAeZCZRa4HNmQqcSe8gqno3tk23RMlIwoWuZZK8
pAdds0tJbBSkhsTu6Ro3xMaIldjD1ug9coM6HDtsHzSBh4RbAvQMofcS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