Skip to content

Commit

Permalink
feat(shell): satori: implement field in resource Login
Browse files Browse the repository at this point in the history
  • Loading branch information
ilharp committed Aug 23, 2024
1 parent 183bf7f commit ab26d18
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 0 deletions.
43 changes: 43 additions & 0 deletions packages/engine-chronocat-api/src/api/login/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,49 @@ export const buildLoginGet = (ctx: ChronocatContext) => async () => {
self_id: authData.uin,
platform: ctx.chronocat.platform,
status: 1, // LoginStatus.ONLINE,
features: [
'channel.get',
'channel.list',
'channel.create',
'channel.update',
'channel.delete',
'unsafe.channel.mute',
'unsafe.channel.member.mute',
'user.channel.create',
'guild.get',
'guild.list',
'guild.approve',
'unsafe.guild.remove',
'guild.member.get',
'guild.member.list',
'guild.member.kick',
'guild.member.approve',
'guild.member.mute',
'guild.member.role.set',
'guild.member.role.unset',
'chronocat.guild.member.title.set',
'guild.role.list',
'guild.role.create',
'guild.role.update',
'guild.role.delete',
'login.get',
'message.create',
'message.get',
'message.delete',
'message.update',
'message.list',
'reaction.create',
'reaction.delete',
'reaction.clear',
'reaction.list',
'user.get',
'friend.list',
'friend.approve',
'unsafe.friend.remove',
'chronocat.putongdejiekou1',
'guild.plain',
],
proxy_urls: [],
}

return result
Expand Down
43 changes: 43 additions & 0 deletions packages/shell/src/satori/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,49 @@ export const initSatoriServer = async (
self_id: uin,
platform: PLATFORM,
status: LoginStatus.ONLINE,
features: [
'channel.get',
'channel.list',
'channel.create',
'channel.update',
'channel.delete',
'unsafe.channel.mute',
'unsafe.channel.member.mute',
'user.channel.create',
'guild.get',
'guild.list',
'guild.approve',
'unsafe.guild.remove',
'guild.member.get',
'guild.member.list',
'guild.member.kick',
'guild.member.approve',
'guild.member.mute',
'guild.member.role.set',
'guild.member.role.unset',
'chronocat.guild.member.title.set',
'guild.role.list',
'guild.role.create',
'guild.role.update',
'guild.role.delete',
'login.get',
'message.create',
'message.get',
'message.delete',
'message.update',
'message.list',
'reaction.create',
'reaction.delete',
'reaction.clear',
'reaction.list',
'user.get',
'friend.list',
'friend.approve',
'unsafe.friend.remove',
'chronocat.putongdejiekou1',
'guild.plain',
],
proxy_urls: [],
}

ws.send(
Expand Down
10 changes: 10 additions & 0 deletions packages/shell/src/satori/types/satoriEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,16 @@ export interface Login {
* 在线状态
*/
status: LoginStatus

/**
* 平台特性列表
*/
features: string[]

/**
* 代理路由列表
*/
proxy_urls: string[]
}

export enum LoginStatus {
Expand Down

0 comments on commit ab26d18

Please sign in to comment.