fix: address P0 and P1 issues from code review
- P0-1: restore customExt field in SetStatusReqSchema - P0-2: remove duplicate setGroupAvatar implementation - P1-3: add attach_info pagination support for get_group_album_media_list - P1-5: clean up commented console.log statements - P1-6: remove raw field from GroupAlbumMediaResult
This commit is contained in:
1 parent
c58f4d4085
commit
e2ee528939
9 files changed
+9
-43
No files matched your search
@@ -39,12 +39,13 @@ export function register(h: ApiHandler, ctx: ApiActionContext): void {
|
||||
h.registerAction('get_group_album_media_list', async (params) => {
|
||||
const groupId = asNumber(params.group_id);
|
||||
const albumId = asString(params.album_id);
|
||||
const attachInfo = asString(params.attach_info) || '';
|
||||
|
||||
if (!groupId) return failedResponse(RETCODE.BAD_REQUEST, 'group_id is required');
|
||||
if (!albumId) return failedResponse(RETCODE.BAD_REQUEST, 'album_id is required');
|
||||
|
||||
try {
|
||||
const mediaList = await ctx.getGroupAlbumMediaList(groupId, albumId);
|
||||
const mediaList = await ctx.getGroupAlbumMediaList(groupId, albumId, attachInfo);
|
||||
return okResponse(mediaList);
|
||||
} catch (error) {
|
||||
const message = error instanceof Error ? error.message : 'failed to get group album media list';
|
||||
|
||||
@@ -111,7 +111,7 @@ export interface ApiActionContext {
|
||||
getGroupEssenceAll: (groupId: number) => Promise<GroupEssenceMsgRet[]>;
|
||||
getGroupAlbumList: (groupId: number) => Promise<any>;
|
||||
uploadImageToGroupAlbum: (groupId: number, albumId: string, albumName: string, filePath: string) => Promise<void>;
|
||||
getGroupAlbumMediaList: (groupId: number, albumId: string) => Promise<any>;
|
||||
getGroupAlbumMediaList: (groupId: number, albumId: string, attachInfo?: string) => Promise<any>;
|
||||
sendGroupNotice: (groupId: number, content: string, options?: any) => Promise<any>;
|
||||
getGroupNotice: (groupId: number) => Promise<any[]>;
|
||||
deleteGroupNotice: (groupId: number, fid: string) => Promise<boolean>;
|
||||
|
||||
@@ -188,7 +188,7 @@ export function buildApiContext(ref: OneBotInstanceContext): ApiActionContext {
|
||||
getGroupEssenceAll: (groupId) => bridge.getGroupEssenceAll(groupId),
|
||||
getGroupAlbumList: (groupId) => bridge.getGroupAlbumList(groupId),
|
||||
uploadImageToGroupAlbum: (groupId, albumId, albumName, filePath) => bridge.uploadImageToGroupAlbum(groupId, albumId, albumName, filePath),
|
||||
getGroupAlbumMediaList: (groupId, albumId) => bridge.getGroupAlbumMediaList(groupId, albumId),
|
||||
getGroupAlbumMediaList: (groupId, albumId, attachInfo) => bridge.getGroupAlbumMediaList(groupId, albumId, attachInfo),
|
||||
sendGroupNotice: (groupId, content, options) => bridge.sendGroupNotice(groupId, content, options),
|
||||
getGroupNotice: (groupId) => bridge.getGroupNotice(groupId),
|
||||
deleteGroupNotice: (groupId, fid) => bridge.deleteGroupNotice(groupId, fid),
|
||||
|
||||
Reference in new issue
Block a user