koishijs / koishi-plugin-blockly Goto Github PK
View Code? Open in Web Editor NEWUse blockly to write a plugin for koishi bot
Home Page: https://blockly.koishi.chat
License: GNU Affero General Public License v3.0
Use blockly to write a plugin for koishi bot
Home Page: https://blockly.koishi.chat
License: GNU Affero General Public License v3.0
当前问题:插件内容无法保存,切换至其他插件在切换回来会恢复为初始内容
期望效果:正常保存内容
类似py的time.sleep()?
等待期间该程序不处理任何事情
可以减少对时间戳判断的卡顿(?
当前问题:无法获取内容
期望效果:正常获取内容
Bug出现时使用的参数:【文本】<![CDATA[3级]]>
对插件编译以后有可能会被同步到其他的插件,导致其他插件的代码被覆盖。
用于存档,以防炸裂
我在数据迁移时导入以前的blockly插件时出现以下警告信息
app警告: app RuntimeError: memory access out of bounds at wasm://wasm/0025e00a:wasm-function[231]:0xf491 at wasm://wasm/0025e00a:wasm-function[1713]:0x806be at wasm://wasm/0025e00a:wasm-function[96]:0x2c55 at wasm://wasm/0025e00a:wasm-function[921]:0x51197 at wasm://wasm/0025e00a:wasm-function[64]:0x17be at e._sqlite3_step (D:\node\koishi-app\node_modules\@minatojs\sql.js\dist\sql-wasm.js:194:436) at c.step (D:\node\koishi-app\node_modules\@minatojs\sql.js\dist\sql-wasm.js:80:125) at D:\node\koishi-app\node_modules\@minatojs\driver-sqlite\lib\index.js:426:17 at #exec (D:\node\koishi-app\node_modules\@minatojs\driver-sqlite\lib\index.js:412:20) at #all (D:\node\koishi-app\node_modules\@minatojs\driver-sqlite\lib\index.js:423:48)
控制台警告:console RuntimeError: memory access out of bounds at wasm://wasm/0025e00a:wasm-function[231]:0xf491 at wasm://wasm/0025e00a:wasm-function[1713]:0x806be at wasm://wasm/0025e00a:wasm-function[96]:0x2c55 at wasm://wasm/0025e00a:wasm-function[921]:0x51197 at wasm://wasm/0025e00a:wasm-function[64]:0x17be at e._sqlite3_step (D:\node\koishi-app\node_modules\@minatojs\sql.js\dist\sql-wasm.js:194:436) at c.step (D:\node\koishi-app\node_modules\@minatojs\sql.js\dist\sql-wasm.js:80:125) at D:\node\koishi-app\node_modules\@minatojs\driver-sqlite\lib\index.js:426:17 at #exec (D:\node\koishi-app\node_modules\@minatojs\driver-sqlite\lib\index.js:412:20) at #all (D:\node\koishi-app\node_modules\@minatojs\driver-sqlite\lib\index.js:423:48)
sqlite警告1: 2023-11-26 18:30:20 [W] sqlite > UPDATE
blocklySET
body = '{"blocks":{"languageVersion":0,"blocks":[{"type":"command","id":"
d1Uz9)KC+66MwEhJn$+","x":-130,"y":107,"extraState":{"parameters":[{"name":"type","required":true,"type":"any_parameter"},{"name":"n1","required":true,"type":"any_parameter"},{"name":"n2","required":true,"type":"string_parameter"},{"name":"n3","required":true,"type":"number_parameter"}]},"fields":{"name":"涩图"},"inputs":{"action":{"block":{"type":"local_declaration_statement","id":"ox){A%R=^0T@jgua$D%2","extraState":"<mutation xmlns="http://www.w3.org/1999/xhtml\"><localname name="original_url"><localname name="divided_url"><localname name="final_url"><localname name="check404"><localname name="tag"><localname name="authorID"><localname name="id"><localname name="cache"><localname name="title">","fields":{"VAR0":"original_url","VAR1":"divided_url","VAR2":"final_url","VAR3":"check404","VAR4":"tag","VAR5":"authorID","VAR6":"id","VAR7":"cache","VAR8":"title"},"inputs":{"DECL0":{"block":{"type":"text","id":"kI50}LX7!#.%L)7=j9:!","fields":{"TEXT":""}}},"DECL1":{"block":{"type":"text","id":"xla]OnwmUXDPzP0grxB+","fields":{"TEXT":""}}},"DECL2":{"block":{"type":"text","id":"#bcW:tZ1q%:y7Ai0J}cX","fields":{"TEXT":""}}},"DECL3":{"block":{"type":"text","id":"K]-HdjQ.jJvUkgqH7{V","fields":{"TEXT":""}}},"DECL5":{"block":{"type":"text","id":"TmXY%UU,P==-tO3h4,K*","fields":{"TEXT":""}}},"DECL6":{"block":{"type":"text","id":"XrRccEFSxfKw7b0#,d:","fields":{"TEXT":""}}},"DECL7":{"block":{"type":"text","id":"|;!2/0doA]Vo4","fields":{"VAR":"cache"}}}}}}},"next":{"block":{"type":"lexical_variable_set","id":"hr$Auke4q|LSgI++H2I","fields":{"VAR":"id"},"inputs":{"VALUE":{"block":{"type":"json_path_parse","id":"UAKBtr@!}=vk~:o(#[j)","fields":{"path":"id"},"inputs":{"value":{"block":{"type":"lexical_variable_get","id":"$@mc2i|4)SNJD:TMj,4~","fields":{"VAR":"cache"}}}}}}},"next":{"block":{"type":"lexical_variable_set","id":"wrHo0r,)4lhy6BuNXvm","fields":{"VAR":"divided_url"},"inputs":{"VALUE":{"block":{"type":"text_getSubstring","id":"n.Yl-Ro8}-A,uhe02HxY","extraState":"<mutation at1="true" at2="false">","fields":{"WHERE1":"FROM_START","WHERE2":"LAST"},"inputs":{"STRING":{"block":{"type":"text_join","id":"F%fvxqWT9o^:;=^i+(p","extraState":{"itemCount":1},"inputs":{"ADD0":{"block":{"type":"lexical_variable_get","id":"mW/{b!|Vn98cs|mI8{0d","fields":{"VAR":"original_url"}}}}}},"AT1":{"block":{"type":"math_number","id":"V.CA]^k{++Y4J+.e,~J","fields":{"NUM":30}}}}}}},"next":{"block":{"type":"lexical_variable_set","id":"c$:W}%^Orkm]:WF?l|mm","fields":{"VAR":"final_url"},"inputs":{"VALUE":{"block":{"type":"text_join","id":"#7mYKm2MG98zC!?D.NBNCn","fields":{"TEXT":""}}},"DECL8":{"block":{"type":"text","id":"U^dxAV0)@m/:;P+VCg0j","fields":{"TEXT":""}}},"STACK":{"block":{"type":"controls_if","id":"Rw)U+6L(panB!6Gbn1SQ","extraState":{"elseIfCount":4},"inputs":{"IF0":{"block":{"type":"logic_compare","id":"u=~~94K+C^%BY([H^UE1","fields":{"OP":"EQ"},"inputs":{"A":{"block":{"type":"get_argument","id":".yz4OnoEU}G{d{qT:eTz","fields":{"id":0}}},"B":{"block":{"type":"text","id":"i[CrxxgD7!Mt%XJr5|Y0","fields":{"TEXT":"nsfw"}}}}}},"DO0":{"block":{"type":"controls_if","id":"OOmr]Jq3JB9MpD7r^,c
","extraState":{"elseIfCount":2},"icons":{"comment":{"text":"只有一个tag的时候","pinned":false,"height":80,"width":160}},"inputs":{"IF0":{"block":{"type":"logic_operation","id":"brzaP=FyYqD%7nT^ARx","fields":{"OP":"AND"},"inputs":{"A":{"block":{"type":"logic_compare","id":"lat8qwhda,u4:!9I])kt","fields":{"OP":"EQ"},"inputs":{"A":{"block":{"type":"get_argument","id":"t(Yh?fNF4F
5@lWjwo/-","fields":{"id":2}}},"B":{"block":{"type":"logic_null","id":"vk$?{Y3f]8$jYFJH}l$f"}}}}},"B":{"block":{"type":"logic_compare","id":"2,a5uj2Vv1mSODLediXj","fields":{"OP":"NEQ"},"inputs":{"A":{"block":{"type":"get_argument","id":"=it0oKj3KqD4)SO+[U.p","fields":{"id":1}}},"B":{"block":{"type":"logic_null","id":"T4xAz^P/kck)zj[23Z1O"}}}}}}}},"DO0":{"block":{"type":"send_session_message","id":"]?dE#-+4w)v%W_CV(Qi@","inputs":{"content":{"block":{"type":"text_join","id":"h?A3Fn[?FjI;}Vu}8iB","extraState":{"itemCount":1},"inputs":{"ADD0":{"block":{"type":"text","id":"*4H=oyQbyoZ4TpLOU~S","fields":{"TEXT":"nsfw单tag"}}}}}}},"next":{"block":{"type":"lexical_variable_set","id":"VEaZ7o}UXAMbERIt?Kt;","fields":{"VAR":"cache"},"inputs":{"VALUE":{"block":{"type":"http_get","id":"HFUa1kQ{K;2Z1=A?V7s7","fields":{"response_type":"json"},"inputs":{"url":{"shadow":{"type":"text","id":"|wdHf5tPI.{-}DX_w7ey","fields":{"TEXT":"https://koishi.chat/"}},"block":{"type":"text_join","id":"Q_l8UGR{y]XNwd-c0Wl=","extraState":{"itemCount":3},"inputs":{"ADD0":{"block":{"type":"text","id":"D:~m/HUaveAq2s5POET}","fields":{"TEXT":"http://192.168.0.107:1111/api/pixiv/r18/tag/"}}},"ADD1":{"block":{"type":"get_argument","id":"oN7Cu@opWFO9tHk#.=;*","fields":{"id":1}}},"ADD2":{"block":{"type":"text_join","id":"c0hx??A,#m{YdQJTw9+?","extraState":{"itemCount":2},"inputs":{"ADD0":{"block":{"type":"text","id":"TocUe2it,wuV%zH}a6O=","fields":{"TEXT":"?t="}}},"ADD1":{"block":{"type":"time_stamp","id":"./N$P,Ycuv|rbcj*0_sr","fields":{"type":"13"}}}}}}}}}}}}},"next":{"block":{"type":"lexical_variable_set","id":"^p!fGxBz;Zxp$?6]qT)f","fields":{"VAR":"original_url"},"inputs":{"VALUE":{"block":{"type":"json_path_parse","id":"Et,vJ}ByGEGjK.:.M|2x","fields":{"path":"url"},"inputs":{"value":{"block":{"type":"lexical_variable_get","id":"Z^SJ@5F4yFEZ(4:Fx$a]","fields":{"VAR":"cache"}}}}}}},"next":{"block":{"type":"lexical_variable_set","id":"/Z.g6ZTUQCES8qU;RI3:","fields":{"VAR":"title"},"inputs":{"VALUE":{"block":{"type":"json_path_parse","id":"UpIU/eMIf;wB9Hd_1VFP","fields":{"path":"title"},"inputs":{"value":{"block":{"type":"lexical_variable_get","id":"U?7imR[qNh7u$2{^Wr;j","fields":{"VAR":"cache"}}}}}}},"next":{"block":{"type":"lexical_variable_set","id":"Z=,o*,RoA=@0Xd!bwjQj","fields":{"VAR":"authorID"},"inputs":{"VALUE":{"block":{"type":"json_path_parse","id":"qy~efS?$z
?:,ZqaYOAC","fields":{"path":"uid"},"inputs":{"value":{"block":{"type":"lexical_variable_get","id":"fc{U^MuT7Q.V2_XyI5K2F","extraState":{"itemCount":2},"inputs":{"ADD0":{"block":{"type":"text","id":"S2j]qxT+ig/1b/(q:D#L","fields":{"TEXT":"https://pix.nagisa.icu/img-master"}}},"ADD1":{"block":{"type":"lexical_variable_get","id":"h70#kOTe_=o:$*Z-rSZZ","fields":{"VAR":"divided_url"}}}}}}},"next":{"block":{"type":"lexical_variable_set","id":"LL6B%e20=bWU7[CB=)s#","fields":{"VAR":"check404"},"inputs":{"VALUE":{"block":{"type":"http_get","id":"!;?!t|Ji1I{?dxtjrobm","fields":{"response_type":"text"},"inputs":{"url":{"shadow":{"type":"text","id":"|wdHf5tPI.{-}DX_w7ey","fields":{"TEXT":"https://koishi.chat/"}},"block":{"type":"text_join","id":"$[Z;T!HM4+RQrP|~DHa]","extraState":{"itemCount":1},"inputs":{"ADD0":{"block":{"type":"lexical_variable_get","id":"+o,i;e*C[swnD3:?Ns%G","fields":{"VAR":"final_url"}}}}}}}}}},"next":{"block":{"type":"lexical_variable_set","id":"hIRaOE{5cv:/Hs,,ojf:","fields":{"VAR":"cache"},"inputs":{"VALUE":{"block":{"type":"text_indexOf","id":"%W.;8ZWA2H:oF5A%
A:o","fields":{"END":"FIRST"},"inputs":{"VALUE":{"block":{"type":"text_join","id":"j-$gkc=M]SGH!vxs8T","extraState":{"itemCount":1},"inputs":{"ADD0":{"block":{"type":"lexical_variable_get","id":"I30w5Hllo_f+{hG6AW?-","fields":{"VAR":"check404"}}}}}},"FIND":{"shadow":{"type":"text","id":"lc:}iTp#jjqe,Ijhkm}/","fields":{"TEXT":"abc"}},"block":{"type":"text","id":")oNA3B%xS5zVYAtjfwyy","fields":{"TEXT":"404"}}}}}}},"next":{"block":{"type":"controls_if","id":"EMS;.!)llzL%|.QRcAU","inputs":{"IF0":{"block":{"type":"logic_compare","id":"+;YBuJPiz?Ap]bj#ufmF","fields":{"OP":"NEQ"},"inputs":{"A":{"block":{"type":"lexical_variable_get","id":"wEZw[1z,xp6h8V$SUVcP","fields":{"VAR":"cache"}}},"B":{"block":{"type":"math_number","id":"z)B3sVw!WWLFs7%++I","fields":{"NUM":0}}}}}},"DO0":{"block":{"type":"return_message","id":"tXYMcvLm_e4kD,c9Wcme","inputs":{"content":{"block":{"type":"text","id":"6D9na[UkQvGcC/8}kY@B","fields":{"TEXT":"找到了一 张假图,404啦,再试一次吧"}}}}}}},"next":{"block":{"type":"send_session_message","id":"Hb3EwZb-CN6,f_V%;WTh","inputs":{"content":{"block":{"type":"segment_image","id":"Oq;SnIr1dVlC^eXbweTJ","inputs":{"image":{"shadow":{"type":"text","id":"R#Nc}@]lj6{tt83-J?1Q","fields":{"TEXT":"https://koishi.chat/logo.png"}},"block":{"type":"lexical_variable_get","id":"ESgF.Rq-AYLzrjN;q|l!","fields":{"VAR":"final_url"}}}}}}},"next":{"block":{"type":"return_message","id":"$hnBN(dB@CEC?q%fSN+2","inputs":{"content":{"block":{"type":"text_join","id":"oozWK1PY[YWba;P?;?}","extraState":{"itemCount":5},"inputs":{"ADD0":{"block":{"type":"text_join","id":"REh?AXlDm,=Pj,r/XB(E","extraState":{"itemCount":3},"inputs":{"ADD0":{"block":{"type":"text","id":"!2=T?WwL$D(.yONo:KE","fields":{"TEXT":"标题:"}}},"ADD1":{"block":{"type":"lexical_variable_get","id":"1x!^IW5#Q?VYxI3xUy._","fields":{"VAR":"title"}}},"ADD2":{"block":{"type":"text","id":"l5.RdS
7Vz%UIAk-9.T","fields":{"TEXT":" "}}}}}},"ADD1":{"block":{"type":"text_join","id":"P!{HEsY8zyiT,}riB|dm","extraState":{"itemCount":3},"inputs":{"ADD0":{"block":{"type":"text","id":"tZW/jc(a5HlD[M-tHSW?","fields":{"TEXT":"作品id:"}}},"ADD1":{"block":{"type":"lexical_variable_get","id":"MePC@9TB1Aena
^{C(?","fields":{"VAR":"id"}}},"ADD2":{"block":{"type":"text","id":"r=ILEQ(};__EVLuP!LNU","fields":{"TEXT":"
"}}}}}},"ADD2":{"block":{"type":"text_join","id":"lHlzPT8v[iHk7,@Jup","extraState":{"itemCount":3},"inputs":{"ADD0":{"block":{"type":"text","id":"6NmhM.[LPSZxbCil-Y0","fields":{"TEXT":"作者id:"}}},"ADD1":{"block":{"type":"lexical_variable_get","id":"5#XVC6{@rU_K
Vy3@kzO","fields":{"VAR":"authorID"}}},"ADD2":{"block":{"type":"text","id":"RN}%o%*r8R:XF!{[AT(8","fields":{"TEXT":"
"}}}}}},"ADD3":{"block":{"type":"text_join","id":":6jc_PG^B2p_1|x3VKRS","extraState":{"itemCount":3},"inputs":{"ADD0":{"block":{"type":"text","id":":f?~7D[:/0gZ:#OqRtMX","fields":{"TEXT":"原始链接:"}}},"ADD1":{"block":{"type":"lexical_variable_get","id":"s[OiNH0866(PHn$Wr[W","fields":{"VAR":"original_url"}}},"ADD2":{"block":{"type":"text","id":"?tJSHl
K@)3wy)Uh+l+2","fields... sqlite警告2:
2023-11-26 18:33:36 [W] sqlite > SELECT platform
, count
FROM (SELECT platform
, count(distinct pid
) AS count
FROM binding
gvsydpej GROUP BY platform
) pzmkrqeu
2023-11-26 18:33:36 [W] sqlite > SELECT id
, name
, enabled
, edited
, uuid
FROM blockly
cbicxtlc WHERE NOT(id
= -1)`
出现此错误之后koishi直接去世,需删除数据库后才能正常运行(
期望功能:添加正则表达式块,以更自由的方式匹配内容
没有\n太难受了,希望作者能加一个转义字符的模块
No description
HTTP GET请求块在网址返回400、403、422、429等结果会直接报错,并无法执行下面的操作。
但是在很多的api中,如果都会给这些错误的返回结果给予一定的提示数据,我希望请求块能处理这些错误码,并能正常返回相应的数据。
例如,我正在制作一个查询机器人,通过某个官方提供的api接口,可以获取到玩家的数据。
用户在QQ群里发送query 玩家名称,例如query Ailety,然后请求块就会根据用户输入的玩家名去访问一个假设为https://api.xxxx.net/player?playername=Ailety的网址,然后使用json解析并获取相应的数据发送给QQ群的用户。
但是如果用户输入了一个不存在的玩家名,此时https://api.xxxx.net/player?playername=XXXX返回了422,并带有json数据如下:
{
"success": false,
"cause": "Malformed UUID"
}
这里的cause里的“Malformed UUID”意味着用户输入了错误的玩家名。类似此类的还有:
{
"success": false,
"cause": "Invalid API key"
}
或者
{
"success": false,
"cause": "Missing one or more fields [...]"
}
等等
我想通过判断cause里的参数来提示QQ群中的用户他们输入错误的玩家名,而不是一个“发生未知错误”。
如图,这是我的实现过程
经过测试,最终的url可以输出,也可以在浏览器里访问,机器人也可以访问外网,但是无法通过这串url让机器人直接发图。
期待效果:cq码方法,支持下拉菜单选择cq码以及手动输入cq码,操作类似与设置变量block,前面可以下拉选择cq码,后面可以插入相应内容
导入不同的插件a,b,c,d,最后生成的a.b.c.d内容都是a
即使插件正常运行,也无法生成日志,但在终端上看是正常的
编译时,终端可以显示在编译不同的plugins,但是插件界面显示几行后就卡住不再更新显示
如题,能否添加函数功能以便某一项功能的重复调用?
请问一下,可以加一个定时任务的事件模块吗?
怎么实现都行,就是我有些ai图片项目想在blockly上跑
期望功能:类型转换功能,或者强制指定类型功能
期望效果:创建新指令方法可以嵌套到例如判断逻辑里,或者在强制要求参数的时候没有提供参数就执行其他块的内容,类似于 if else 的效果
复现流程:
此问题比较影响使用体验。怀疑背后有更严重的因素。
期望的功能:
感谢大佬!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.