Commit 1663c611 authored by nanahira's avatar nanahira

use selection from koishi package

parent 423388c6
import {
App,
Argv,
BeforeEventMap,
Channel,
Command,
Context,
EventMap,
FieldCollector,
MaybeArray,
Modules,
Plugin,
Session,
User,
Selection,
} from 'koishi';
import { KoishiPluginRegistrationOptions, PluginClass } from '../register';
import type { DefaultContext, DefaultState, ParameterizedContext } from 'koa';
......@@ -21,25 +17,6 @@ export interface Type<T = any> extends Function {
new (...args: any[]): T;
}
const selectors = [
'user',
'guild',
'channel',
'self',
'private',
'platform',
] as const;
type SelectorType = typeof selectors[number];
type SelectorValue = boolean | MaybeArray<string | number>;
type BaseSelection = { [K in SelectorType as `$${K}`]?: SelectorValue };
export interface Selection extends BaseSelection {
$and?: Selection[];
$or?: Selection[];
$not?: Selection;
}
export interface ContextSelector {
select?: Selection;
useSelector?: OnContextFunction;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment