Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(kook): Kook internal api #94

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions adapters/kook/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export default KookBot

declare global {
namespace Satori {
interface Session {
kook?: Kook.Payload & Kook.Internal
}

interface Events {
'kook/message-btn-click': {}
}
Expand Down
49 changes: 46 additions & 3 deletions adapters/kook/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -387,6 +387,49 @@ export interface Internal {
createGuildMute(param: { guild_id: string; user_id: string; type: GuildMute.Type }): Promise<void>
deleteGuildMute(param: { guild_id: string; user_id: string; type: GuildMute.Type }): Promise<void>
getGuildBoostHistory(param: { guild_id: string; start_time: number; end_time: number }): Promise<List<GuildBoost>>

getChannelList(param: { guild_id: string }): Promise<List<Channel>>
getChannelView(param: { target_id: string }): Promise<Channel>
createChannel(param: {
guild_id: string
parent_id?: string
name: string
type?: number
limit_amount?: number
voice_quality?: string
is_category?: 0|1
}): Promise<Channel>
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<Channel>
deleteChannel(param: { channel_id: string }): Promise<void>
getChannelUserList(param: { channel_id: string }): Promise<List<User>>
moveChannelUser(param: { target_id: string; user_ids: [] }): Promise<void>
getChannelRoleIndex(param: { channel_id: string }): Promise<{ permission_overwrites: Overwrite; permission_users: List<User>; permission_sync: 0 | 1 }>
createChannelRole(param: { channel_id: string; type?: 'user_id'; value?: string }): Promise<{
user_id: string
allow: number
deny: number
}>
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
}>
deleteChannelRole(param: { channel_id: string; type?: 'role_id' | 'user_id'; value?: string }): Promise<void>
}

export class Internal {
Expand Down Expand Up @@ -437,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')
Expand Down