Skip to content

Commit

Permalink
chore: remove name
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Jan 16, 2020
1 parent 20ebbae commit ce4feb1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion packages/database-sqlite/src/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export type Pragma = {
export const pragma: Pragma = {
user: {
id: 'BIGINT',
name: 'VARCHAR(64)',
flag: 'INT',
authority: 'INT',
usage: 'TEXT',
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-teach/src/receiver.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Context, getSenderName, Meta } from 'koishi-core'
import { Context, Meta } from 'koishi-core'
import { randomPick, CQCode, sleep } from 'koishi-utils'
import { simplifyQuestion, TeachConfig } from './utils'
import { DialogueTest, Dialogue } from './database'
Expand Down Expand Up @@ -39,7 +39,7 @@ export default function (ctx: Context, config: TeachConfig) {
.replace(/\$a/g, `[CQ:at,qq=${meta.userId}]`)
.replace(/\$A/g, '[CQ:at,qq=all]')
.replace(/\$m/g, CQCode.stringify('at', { qq: meta.selfId }))
.replace(/\$s/g, escapeAnswer(getSenderName(meta)))
.replace(/\$s/g, escapeAnswer(meta.sender.card || meta.sender.nickname)) // TODO: name support
.replace(/\$0/g, escapeAnswer(meta.message))
.split('$n')
.map(str => str.trim().replace(/@@__DOLLARS_PLACEHOLDER__@@/g, '$'))
Expand Down
5 changes: 3 additions & 2 deletions packages/plugin-teach/src/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ export default async function (parsedOptions: TeachOptions) {
]

if (config.useWriter && dialogue.writer) {
const user = await ctx.database.getUser(dialogue.writer, 0, ['id', 'name'])
output.push(`来源:${user.name}`)
// TODO: name support
const user = await ctx.database.getUser(dialogue.writer, 0, ['id'])
output.push(`来源:${user.id}`)
}

if (config.useEnvironment) {
Expand Down

0 comments on commit ce4feb1

Please sign in to comment.