style: 强类型大法
This commit is contained in:
1 parent
76501bae34
commit
70945cf2d8
191 files changed
+923
-806
No files matched your search
@@ -3,7 +3,7 @@ import { ActionName, BaseCheckResult } from '@/onebot/action/router';
|
||||
|
||||
|
||||
export abstract class GetPacketStatusDepends<PT, RT> extends OneBotAction<PT, RT> {
|
||||
protected async check(payload: PT): Promise<BaseCheckResult>{
|
||||
protected override async check(payload: PT): Promise<BaseCheckResult>{
|
||||
if (!this.core.apis.PacketApi.available) {
|
||||
return {
|
||||
valid: false,
|
||||
@@ -15,10 +15,10 @@ export abstract class GetPacketStatusDepends<PT, RT> extends OneBotAction<PT, RT
|
||||
}
|
||||
}
|
||||
|
||||
export class GetPacketStatus extends GetPacketStatusDepends<any, null> {
|
||||
actionName = ActionName.GetPacketStatus;
|
||||
export class GetPacketStatus extends GetPacketStatusDepends<void, void> {
|
||||
override actionName = ActionName.GetPacketStatus;
|
||||
|
||||
async _handle(payload: any) {
|
||||
return null;
|
||||
async _handle() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,9 @@ const SchemaData = Type.Object({
|
||||
|
||||
type Payload = Static<typeof SchemaData>;
|
||||
|
||||
export class SendPoke extends GetPacketStatusDepends<Payload, any> {
|
||||
actionName = ActionName.SendPoke;
|
||||
payloadSchema = SchemaData;
|
||||
export class SendPoke extends GetPacketStatusDepends<Payload, void> {
|
||||
override actionName = ActionName.SendPoke;
|
||||
override payloadSchema = SchemaData;
|
||||
|
||||
async _handle(payload: Payload) {
|
||||
if (payload.group_id) {
|
||||
|
||||
Reference in new issue
Block a user