Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add plugin-baidu #153

Merged
merged 14 commits into from
Mar 15, 2021
Merged

Add plugin-baidu #153

merged 14 commits into from
Mar 15, 2021

Conversation

dragon-fish
Copy link
Member

依葫芦画瓢…

我说我是乱写的,我可真的是乱写的啊……

@codecov
Copy link

codecov bot commented Mar 14, 2021

Codecov Report

Merging #153 (13225a6) into develop (0a83138) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #153   +/-   ##
========================================
  Coverage    90.89%   90.89%           
========================================
  Files           53       53           
  Lines        10122    10122           
  Branches      1981     1981           
========================================
  Hits          9200     9200           
  Misses         922      922           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0a83138...70019fe. Read the comment docs.

@dragon-fish dragon-fish requested a review from shigma March 15, 2021 07:00
koishi
.command('tools/baidu <keyword>', '使用百度百科搜索')
.example('百度一下最终幻想14')
.shortcut(/^百度(一下)?(.+?)$/, { args: ['$2'] })
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

实践证明目前的shortcut非常容易误触,请看情况改进一下。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已解决

Number(answer) < 1 ||
Number(answer) > showedResult
) {
return session.send('编号输入有误!')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

经实践证明,这里的回复可能会有点吵。

也许可以加一个判断条件,例如输入的不是数字就不采取行动;或者回复“cancel”、“0”之类的取消搜索。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我建议默认行为不产生输出;以及你没有判断是否为整数。

* @param {...String} args
* @return {String}
*/
function _msg(msgKey: string, ...args: string[]): string {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

koishi v3好像新增了一个模板语法,但我不太明白。这里可能存在重复造轮,请视情况帮忙改一改。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改过了

@undefined-moe

This comment has been minimized.

@shigma
Copy link
Member

shigma commented Mar 15, 2021

  1. 你这个没过 lint,虽然我不知道为啥 CI 过了,可能 CI 坏了罢。没过 lint 主要是两个原因:
    • comma dangle
    • prefer const
  2. 建议把 license 写文件头,不然各种检测都扫不出来

@shigma
Copy link
Member

shigma commented Mar 15, 2021

  1. 从设计的角度,sendError 与 error-with-link 重复了,只需要留一个,通过 template api 可以将 error-with-link 配置为空以实现 sendError = false 的功能

@shigma
Copy link
Member

shigma commented Mar 15, 2021

  1. 加入了 format 配置项,用户可以自行配置输出结果

@shigma shigma merged commit ae3f004 into koishijs:develop Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants