mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
feat: support SetLongNick
This commit is contained in:
parent
c6d70ef1cf
commit
9ff82bdb90
24
src/onebot11/action/extends/SetLongNick.ts
Normal file
24
src/onebot11/action/extends/SetLongNick.ts
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
import BaseAction from '../BaseAction';
|
||||||
|
import { ActionName } from '../types';
|
||||||
|
import { NTQQUserApi } from '@/core/apis';
|
||||||
|
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||||
|
|
||||||
|
const SchemaData = {
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
longNick: { type: 'string' },
|
||||||
|
},
|
||||||
|
required: [ 'longNick'],
|
||||||
|
} as const satisfies JSONSchema;
|
||||||
|
|
||||||
|
type Payload = FromSchema<typeof SchemaData>;
|
||||||
|
|
||||||
|
export class SetLongNick extends BaseAction<Payload, any> {
|
||||||
|
actionName = ActionName.SetSelfProfile;
|
||||||
|
PayloadSchema = SchemaData;
|
||||||
|
protected async _handle(payload: Payload) {
|
||||||
|
let ret = await NTQQUserApi.setLongNick(payload.longNick)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
@ -69,6 +69,7 @@ import { DelGroupFileFolder } from './file/DelGroupFileFolder';
|
|||||||
import { SetSelfProfile } from './extends/SetSelfProfile';
|
import { SetSelfProfile } from './extends/SetSelfProfile';
|
||||||
import { shareGroupEx, sharePeer } from './extends/sharePeer';
|
import { shareGroupEx, sharePeer } from './extends/sharePeer';
|
||||||
import { CreateCollection } from './extends/CreateCollection';
|
import { CreateCollection } from './extends/CreateCollection';
|
||||||
|
import { SetLongNick } from './extends/SetLongNick';
|
||||||
|
|
||||||
export const actionHandlers = [
|
export const actionHandlers = [
|
||||||
new RebootNormal(),
|
new RebootNormal(),
|
||||||
@ -79,6 +80,7 @@ export const actionHandlers = [
|
|||||||
new shareGroupEx(),
|
new shareGroupEx(),
|
||||||
new sharePeer(),
|
new sharePeer(),
|
||||||
new CreateCollection(),
|
new CreateCollection(),
|
||||||
|
new SetLongNick(),
|
||||||
// new GetConfigAction(),
|
// new GetConfigAction(),
|
||||||
// new SetConfigAction(),
|
// new SetConfigAction(),
|
||||||
// new GetGroupAddRequest(),
|
// new GetGroupAddRequest(),
|
||||||
|
@ -92,5 +92,6 @@ export enum ActionName {
|
|||||||
IOCRImage = '.ocr_image',
|
IOCRImage = '.ocr_image',
|
||||||
SetSelfProfile = "set_self_profile",
|
SetSelfProfile = "set_self_profile",
|
||||||
CreateCollection = "create_collection",
|
CreateCollection = "create_collection",
|
||||||
GetCollectionList = "get_collection_list"
|
GetCollectionList = "get_collection_list",
|
||||||
|
SetLongNick = "set_self_longnick"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user