hoshikawa-kaguya / sora Goto Github PK
View Code? Open in Web Editor NEW.Net 6异步机器人框架,跨平台,OneBot协议(原CQHTTP协议),在兼容协议的同时主要为Go-Cqhttp提供支持
License: Apache License 2.0
.Net 6异步机器人框架,跨平台,OneBot协议(原CQHTTP协议),在兼容协议的同时主要为Go-Cqhttp提供支持
License: Apache License 2.0
使用环境
1.0.0-rc.41
linux docker
bug描述
SoraCommand
设置SourceFlag.Private
时提示不支持的类型。
经检查应该是CommandUtils.cs
的CheckMethodLegality
的条件判断出现问题。
if (commandAttr.SourceType is not SourceFlag.Group or SourceFlag.Private)
{
Log.Warning("CommandCheck", $"指令{method.Name}设置了不支持的消息源类型({commandAttr.SourceType}),已自动忽略");
return false;
}
PS:
这段代码下面返回的代码好像也有错误,因为没能运行到那边,所以我不太确定,
两个消息类型都是para.ParameterType == typeof(GroupMessageEventArgs)
如何复现
使用service.Event.CommandManager.MappingCommands
加载带有SoraCommand
的dll
SoraCommand
的SourceType
设置为Sora.Enumeration.SourceFlag.Private
错误截图或日志
02/01/2022 11:20:00| Warning | Sora.Command.CommandUtils
[CommandCheck]指令TestCommand设置了不支持的消息源类型(Private),已自动忽略
使用环境
1.0.0-rc.80
Windows
bug描述
实际上群文件列表是可以获取的,但是当群文件数量较多的时候,似乎是超时设置的时间过于短,导致无法完成后续操作。
如何复现
在群文件数量较多的群调用Group.GetGroupRootFiles()
函数
错误截图或日志
fail: Sora.Net.ReactiveApiManager.<SendApiRequest>d__2[0]
[Sora] API超时[msg echo:78e48bb1-6f2c-447d-91c9-847ca68f22fa]
有时需要销毁实例或暂停功能,故 SoraService中需要StopService方法销毁WebSocket连接,需要Pause方法暂停事件分发
go-cqhttp 因为qq官方的一系列协议升级,可能后续会停止开发
详细的原因:go-cqhttp#2471
这里推荐迁移至 Shamrock 这类的NTQQ协议端
并且本项目将会在未来重构,以减少对协议的依赖,未来将会以协议插件的形式实现对协议的解耦
相关repo:
Shamrock
使用环境
1.3.0
Windows
bug描述
Group.GetEssenceMsgList()
在任何群,机器人身份为群主、管理员或普通成员时,均返回ApiStatusType.Ok
,但获取精华消息数始终为0。
如何复现
调用'Group.GetEssenceMsgList()'
错误截图或日志
无
如题,用于辨别发言用户是否群管理员
rc.54
稳定跑了一个月,今天挂了
Application: FFXIV.Sora.exe
CoreCLR Version: 6.0.422.16404
.NET Version: 6.0.4
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Collections.Generic.KeyNotFoundException: The given key '41309edd-e531-4a8d-82c6-ac9d7c1a0faf' was not present in the dictionary.
at System.Collections.Concurrent.ConcurrentDictionary`2.ThrowKeyNotFoundException(TKey key)
at Sora.EventArgs.SoraEvent.BaseMessageEventArgs..ctor(Guid serviceId, Guid connectionId, String eventName, BaseObMessageEventArgs msg, SourceFlag source)
at Sora.OnebotAdapter.EventAdapter.MessageAdapter(JObject messageJson, Guid connection)
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
Originally posted by hd80606b July 15, 2022
MatchType中的KeyWord似乎并不是真正意义上的关键词匹配,而是只要句子里出现了这几个字就会触发
举例:使用指南里的例子,添加MatchType = Sora.Enumeration.MatchType.KeyWord 来匹配 坏耶
然而,你发送:“坏人太多了耶” ,“坏啊啊啊啊啊啊啊啊啊dwadaw啊啊啊啊啊啊耶啊啊啊2adwadwa”
机器人也会回复 好耶
并不是常规的 string.contains 这种关键词匹配,请问是否是个bug
由于旧版的原始消息字段为 message_raw
需要等待新版的字段改为 raw_message
后再做支持
建议将GroupMemberChangeEventArgs 中MemberChangeType SubType 改为公有属性,而不是同命名空间
使用环境
0.9.9.0
cqhttp 1.0.0 beta6
bug描述
崩溃
如何复现
不知道,偶尔遇到
错误截图或日志
[2021/9/5 21:01:02][FATAL][System]检测到未处理的异常进程将停止运行,错误信息:
==============ERROR==============
Error:System.InvalidOperationException
Message:Collection was modified; enumeration operation may not execute.
Stack Trace:
at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
at Sora.Net.ConnectionManager.HeartBeatCheck(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.TimerQueueTimer.CallCallback(Boolean isThreadPool)
at System.Threading.TimerQueueTimer.Fire(Boolean isThreadPool)
at System.Threading.TimerQueue.FireNextTimers()
=================================
忘记圈起来果然还是很丢人,虽然close了还是改一下
rc-52
Application: FFXIV.Sora.exe
CoreCLR Version: 6.0.422.16404
.NET Version: 6.0.4
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Collections.Generic.KeyNotFoundException: The given key '447082cc-4a88-42c4-ab7e-fcc58be9bf8d' was not present in the dictionary.
at System.Collections.Concurrent.ConcurrentDictionary`2.ThrowKeyNotFoundException(TKey key)
at Sora.Net.ConnectionManager.HeartBeatUpdate(Guid connectionGuid)
at Sora.OnebotAdapter.EventAdapter.MetaAdapter(JObject messageJson, Guid connection)
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
在采用了Shamrock的方案后,现在BotServer和Sora被运行在了不同的机器上
当我使用本地文件path的方式发送语音时,由于并不是同一台机器,Shamrock会报错找不到文件。
因此只剩下了Base64与URL的方式可用
或许Sora可以做到在以被动ws的方式启动时,顺便绑一个/static的router在监听的目录下,只要映射到本地存储的一个目录就行了
使用环境
rc17
CentOS 7.6.1810 go-cqhttp v1.0.0-beta6
bug描述
SetFriendAddRequest调用后功能正常但是触发go-cqhttp处理ws命令失败导致WS重连
如何复现
[2021-08-23 19:12:40] [INFO]: 处置WS命令时发生无法恢复的异常:interface conversion: interface {} is int32, not int64
goroutine 479997 [running]:
runtime/debug.Stack(0xc0008417a0, 0xd78000, 0xc001ec8510)
runtime/debug/stack.go:24 +0x9f
github.com/Mrs4s/go-cqhttp/server.(*webSocketConn).handleRequest.func1(0xc000a00690)
github.com/Mrs4s/go-cqhttp/server/websocket.go:372 +0x5b
panic(0xd78000, 0xc001ec8510)
runtime/panic.go:965 +0x1b9
github.com/Mrs4s/go-cqhttp/coolq.(*CQBot).CQMarkMessageAsRead(0xc00029a0c0, 0xc071d2e6b3, 0xa)
github.com/Mrs4s/go-cqhttp/coolq/api.go:1434 +0xb0f
github.com/Mrs4s/go-cqhttp/server.markMSGAsRead(0xc00029a0c0, 0xfb3140, 0xc0007fb240, 0x10)
github.com/Mrs4s/go-cqhttp/server/api.go:354 +0xcc
github.com/Mrs4s/go-cqhttp/server.(*apiCaller).callAPI(0xc0003f5640, 0xc0010ec40b, 0x10, 0xfb3140, 0xc0007fb240, 0xc0010ec454)
github.com/Mrs4s/go-cqhttp/server/api.go:430 +0x409
github.com/Mrs4s/go-cqhttp/server.(*webSocketConn).handleRequest(0xc000a00690, 0xc00029a0c0, 0xc0010ec400, 0x6e, 0x3d6)
github.com/Mrs4s/go-cqhttp/server/websocket.go:379 +0x5a5
github.com/Mrs4s/go-cqhttp/server.(*webSocketServer).listenAPI.func2(0xc000a00690, 0xc0007aa060, 0xc000ceba10)
github.com/Mrs4s/go-cqhttp/server/websocket.go:361 +0x9d
created by github.com/Mrs4s/go-cqhttp/server.(*webSocketServer).listenAPI
github.com/Mrs4s/go-cqhttp/server/websocket.go:359 +0x10e
[2021-08-23 19:12:40] [INFO]: 接受 WebSocket 连接: 127.0.0.1:60306 (/)
怀疑是启用了AutoMarkMessageRead导致的个别特殊API调用报错
错误截图或日志
需要具体核实情况可以QQ 415206409
Sora.Entities.MessageElement.CQModel下的多个类名造成了命名空间污染,建议更名。
例如:
Image->CQImage
Text->CQText
...
这里,提出新的bug,依旧是关于SoraCommand中的MatchType
在这个改过后的版本1.0.0-rc.73
现在KeyWord匹配变成了:只要出现其中一个字就会匹配
举例:依旧指南的例子,添加MatchType = Sora.Enumeration.MatchType.KeyWord 来匹配 坏耶
然而,你发送:“太坏了”,“坏”,“我觉得这个好耶”,“耶”
机器人就会回复“好耶”
使用环境
v1.0.0-rc26
7bccd2baf0Windows Server 2019 Datacenter, .NET SDK 5.0.404
bug描述及如何复现
项目使用 SoraServiceFactory.CreateMultiService() 创建多个Sora服务实例
通过反向ws与多个go-cqhttp服务通讯
启动Sora约五分钟后 Sora.Net.ConnectionManager.HeartBeatUpdate() 抛出KeyNotFoundException
错误截图或日志
2022/1/2 14:39:49
System.Collections.Generic.KeyNotFoundException: The given key 'ced23f42-38af-4544-a057-79592660966c' was not present in the dictionary.
at System.Collections.Concurrent.ConcurrentDictionary`2.ThrowKeyNotFoundException(TKey key)
at Sora.Net.ConnectionManager.HeartBeatUpdate(Guid connectionGuid) in ..\Sora\Net\ConnectionManager.cs:line 177
at Sora.OnebotInterface.EventInterface.MetaAdapter(JObject messageJson, Guid connection) in ..\Sora\OnebotInterface\EventInterface.cs:line 314
at System.Threading.Tasks.Task.<>c.b__140_1(Object state)
at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
使用环境
0.9.9
winserver 2016 go-cqhttp v1.0.0 beta5
bug描述
重连go-cqhttp会失败并进程直接退出,必须先启动bot再启动go-cqhttp才能避免
如何复现
错误截图或日志
[2021/8/29 20:26:22][ERROR][Sora]与Onebot客户端[127.0.0.1:49415]失去链接(心跳包超时)
[2021/8/29 20:26:22][ERROR][Sora]与Onebot客户端[127.0.0.1:49420]失去链接(心跳包超时)
[2021/8/29 20:26:22][ERROR][Sora]与Onebot客户端[127.0.0.1:49423]失去链接(心跳包超时)
[2021/8/29 20:26:22][FATAL][Sora]Websocket连接被关闭失败
[2021/8/29 20:26:22][FATAL][Sora]Websocket连接被关闭失败
[2021/8/29 20:26:22][FATAL][Sora]Websocket连接被关闭失败
[2021/8/29 20:26:22][WARNINIG][Sora]将在5s后自动退出
[2021/8/29 20:26:22][WARNINIG][Sora]将在5s后自动退出
[2021/8/29 20:26:22][WARNINIG][Sora]将在5s后自动退出
[2021/8/29 20:28:47][ERROR][Sora]与Onebot客户端[127.0.0.1:49607]失去链接(心跳包超时)
[2021/8/29 20:28:47][ERROR][Sora]与Onebot客户端[127.0.0.1:49610]失去链接(心跳包超时)
[2021/8/29 20:28:47][ERROR][Sora]与Onebot客户端[127.0.0.1:49613]失去链接(心跳包超时)
[2021/8/29 20:28:47][ERROR][Sora]与Onebot客户端[127.0.0.1:49615]失去链接(心跳包超时)
[2021/8/29 20:28:47][ERROR][Sora]与Onebot客户端[127.0.0.1:49619]失去链接(心跳包超时)
[2021/8/29 20:28:47][ERROR][Sora]与Onebot客户端[127.0.0.1:49621]失去链接(心跳包超时)
[2021/8/29 20:28:47][INFO][Sora]客户端连接被关闭[127.0.0.1:49613]
[2021/8/29 20:28:47][INFO][Sora]客户端连接被关闭[127.0.0.1:49615]
[2021/8/29 20:28:47][INFO][Sora]客户端连接被关闭[127.0.0.1:49619]
[2021/8/29 20:28:47][INFO][Sora]客户端连接被关闭[127.0.0.1:49621]
[2021/8/29 20:28:47][ERROR][Sora]检查心跳包时发生错误 code -1, 连接[94f9fdde-9fe1-412c-851a-d9f156538d01]无法被关闭
FATAL][Sora]Websocket连接被关闭失败
[2021/8/29 20:28:47][FATAL][Sora]Websocket连接被关闭失败
[2021/8/29 20:28:47][ERROR][Sora]检查心跳包时发生错误 code -1, 连接[3704197d-d7dc-48c1-ad7f-8c131f21b5b5]无法被关闭
[2021/8/29 20:28:47][WARNINIG][Sora]将在5s后自动退出
[2021/8/29 20:28:47][WARNINIG][Sora]将在5s后自动退出
[2021/8/29 20:28:47][ERROR][Sora]检查心跳包时发生错误 code -1, 连接[895c40c8-e359-4111-8726-885f60cb5eb6]无法被关闭
[2021/8/29 20:28:47][ERROR][Sora]检查心跳包时发生错误 code -1, 连接[c977ebcd-909b-4348-a7c9-de01a263fe0d]无法被关闭
[2021/8/29 20:28:47][INFO][Sora]已连接客户端[127.0.0.1:49643]
[2021/8/29 20:28:47][INFO][Sora]已连接到go-cqhttp,版本:v1.0.0-beta5
大概就是启动的时候扫描指定目录动态加载dll,扫描注册特定Attribute的类和方法
静态插件化思考了下应该不复杂,不知道整个框架能否支持运行时新增插件
这样可以不停机更新部分模块业务逻辑,感觉好像会很好用୧(๑•̀◡•́๑)૭
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.