Skip to content

Commit

Permalink
feat: add bot tag in group/dm user popover
Browse files Browse the repository at this point in the history
  • Loading branch information
moonrailgun committed Feb 23, 2024
1 parent 53a05cb commit 1359b6e
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 1 deletion.
2 changes: 2 additions & 0 deletions client/shared/i18n/langs/en-US/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
"k7437914b": "Panel Group",
"k744ee9a": "Create Group",
"k74aef1ad": "Members",
"k74c146d3": "Openapi Bot",
"k74e53051": "Account authorization has expired, automatically jump to the login page after 2 seconds",
"k7640ae2a": "OTP is 6 digits",
"k76950a82": "Find friends faster with personal nicknames. Visible only to you.",
Expand Down Expand Up @@ -344,6 +345,7 @@
"kcefdbe2d": "Modify avatar success",
"kd0690a45": "Allow management of identity groups",
"kd080f2d7": "Reload",
"kd0a4e6a6": "Plugin Bot",
"kd0d594e4": "Distributed deployment can be used at any scale",
"kd1af615e": "Panel not found",
"kd28c05df": "Create Success",
Expand Down
2 changes: 2 additions & 0 deletions client/shared/i18n/langs/zh-CN/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
"k7437914b": "面板分组",
"k744ee9a": "创建群组",
"k74aef1ad": "成员",
"k74c146d3": "开放平台机器人",
"k74e53051": "账号授权已过期, 2秒后自动跳转到登录页",
"k7640ae2a": "OTP为6位数字",
"k76950a82": "使用个人昵称更快地找到好友。仅您自己可见。",
Expand Down Expand Up @@ -344,6 +345,7 @@
"kcefdbe2d": "修改头像成功",
"kd0690a45": "允许管理身份组",
"kd080f2d7": "重新加载",
"kd0a4e6a6": "插件机器人",
"kd0d594e4": "分布式部署可供任意规模的使用需求",
"kd1af615e": "面板不存在",
"kd28c05df": "创建成功",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ export const GroupUserPopover: React.FC<{
<Space size={4} wrap={true} className="py-1">
{groupInfo.owner === userId && <Tag color="gold">{t('创建者')}</Tag>}

{userInfo.type === 'openapiBot' && (
<Tag color="orange">{t('开放平台机器人')}</Tag>
)}

{userInfo.type === 'pluginBot' && (
<Tag color="orange">{t('插件机器人')}</Tag>
)}

{userInfo.temporary && <Tag color="processing">{t('游客')}</Tag>}

{roleNames.map((name) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ export const PersonalUserPopover: React.FC<{
</div>

<Space size={4} wrap={true} className="py-1">
{userInfo.type === 'openapiBot' && (
<Tag color="orange">{t('开放平台机器人')}</Tag>
)}

{userInfo.type === 'pluginBot' && (
<Tag color="orange">{t('插件机器人')}</Tag>
)}

{userInfo.temporary && <Tag color="processing">{t('游客')}</Tag>}
</Space>

Expand Down
7 changes: 6 additions & 1 deletion server/services/openapi/bot.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ class OpenBotService extends TcService {
}

got
.post(callbackUrl, { json: payload })
.post(callbackUrl, {
json: payload,
headers: {
'X-TC-Payload-Type': 'inbox',
},
})
.then(() => {
this.logger.info('调用机器人通知接口回调成功');
})
Expand Down

0 comments on commit 1359b6e

Please sign in to comment.