Giter VIP home page Giter VIP logo

ritsukage-core's Introduction

ritsukage-core's People

Contributors

bakaolc avatar kunosayo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ritsukage-core's Issues

Exit successfully even fatal error.

Run these commands in order.
ubuntu@VM-4-11-ubuntu:~/project/dt$ stty

speed 9600 baud; line = 0;
min = 1; time = 0;
-brkint -icrnl -imaxbel
-icanon -iexten

ubuntu@VM-4-11-ubuntu:~/project/dt$ cat Program.cs

// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
var a = 0;
string s = Console.ReadLine();
Console.WriteLine("Read:");
Console.WriteLine(s);

var x = 1 / a;
// Environment.Exit(-1);

ubuntu@VM-4-11-ubuntu:~/project/dt$ dotnet run

/home/ubuntu/project/dt/Program.cs(4,12): warning CS8600: Converting null literal or possible null value to non-nullable type. [/home/ubuntu/project/dt/dt.csproj]
Hello, World!
123
Read:
123
Unhandled exception. System.DivideByZeroException: Attempted to divide by zero.
   at Program.<Main>$(String[] args) in /home/ubuntu/project/dt/Program.cs:line 8

ubuntu@VM-4-11-ubuntu:~/project/dt$

min = 1; time = 0;
-brkint -icrnl -imaxbel
-icanon -iexten -echo

Observed that -echo.
And ... the version.

ubuntu@VM-4-11-ubuntu:~/project/dt$ dotnet --version
7.0.302
ubuntu@VM-4-11-ubuntu:~/project/dt$ uname -a
Linux VM-4-11-ubuntu 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

不知道什么原因,dotnet run读了命令行输入之后报错退出会关掉回显给不会用linux的人带来了很多问号
希望能够给整点机制保证大部分异常不会直接炸串(try catch..?)
测个ubuntu被炸的哭死

申请添加资源笔记功能

可以存放一些资源下载链接给bot,后续有人询问的时候可以直接使用bot拉出消息
如 查看现有资源
活7
活6
东方幕华祭红月篇1.0版本
东方真珠岛
(以及其他)
这种,然后 获取资源 活7
下载链接: https://pan.baidu.com/s/1i5ra8G9 密码: 4wxm
这种,大概,不知道会不会有用)x

重新设计与规划逻辑架构

预期在 dotnet8 发布后对框架和逻辑代码进行重构和拆分,重新进行设计与开发
目标是支持多平台的运行并通过支持插件的方式来提供对各个服务的运行

  • 将核心架构重构为不依赖于平台逻辑的基本框架,设计并提供基本的内部通信方法
  • 提供基本的包管理支持,包括依赖检查,加载排序等热加载行为
  • 基于 Roslyn 提供脚本式的代码热编译加载行为
  • 重新设计交互逻辑,内部使用一套另外设计的消息处理机制并以此对用户消息和输入进行处理,通过转化器来将各个不同平台的消息结构和内部消息结构进行互相转化和处理分发。

    当前预期支持目标:Discord.Net,mirai-api-http,Go-CQHttp
    不再使用 Sora 进行针对 Go-CQHttp 的中转支持

  • 其他待补充

Query tip message will crash if there is no such tip

操作平台

QQ
bug描述

+tipremove <NoSuchTipId>

https://github.com/BAKAOLC/Ritsukage-Core/blob/8daf0492fa7536c8a6a76987336cc58041ffc8f8/Ritsukage-Core/Library/Service/TipMessageService.cs#LL30C1-L58C10

        public static async Task<T> GetAsync<T>(Expression<Func<T, bool>> predicate) where T : new()
            => (await Where(predicate)).First();

There is no first element and then crashed.

如何复现

+tipremove <NoSuchTipId>

错误截图或日志

[6/5/2023 8:42:42 PM][DEBUG][Commands]Parser: +tipremove 6
[6/5/2023 8:42:42 PM][DEBUG][Commands]Arguments:
   1| "6"
[6/5/2023 8:42:42 PM][DEBUG][Commands]found 1 command(s) for tipremove
[6/5/2023 8:42:42 PM][DEBUG][Commands]>> Start the precondition check for Void TipRemove(Ritsukage.QQ.SoraMessage, Int32)
[6/5/2023 8:42:42 PM][DEBUG][Commands]  >> Precondition: [<Can work in: Group>] √ Passed.
[6/5/2023 8:42:42 PM][DEBUG][Commands]>> Precondition check passed.
[6/5/2023 8:42:42 PM][DEBUG][Commands]Try to parse parameters for Void TipRemove(Ritsukage.QQ.SoraMessage, Int32).
[6/5/2023 8:42:42 PM][DEBUG][Commands]Invoke Void TipRemove(Ritsukage.QQ.SoraMessage, Int32).
Unhandled exception. System.InvalidOperationException: Sequence contains no elements
   at System.Linq.ThrowHelper.ThrowNoElementsException()
   at lambda_method4999(Closure)
   at Ritsukage.Library.Data.Database.GetAsync[T](Expression`1 predicate) in /home/ubuntu/project/Ritsukage-Core/Ritsukage-Core/Library/Data/Database.cs:line 117
   at Ritsukage.Library.Service.TipMessageService.GetTipMessageById(Int32 id) in /home/ubuntu/project/Ritsukage-Core/Ritsukage-Core/Library/Service/TipMessageService.cs:line 34
   at Ritsukage.QQ.Commands.TipMessage.TipRemove(SoraMessage e, Int32 id) in /home/ubuntu/project/Ritsukage-Core/Ritsukage-Core/QQ/Commands/TipMessage.cs:line 109
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()

补充信息
Running on Linux VM-4-11-ubuntu 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.6 LTS
Release:        20.04
Codename:       focal

看返回类型不是Nullable我没敢动😭

{KK{ }7B6ZB {}UA@T()XD6

模板注释和模板内容看的眼花缭乱 😨
其他的小issue合并一起提提算了

  • return File.ReadAllBytes(ExeFile).SequenceEqual(Resource.aria2c);

    次次检查exe文件,可能会由于上层循环重复下载,导致硬盘IO爆炸
    • 下载代码锁死windows平台,哪怕是把exe替换成了对应平台文件
  • 每次Crash的时候导致Ubuntu控制台没有回显,直到输入回车(未知原因)

♥ 小律影需要接触更多二次元的世界 ♥ 查询番剧

接入Bangumi API

发现实际需要实现的内容较多,糊了点发现功能展开后,实在没时间技术写,先发个issue慢慢实现吧


api文档: https://bangumi.github.io/api

User-Agent说明: https://github.com/bangumi/api/blob/master/docs-raw/user%20agent.md
可能的user-agent如下:

BAKAOLC/Ritsukage-Core/{VERSION} (https://github.com/BAKAOLC/Ritsukage-Core)
  • 查询今日更新番剧 (简略实现)
  • 查询今日几点番剧更新
  • 订阅追番(到点通知)
  • 追番完成后归档数据库
  • 查询已追完的番
  • 查询订阅追番列表
  • 移除订阅追番
  • 查看番剧信息

Allow tip message uses the output of command or Schedule tasks support

+tipcommand <时间> [间隔] [结束时间] -- 在时间之后每[间隔]时间直到[结束时间],输出以执行人权限执行command的结果。

可能的例子:

+tipcommand 2024-01-01T06:00 1D 2024-06-11T00:00 +高考倒计时

或应该等同于计划任务
+schedule <时间> [间隔] [结束时间] <command/lua_script_name/system command...> -- (superuser only的命令)


顺便问问现在如果开发新命令是pr到master还是等v2写好后整pr (x)(pr的命令想法与该issue无关)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.