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
a572459d
Commit
a572459d
authored
Aug 04, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
selfid problem
parent
f85f6ea5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
src/playbook/Show.ts
src/playbook/Show.ts
+4
-4
src/plugin.ts
src/plugin.ts
+1
-1
No files found.
src/playbook/Show.ts
View file @
a572459d
...
@@ -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
,
bot
.
selfId
.
toString
()
,
(
await
bot
.
$getGroupMemberInfo
(
this
.
groupId
,
bot
.
selfId
)).
nickname
,
(
await
bot
.
$getGroupMemberInfo
(
this
.
groupId
,
bot
.
selfId
)).
nickname
,
);
);
}
}
...
@@ -58,18 +58,18 @@ export class Show {
...
@@ -58,18 +58,18 @@ export class Show {
for
(
const
character
of
this
.
playbook
.
characters
)
{
for
(
const
character
of
this
.
playbook
.
characters
)
{
// exact
// exact
let
matchBot
=
availableBots
.
find
(
let
matchBot
=
availableBots
.
find
(
(
b
)
=>
botNameMap
.
get
(
b
.
selfId
)
===
character
.
name
,
(
b
)
=>
botNameMap
.
get
(
b
.
selfId
.
toString
()
)
===
character
.
name
,
);
);
// match 1
// match 1
if
(
!
matchBot
)
{
if
(
!
matchBot
)
{
matchBot
=
availableBots
.
find
((
b
)
=>
matchBot
=
availableBots
.
find
((
b
)
=>
botNameMap
.
get
(
b
.
selfId
).
includes
(
character
.
name
),
botNameMap
.
get
(
b
.
selfId
.
toString
()
).
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
)),
character
.
name
.
includes
(
botNameMap
.
get
(
b
.
selfId
.
toString
()
)),
);
);
}
}
if
(
matchBot
)
{
if
(
matchBot
)
{
...
...
src/plugin.ts
View file @
a572459d
...
@@ -119,7 +119,7 @@ export class MyPlugin {
...
@@ -119,7 +119,7 @@ export class MyPlugin {
if
(
!
botId
)
{
if
(
!
botId
)
{
return
`非法指定人物格式:
${
specificCharacter
}
`
;
return
`非法指定人物格式:
${
specificCharacter
}
`
;
}
}
const
bot
=
bots
.
find
((
b
)
=>
b
.
selfId
===
botId
);
const
bot
=
bots
.
find
((
b
)
=>
b
.
selfId
.
toString
()
===
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