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<
|
return await invoke<
|
||||||
GeneralCallResult & {
|
GeneralCallResult & {
|
||||||
atInfo: {
|
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_DelGroupFile = 'delete_group_file',
|
||||||
GoCQHTTP_GetGroupSystemMsg = 'get_group_system_msg',
|
GoCQHTTP_GetGroupSystemMsg = 'get_group_system_msg',
|
||||||
GoCQHTTP_CreateGroupFileFolder = 'create_group_file_folder',
|
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
|
let isAdmin: boolean = true
|
||||||
if (groupCode) {
|
if (groupCode) {
|
||||||
try {
|
try {
|
||||||
remainAtAllCount = (await ctx.ntGroupApi.getGroupAtAllRemainCount(groupCode)).atInfo
|
remainAtAllCount = (await ctx.ntGroupApi.getGroupRemainAtTimes(groupCode)).atInfo
|
||||||
.RemainAtAllCountForUin
|
.RemainAtAllCountForUin
|
||||||
ctx.logger.info(`群${groupCode}剩余at全体次数`, remainAtAllCount)
|
ctx.logger.info(`群${groupCode}剩余at全体次数`, remainAtAllCount)
|
||||||
const self = await ctx.ntGroupApi.getGroupMember(groupCode, selfInfo.uin)
|
const self = await ctx.ntGroupApi.getGroupMember(groupCode, selfInfo.uin)
|
||||||
|
Reference in New Issue
Block a user