mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 11:30:13 +08:00
23 lines
553 B
TypeScript
23 lines
553 B
TypeScript
import { Schema } from 'mongoose'
|
|
import { conditionSchema, ICondition } from './condition.js'
|
|
import { responseSchema, IResponse } from './response.js'
|
|
import { hintSchema, IHint } from './hint.js'
|
|
|
|
export interface ICommandResponder extends IHint {
|
|
condition?: ICondition
|
|
responses: IResponse[]
|
|
}
|
|
|
|
export const commandResponderSchema = new Schema<ICommandResponder>({
|
|
condition: {
|
|
type: conditionSchema,
|
|
required: false,
|
|
},
|
|
responses: {
|
|
type: [responseSchema],
|
|
required: true,
|
|
},
|
|
})
|
|
|
|
commandResponderSchema.add(hintSchema)
|