mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
feat: Api SendGroupNotice
This commit is contained in:
parent
91fdd09e7a
commit
9ab80fe1ac
17
src/onebot11/action/go-cqhttp/SendGroupNotice.ts
Normal file
17
src/onebot11/action/go-cqhttp/SendGroupNotice.ts
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import BaseAction from '../BaseAction';
|
||||||
|
import { ActionName } from '../types';
|
||||||
|
import { WebApi } from '@/core/apis';
|
||||||
|
interface Payload {
|
||||||
|
group_id: string;
|
||||||
|
content: string;
|
||||||
|
image?: string;
|
||||||
|
}
|
||||||
|
export class SendGroupNotice extends BaseAction<Payload, null> {
|
||||||
|
actionName = ActionName.GoCQHTTP_SendGroupNotice;
|
||||||
|
|
||||||
|
protected async _handle(payload: Payload) {
|
||||||
|
await WebApi.setGroupNotice(payload.group_id, payload.content);
|
||||||
|
//返回值验证没做
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -53,6 +53,7 @@ import { GetGroupNotice } from './group/GetGroupNotice';
|
|||||||
import { GetGroupEssence } from './group/GetGroupEssence';
|
import { GetGroupEssence } from './group/GetGroupEssence';
|
||||||
import { ForwardFriendSingleMsg, ForwardGroupSingleMsg } from '@/onebot11/action/msg/ForwardSingleMsg';
|
import { ForwardFriendSingleMsg, ForwardGroupSingleMsg } from '@/onebot11/action/msg/ForwardSingleMsg';
|
||||||
import { GetFriendWithCategory } from './extends/GetFriendWithCategory';
|
import { GetFriendWithCategory } from './extends/GetFriendWithCategory';
|
||||||
|
import { SendGroupNotice } from './go-cqhttp/SendGroupNotice';
|
||||||
|
|
||||||
export const actionHandlers = [
|
export const actionHandlers = [
|
||||||
new GetFile(),
|
new GetFile(),
|
||||||
@ -97,6 +98,7 @@ export const actionHandlers = [
|
|||||||
new GetRobotUinRange(),
|
new GetRobotUinRange(),
|
||||||
new GetFriendWithCategory(),
|
new GetFriendWithCategory(),
|
||||||
//以下为go-cqhttp api
|
//以下为go-cqhttp api
|
||||||
|
new SendGroupNotice(),
|
||||||
new GetGroupNotice(),
|
new GetGroupNotice(),
|
||||||
new GetGroupEssence(),
|
new GetGroupEssence(),
|
||||||
new GoCQHTTPSendForwardMsg(),
|
new GoCQHTTPSendForwardMsg(),
|
||||||
|
@ -59,6 +59,7 @@ export enum ActionName {
|
|||||||
SetOnlineStatus = 'set_online_status',
|
SetOnlineStatus = 'set_online_status',
|
||||||
GetFriendsWithCategory = 'get_friends_with_category',
|
GetFriendsWithCategory = 'get_friends_with_category',
|
||||||
// 以下为go-cqhttp api
|
// 以下为go-cqhttp api
|
||||||
|
GoCQHTTP_SendGroupNotice = '_send_group_notice',
|
||||||
GoCQHTTP_GetEssenceMsg = 'get_essence_msg_list',
|
GoCQHTTP_GetEssenceMsg = 'get_essence_msg_list',
|
||||||
GoCQHTTP_SetGroupNotice = '_send_group_notice',
|
GoCQHTTP_SetGroupNotice = '_send_group_notice',
|
||||||
GoCQHTTP_GetGroupNotice = '_get_group_notice',
|
GoCQHTTP_GetGroupNotice = '_get_group_notice',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user