From 95231b0ba18ab02c33ac04f0a1154e89d572e104 Mon Sep 17 00:00:00 2001 From: MODcraft Date: Sat, 1 Apr 2023 20:59:06 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=AF=BC=E5=87=BA=20internal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adapters/kook/src/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/adapters/kook/src/index.ts b/adapters/kook/src/index.ts index 74343e19..43b7507a 100644 --- a/adapters/kook/src/index.ts +++ b/adapters/kook/src/index.ts @@ -13,6 +13,10 @@ export default KookBot declare global { namespace Satori { + interface Session { + kook?: Kook.Payload & Kook.Internal + } + interface Events { 'kook/message-btn-click': {} } From 9cbd81a55b5ce2347accbdc12f2145877cf6e2c8 Mon Sep 17 00:00:00 2001 From: MODcraft Date: Sat, 1 Apr 2023 21:34:28 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adapters/kook/src/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adapters/kook/src/types.ts b/adapters/kook/src/types.ts index 267f9173..b350e190 100644 --- a/adapters/kook/src/types.ts +++ b/adapters/kook/src/types.ts @@ -253,8 +253,8 @@ export interface Channel { name: string user_id: string guild_id: string - isCategory: number - parentId: string + is_category: number + parent_id: string topic: string type: number level: number From 4f6fdf8feee26328fa23b9193cb4cb88c97e3286 Mon Sep 17 00:00:00 2001 From: MODcraft Date: Sun, 2 Apr 2023 01:22:36 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=A2=91=E9=81=93API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adapters/kook/src/types.ts | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/adapters/kook/src/types.ts b/adapters/kook/src/types.ts index b350e190..b85bb9ef 100644 --- a/adapters/kook/src/types.ts +++ b/adapters/kook/src/types.ts @@ -387,6 +387,47 @@ export interface Internal { createGuildMute(param: { guild_id: string; user_id: string; type: GuildMute.Type }): Promise deleteGuildMute(param: { guild_id: string; user_id: string; type: GuildMute.Type }): Promise getGuildBoostHistory(param: { guild_id: string; start_time: number; end_time: number }): Promise> + + getChannelList(param: { guild_id: string }): Promise> + getChannelView(param: { target_id: string }): Promise + createChannel(param: { + guild_id: string + parent_id?: string + name: string + type?: number + limit_amount?: number + voice_quality?: string + is_category?: 0|1 + }): Promise + updateChannel(param: { + channel_id: string + name?: string + topic?: string + slow_mode?: 0|5000|10000|15000|30000|60000|120000|300000|600000|900000|1800000|3600000|7200000|21600000 + }): Promise + deleteChannel(param: { channel_id: string }): Promise + getChannelUserList(param: { channel_id: string }): Promise> + moveChannelUser(param: { target_id: string; user_ids: [] }): Promise + getChannelRoleIndex(param: { channel_id: string }): Promise<{ permission_overwrites: Overwrite; permission_users: List; permission_sync: 0 | 1 }> + createChannelRole(param: { channel_id: string; type?: 'role_id' | 'user_id'; value?: string }): Promise<{ + user_id?: string // 此处待修改 + role_id?: string // 此处待修改 + allow: number + deny: number + }> + updateChannelRole(param: { + channel_id: string + type?: 'role_id' | 'user_id' + value?: string + allow?: number + deny?: number + }): Promise<{ + user_id?: string // 此处待修改 + role_id?: string // 此处待修改 + allow: number + deny: number + }> + deleteChannelRole(param: { channel_id: string; type?: 'role_id' | 'user_id'; value?: string }): Promise } export class Internal { From 717c1ab17f36bde8451b379cb4787376601c18ac Mon Sep 17 00:00:00 2001 From: MODcraft Date: Sun, 2 Apr 2023 01:42:37 +0800 Subject: [PATCH 4/5] update --- adapters/kook/src/types.ts | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/adapters/kook/src/types.ts b/adapters/kook/src/types.ts index b85bb9ef..f6363824 100644 --- a/adapters/kook/src/types.ts +++ b/adapters/kook/src/types.ts @@ -409,21 +409,23 @@ export interface Internal { getChannelUserList(param: { channel_id: string }): Promise> moveChannelUser(param: { target_id: string; user_ids: [] }): Promise getChannelRoleIndex(param: { channel_id: string }): Promise<{ permission_overwrites: Overwrite; permission_users: List; permission_sync: 0 | 1 }> - createChannelRole(param: { channel_id: string; type?: 'role_id' | 'user_id'; value?: string }): Promise<{ - user_id?: string // 此处待修改 - role_id?: string // 此处待修改 + createChannelRole(param: { channel_id: string; type?: 'user_id'; value?: string }): Promise<{ + user_id: string allow: number deny: number }> - updateChannelRole(param: { - channel_id: string - type?: 'role_id' | 'user_id' - value?: string - allow?: number - deny?: number - }): Promise<{ - user_id?: string // 此处待修改 - role_id?: string // 此处待修改 + createChannelRole(param: { channel_id: string; type: 'role_id'; value?: string }): Promise<{ + role_id: string + allow: number + deny: number + }> + updateChannelRole(param: { channel_id: string; type?: 'user_id'; value?: string; allow?: number; deny?: number }): Promise<{ + user_id: string + allow: number + deny: number + }> + updateChannelRole(param: { channel_id: string; type: 'role_id'; value?: string; allow?: number; deny?: number }): Promise<{ + role_id: string allow: number deny: number }> From c1accca42e2dbedeb40fd20da88d0e0c2d1507ff Mon Sep 17 00:00:00 2001 From: MODcraft Date: Sun, 2 Apr 2023 01:44:22 +0800 Subject: [PATCH 5/5] conflix --- adapters/kook/src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adapters/kook/src/types.ts b/adapters/kook/src/types.ts index f6363824..06591a4a 100644 --- a/adapters/kook/src/types.ts +++ b/adapters/kook/src/types.ts @@ -480,7 +480,7 @@ Internal.define('getMessageReactionList', 'GET', '/message/reaction-list') Internal.define('addMessageReaction', 'POST', '/message/add-reaction') Internal.define('deleteMessageReaction', 'POST', '/message/delete-reaction') -Internal.define('getChannelUserList', 'GET', '/channel-user/get-joined-channel') +Internal.define('getChannelJoinedUserList', 'GET', '/channel-user/get-joined-channel') Internal.define('getPrivateChatList', 'GET', '/user-chat/list') Internal.define('getPrivateChatView', 'GET', '/user-chat/view')