mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
feat
This commit is contained in:
@@ -246,7 +246,7 @@ export class NTQQGroupApi extends Service {
|
||||
}
|
||||
}
|
||||
|
||||
async getGroupAtAllRemainCount(groupCode: string) {
|
||||
async getGroupRemainAtTimes(groupCode: string) {
|
||||
return await invoke<
|
||||
GeneralCallResult & {
|
||||
atInfo: {
|
||||
|
25
src/onebot11/action/go-cqhttp/GetGroupAtAllRemain.ts
Normal file
25
src/onebot11/action/go-cqhttp/GetGroupAtAllRemain.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import BaseAction from '../BaseAction'
|
||||
import { ActionName } from '../types'
|
||||
|
||||
interface Payload {
|
||||
group_id: number | string
|
||||
}
|
||||
|
||||
interface Response {
|
||||
can_at_all: boolean
|
||||
remain_at_all_count_for_group: number
|
||||
remain_at_all_count_for_uin: number
|
||||
}
|
||||
|
||||
export class GetGroupAtAllRemain extends BaseAction<Payload, Response> {
|
||||
actionName = ActionName.GoCQHTTP_GetGroupAtAllRemain
|
||||
|
||||
async _handle(payload: Payload) {
|
||||
const data = await this.ctx.ntGroupApi.getGroupRemainAtTimes(payload.group_id.toString())
|
||||
return {
|
||||
can_at_all: data.atInfo.canAtAll,
|
||||
remain_at_all_count_for_group: data.atInfo.RemainAtAllCountForGroup,
|
||||
remain_at_all_count_for_uin: data.atInfo.RemainAtAllCountForUin
|
||||
}
|
||||
}
|
||||
}
|
@@ -76,5 +76,6 @@ export enum ActionName {
|
||||
GoCQHTTP_DelGroupFile = 'delete_group_file',
|
||||
GoCQHTTP_GetGroupSystemMsg = 'get_group_system_msg',
|
||||
GoCQHTTP_CreateGroupFileFolder = 'create_group_file_folder',
|
||||
GoCQHTTP_DelGroupFolder = 'delete_group_folder'
|
||||
GoCQHTTP_DelGroupFolder = 'delete_group_folder',
|
||||
GoCQHTTP_GetGroupAtAllRemain = 'get_group_at_all_remain'
|
||||
}
|
||||
|
@@ -54,7 +54,7 @@ export async function createSendElements(
|
||||
let isAdmin: boolean = true
|
||||
if (groupCode) {
|
||||
try {
|
||||
remainAtAllCount = (await ctx.ntGroupApi.getGroupAtAllRemainCount(groupCode)).atInfo
|
||||
remainAtAllCount = (await ctx.ntGroupApi.getGroupRemainAtTimes(groupCode)).atInfo
|
||||
.RemainAtAllCountForUin
|
||||
ctx.logger.info(`群${groupCode}剩余at全体次数`, remainAtAllCount)
|
||||
const self = await ctx.ntGroupApi.getGroupMember(groupCode, selfInfo.uin)
|
||||
|
Reference in New Issue
Block a user