mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
26 lines
762 B
TypeScript
26 lines
762 B
TypeScript
import { BaseAction, Schema } from '../BaseAction'
|
|
import { ActionName } from '../types'
|
|
import { getBuildVersion } from '@/common/utils'
|
|
|
|
interface Payload {
|
|
user_id: number | string
|
|
}
|
|
|
|
export class FriendPoke extends BaseAction<Payload, null> {
|
|
actionName = ActionName.FriendPoke
|
|
payloadSchema = Schema.object({
|
|
user_id: Schema.union([Number, String]).required()
|
|
})
|
|
|
|
async _handle(payload: Payload) {
|
|
if (!this.ctx.app.native.checkPlatform() || !this.ctx.app.native.checkVersion()) {
|
|
// await this.ctx.app.packet.sendPokePacket(+payload.user_id)
|
|
throw new Error('戳一戳暂时只支持Windows QQ 27333 ~ 275970版本')
|
|
}
|
|
else{
|
|
await this.ctx.app.native.sendFriendPoke(+payload.user_id)
|
|
}
|
|
return null
|
|
}
|
|
}
|