分享自己做的存取表情包的小东西

突发奇想想跟bot斗图,所以就想办法教教他
看了日志,收到QQ收藏夹的表情包,日志会包含gchat.qpic.cn,所以就直接检索消息关键词

①如果有qpic就鉴定为表情就开始
②循环检索库存是否有重名的表情 (单纯根据表情链接是否一样,如果群里人多每个人发一遍可能会爆炸),实际上并不行,只有/0?前面的那一部分是表情包代码,其他的会变的。所以改成只检索那一部分,这个真不会,只好堆了一大堆(能用就行)
③没有重复的话就收入库存
④每次收到表情都会从库存随机发一个表情出来

为了方便调整加了个清空的指令 (作用域该怎么清空,我是直接从头覆盖的),查看数量和指定序号输出,方便看运行情况,分享一下代码
(有没有大佬帮忙改进)

插件名称: 表情包
导出时间: 2023/8/14 14:54:45
-=-=-=-=–=-=-=-=- BEGIN KOISHI BLOCKLY BLOCK V1 -=-=–=-=-=–=-=–=-=-=-
H4sIAAAAAAAAA+1baXOqShP+LZRaRYwLLoDEsiIKGvd9iV8sNhUXUBa3D/72tzEa
jUr0RHNu3bpvlUkQ6OmeZ3qfiYtMuILBuaTpsqrA1UvAA7+nY7MvK92j2/CD+Qhf
CP56tgSKqGr69gmecOGMdZNXxdX2znZMfqwKI/3wfcwpfZPrS83DoJjn63sw0vZV
YzWVdkwnsiiOpQWnSTvOsrh74usIYWDoK72P8rmqi2TcaxeBzaK795bbyeCUdb2V
yktsr2VlahpHYgnceMxzwuhE8MPXI2EEVTE0dax35d6pNJlhdx12BXElwUyfAoJT
0itFkCm1f++EayaF3cJwrPZloSuok+kFAApPCRwoZD/ZbPdh6km/VBG6UViM3Zs9
WRqLR0xL5R1lka3AbxDvkmj0LYIZ0tLoyoooLUtnULzzLjKZfUWCHr1W66EBr4OR
EMRGJrbI7MhSmWqtbi9Wk8432FtE0yXd0q/uBP6Cup1KB0q2rLJA1S868/7hYplK
tTyeHCzdB+8d+1RmJ9h2eH3AierCFolTHkZDe06rUm3pwtlydgpDDsMRi6Vsg0Kd
bdd3tH1hwBm+2VQWfILyKdLxxxogcQsSE84YdBVzwk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p
hvtQg/xOLUdv/2OBMZbCiHbE5+uMosCdok4f9Th+FGekoZddaitI15LehdQujMmi
v38lyjyuo+meaT4Kz87g5WnZsyrrbQMEebMLx79Tz4Ghdzmtb06k82IOLCkc2uip
gXWgb92SLZwywyJogePdRsgP2ssbR18++KGv+eFyvv5rypHVXYJObW38TGCVYXII
kGiOFpNJxWJ7bTgdYSzrZyPQaiBMZEzh/ZWfvQZm2eoiW7Ojt1ztKf1ABUwyVt7P
DJFOawBOO1Fj4R7d/zDEj0l6PvXaO5EM7gCUKOmCJk+Nw//97DjsvNwnph8oGQeI
tveOkpxb/ZP1smkeSuZIkCDCHO8NBgOUN8xhvJcSexGvJAV6AoELIsHtSqf/Aee6
94K8NAAA
-=-=–=-=-=–=-=-=-=- END KOISHI BLOCKLY BLOCK V1 -=-=–=-=-=–=-=–=-=-=-

2 个赞

嗯,经过调整修改了逻辑,放一个用了一个月的稳定版本

插件名称: 表情包
导出时间: 2023/10/26 11:12:57
-=-=-=-=–=-=-=-=- BEGIN KOISHI BLOCKLY BLOCK V1 -=-=–=-=-=–=-=–=-=-=-
H4sIAAAAAAAAA+1aaXOqyhb9LZZS5ayIKMSyIggmxnk2frFAUVEEBBw/+NvfBjUm
UQyJOefdd+tV5Zwg6WH16j2s3i2SpJFYbCVouqjI8PSABuF/VVqORbn/7jX8i4YT
YQx+B60O8lDRdOsvOI3gjPmSV4Zb6401Ji8pg5l+/ixx8njJjYX2edBo8GM7GMlq
amxV4TjpQJnPOXl4nFYcHl+jO1cCSUQRnNWZl5Tof2nT6fbW+3RstzGbhQjr2YIU
imEJ84OwMTSuYXCGcAKWtKCPREEavgMrc/MTAoRNIHQSoWmExRGCQqio9SaLEIc/
wUsUYZMIiSF0wmx/GFGU1aXxbkRuYJyoPNNz/vhuyZKwEQec1F9xmsjxktDXBePz
+pPVRK9UKCLJrK8AAww38FQlO2rEd2z5eUFtqn7sOpYUnpOQmLUMEpZB2oNuU8UW
6wTznDMmfXk55wXtM9RIPvnaU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