Giter VIP home page Giter VIP logo

Comments (8)

richardchien avatar richardchien commented on June 23, 2024

目前需要 at 在消息开头

from nonebot.

ctaoist avatar ctaoist commented on June 23, 2024

@某人 这个只是作为一个命令的参数,不是@机器人,这个在前面不好处理吧
这种情况用session.get('key', prompt='?')获取不到参数

from nonebot.

richardchien avatar richardchien commented on June 23, 2024

噢噢,那你要在 args_parser 里面通过 session.current_arg 获取参数,可以详细看下文档的 https://none.rclab.tk/guide/command.html 这一部分

from nonebot.

ctaoist avatar ctaoist commented on June 23, 2024

完全按照你那个来的啊,感觉 @某人 完全被忽略了。
如果我输入command+(不是@某人消息的参数)可以正常响应。
如果我只输入command,会提示我输入参数
入股我输入command+(@某人),也会提示我输入参数。

from nonebot.

richardchien avatar richardchien commented on June 23, 2024

因为指南里面用的是 session.current_arg_text,这里面是纯文本,但 at 是 CQ 码,不一样的,你比较一下 session.current_arg_textsession.current_arg 就明白了

from nonebot.

ctaoist avatar ctaoist commented on June 23, 2024

换成 session.current_arg 可以正常响应了。
这个不看源码找不到系列吧

from nonebot.

richardchien avatar richardchien commented on June 23, 2024

API 里面有的 https://none.rclab.tk/api.html#current-arg
不过这个确实不好找,毕竟现在进阶文档还没完成,精力不够

from nonebot.

ctaoist avatar ctaoist commented on June 23, 2024

@richardchien 进阶文档写多少放多少啊,我们有用到的地方也可以补充

from nonebot.

Related Issues (20)

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.