mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-16 13:01:14 +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 { shareGroupEx, sharePeer } from './extends/sharePeer';
|
||||
import { CreateCollection } from './extends/CreateCollection';
|
||||
import { SetLongNick } from './extends/SetLongNick';
|
||||
|
||||
export const actionHandlers = [
|
||||
new RebootNormal(),
|
||||
@ -79,6 +80,7 @@ export const actionHandlers = [
|
||||
new shareGroupEx(),
|
||||
new sharePeer(),
|
||||
new CreateCollection(),
|
||||
new SetLongNick(),
|
||||
// new GetConfigAction(),
|
||||
// new SetConfigAction(),
|
||||
// new GetGroupAddRequest(),
|
||||
|
@ -92,5 +92,6 @@ export enum ActionName {
|
||||
IOCRImage = '.ocr_image',
|
||||
SetSelfProfile = "set_self_profile",
|
||||
CreateCollection = "create_collection",
|
||||
GetCollectionList = "get_collection_list"
|
||||
GetCollectionList = "get_collection_list",
|
||||
SetLongNick = "set_self_longnick"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user