Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
koishi-plugin-act
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
3rdeye
koishi-plugin-act
Commits
c5726a5e
Commit
c5726a5e
authored
Oct 31, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bump to Koishi 4.9.7
parent
3156a183
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3060 additions
and
2506 deletions
+3060
-2506
package-lock.json
package-lock.json
+3047
-2493
package.json
package.json
+6
-6
src/playbook/Show.ts
src/playbook/Show.ts
+5
-5
src/plugin.ts
src/plugin.ts
+2
-2
No files found.
package-lock.json
View file @
c5726a5e
This diff is collapsed.
Click to expand it.
package.json
View file @
c5726a5e
...
@@ -15,14 +15,14 @@
...
@@ -15,14 +15,14 @@
"
reflect-metadata
"
:
"
^0.1.13
"
"
reflect-metadata
"
:
"
^0.1.13
"
},
},
"peerDependencies"
:
{
"peerDependencies"
:
{
"@koishijs/plugin-adapter-onebot"
:
"^5.
0.6
"
,
"@koishijs/plugin-adapter-onebot"
:
"^5.
3.3
"
,
"koishi"
:
"^4.9.
1
"
"koishi"
:
"^4.9.
7
"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"
@koishijs/plugin-console
"
:
"
^4.5.4
"
,
"
@koishijs/plugin-console
"
:
"
^4.5.4
"
,
"
@koishijs/plugin-database-memory
"
:
"
^1.5.0
"
,
"
@koishijs/plugin-database-memory
"
:
"
^1.5.0
"
,
"
@koishijs/plugin-sandbox
"
:
"
^2.2.9
"
,
"
@koishijs/plugin-sandbox
"
:
"
^2.2.9
"
,
"
@types/jest
"
:
"
^2
7.4
.0
"
,
"
@types/jest
"
:
"
^2
9.2
.0
"
,
"
@types/lodash
"
:
"
^4.14.172
"
,
"
@types/lodash
"
:
"
^4.14.172
"
,
"
@types/mustache
"
:
"
^4.1.2
"
,
"
@types/mustache
"
:
"
^4.1.2
"
,
"
@types/node
"
:
"
^16.4.11
"
,
"
@types/node
"
:
"
^16.4.11
"
,
...
@@ -32,12 +32,12 @@
...
@@ -32,12 +32,12 @@
"
eslint
"
:
"
^7.32.0
"
,
"
eslint
"
:
"
^7.32.0
"
,
"
eslint-config-prettier
"
:
"
^8.3.0
"
,
"
eslint-config-prettier
"
:
"
^8.3.0
"
,
"
eslint-plugin-prettier
"
:
"
^3.4.0
"
,
"
eslint-plugin-prettier
"
:
"
^3.4.0
"
,
"
jest
"
:
"
^2
7.5.1
"
,
"
jest
"
:
"
^2
9.2.2
"
,
"
raw-loader
"
:
"
^4.0.2
"
,
"
raw-loader
"
:
"
^4.0.2
"
,
"
ts-jest
"
:
"
^2
7.1
.3
"
,
"
ts-jest
"
:
"
^2
9.0
.3
"
,
"
ts-loader
"
:
"
^9.3.1
"
,
"
ts-loader
"
:
"
^9.3.1
"
,
"
ts-node
"
:
"
^10.9.1
"
,
"
ts-node
"
:
"
^10.9.1
"
,
"
typescript
"
:
"
^4.8.
2
"
,
"
typescript
"
:
"
^4.8.
4
"
,
"
webpack
"
:
"
^5.74.0
"
,
"
webpack
"
:
"
^5.74.0
"
,
"
webpack-cli
"
:
"
^4.10.0
"
,
"
webpack-cli
"
:
"
^4.10.0
"
,
"
ws
"
:
"
^8.3.0
"
"
ws
"
:
"
^8.3.0
"
...
...
src/playbook/Show.ts
View file @
c5726a5e
...
@@ -50,7 +50,7 @@ export class Show {
...
@@ -50,7 +50,7 @@ export class Show {
if
(
matchGroup
)
{
if
(
matchGroup
)
{
availableBots
.
push
(
bot
);
availableBots
.
push
(
bot
);
botNameMap
.
set
(
botNameMap
.
set
(
bot
.
selfId
.
toString
()
,
bot
.
selfId
,
(
await
bot
.
getGuildMember
(
this
.
groupId
,
bot
.
selfId
)).
nickname
,
(
await
bot
.
getGuildMember
(
this
.
groupId
,
bot
.
selfId
)).
nickname
,
);
);
}
}
...
@@ -64,18 +64,18 @@ export class Show {
...
@@ -64,18 +64,18 @@ export class Show {
}
}
// exact
// exact
let
matchBot
=
availableBots
.
find
(
let
matchBot
=
availableBots
.
find
(
(
b
)
=>
botNameMap
.
get
(
b
.
selfId
.
toString
()
)
===
character
.
name
,
(
b
)
=>
botNameMap
.
get
(
b
.
selfId
)
===
character
.
name
,
);
);
// match 1
// match 1
if
(
!
matchBot
)
{
if
(
!
matchBot
)
{
matchBot
=
availableBots
.
find
((
b
)
=>
matchBot
=
availableBots
.
find
((
b
)
=>
botNameMap
.
get
(
b
.
selfId
.
toString
()
).
includes
(
character
.
name
),
botNameMap
.
get
(
b
.
selfId
).
includes
(
character
.
name
),
);
);
}
}
// match 2
// match 2
if
(
!
matchBot
)
{
if
(
!
matchBot
)
{
matchBot
=
availableBots
.
find
((
b
)
=>
matchBot
=
availableBots
.
find
((
b
)
=>
character
.
name
.
includes
(
botNameMap
.
get
(
b
.
selfId
.
toString
()
)),
character
.
name
.
includes
(
botNameMap
.
get
(
b
.
selfId
)),
);
);
}
}
if
(
matchBot
)
{
if
(
matchBot
)
{
...
@@ -157,7 +157,7 @@ export class Show {
...
@@ -157,7 +157,7 @@ export class Show {
([
characterId
,
bot
])
=>
([
characterId
,
bot
])
=>
`
${
this
.
playbook
.
characters
`
${
this
.
playbook
.
characters
.
find
((
c
)
=>
c
.
id
===
characterId
)
.
find
((
c
)
=>
c
.
id
===
characterId
)
.
getDisplayName
()}
=>
${
bot
.
self
Id
}
`
,
.
getDisplayName
()}
=>
${
bot
.
user
Id
}
`
,
)
)
.
join
(
'
\n
'
);
.
join
(
'
\n
'
);
}
}
...
...
src/plugin.ts
View file @
c5726a5e
...
@@ -4,7 +4,7 @@ import { Show } from './playbook/Show';
...
@@ -4,7 +4,7 @@ import { Show } from './playbook/Show';
import
{
Playbook
}
from
'
./playbook/Playbook
'
;
import
{
Playbook
}
from
'
./playbook/Playbook
'
;
import
{
plainToClass
}
from
'
class-transformer
'
;
import
{
plainToClass
}
from
'
class-transformer
'
;
import
loadJsonFile
from
'
load-json-file
'
;
import
loadJsonFile
from
'
load-json-file
'
;
import
type
{
OneBotBot
}
from
'
@koishijs/plugin-adapter-onebot
'
;
import
type
OneBotBot
from
'
@koishijs/plugin-adapter-onebot
'
;
export
interface
PluginConfig
{
export
interface
PluginConfig
{
autoChangeName
?:
boolean
;
autoChangeName
?:
boolean
;
...
@@ -116,7 +116,7 @@ export class MyPlugin {
...
@@ -116,7 +116,7 @@ export class MyPlugin {
if
(
!
botId
)
{
if
(
!
botId
)
{
return
`非法指定人物格式:
${
specificCharacter
}
`
;
return
`非法指定人物格式:
${
specificCharacter
}
`
;
}
}
const
bot
=
bots
.
find
((
b
)
=>
b
.
selfId
.
toString
()
===
botId
);
const
bot
=
bots
.
find
((
b
)
=>
b
.
selfId
===
botId
);
if
(
!
bot
)
{
if
(
!
bot
)
{
return
`没有找到机器人
${
botId
}
`
;
return
`没有找到机器人
${
botId
}
`
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment