Giter Site home page Giter Site logo

cyl18 / chaldene Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mirai-net-shelter/mirai.net

9.0 9.0 1.0 6.02 MB

Chaldene是Mirai.Net的修改版fork, 是基于mirai-api-http实现的轻量级mirai社区sdk。

License: GNU Affero General Public License v3.0

C# 100.00%

chaldene's Introduction

Hi there 👋

<好腻害欸>

chaldene's People

Contributors

cyanray avatar cyl18 avatar easyworld avatar ksharperd avatar kyocius avatar lightquanta avatar sinoahpx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

therealkamisama

chaldene's Issues

Todos

  • 线程安全检查
  • 定期拉取上游
  • 群号写上游的
  • 加入 Connected API
  • AutoReconnect 加延时
  • user-friendly 的 exception 体验
  • 换 FriendId 和 GroupId
  • 补全 Mirai 文档
  • 考虑重构 API
  • 画个图标

[FEATURE] 转发消息使用需要详细文档

目前我使用的方式是

当前使用方式 [处理群内一条消息内容过长处理]

#region 群内消息过长处理
    if (args.BotPermission != Chaldene.Data.Shared.Permissions.Member)
    {
        //转发消息主体
        ForwardMessage forwardMessage = new ForwardMessage();
        //转发消息节点
        List<ForwardNode> lstForwardNode = new List<ForwardNode>();
        //时间戳,我这里直接固定了
        string time = "1674503558";
        string botName = "智能机甲";

        lstForwardNode.Add(new ForwardNode
        {
            SenderId = sender.QQ,
            SenderName = botName,
            Time = time,
            MessageChain = new MessageChainBuilder().Plain("消息过长,已自动变成转发消息").Build()
        });
        bool where1 = reviceMsg.Count() >= 300;
        bool where2 = args.MessageChain.Where(a => a.Type == Messages.Image).Count() >= 2;
        if (where1 || where2)
        {
            //添加转发消息节点
            lstForwardNode.Add(new ForwardNode
            {
                SenderId = args.Sender.Id,
                SenderName = args.Sender.Name,
                Time = time,
                MessageChain = args.MessageChain
            });
            //给主体赋值
            forwardMessage.NodeList = lstForwardNode;            
            await args.RecallAsync();
            //发送
            await args.SendMessageAsync(forwardMessage);
        }
    }
    #endregion

[BUG] 禁言发生错误

报错版本

image

报错截图

image

image

image

错误详情信息

Chaldene.Data.Exceptions.InvalidResponseException
  HResult=0x80131500
  Message=原因: 错误的访问
备注: url=http://xxxxx:xxx/mute
payload={
  "target": {
    "Id": "588504056"
  },
  "memberId": {
    "Id": "1075858260"
  },
  "time": 60
}
  Source=Chaldene
  StackTrace:
   在 Chaldene.Sessions.MiraiBot.EnsureSuccess(String json, String appendix)
   在 Chaldene.Sessions.MiraiBot.<PostJsonAsync>d__255.MoveNext()
   在 Chaldene.Sessions.MiraiBot.<PostJsonAsync>d__256.MoveNext()
   在 Chaldene.Sessions.MiraiBot.<MuteAsync>d__22.MoveNext()
   在 Program.<>c__DisplayClass0_0.<<<Main>$>b__1>d.MoveNext() 在 D:\Work\2023\liuningBot\Program.cs 中: 第 99 行


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.