diff --git a/server/plugins/com.msgbyte.github/services/subscribe.service.ts b/server/plugins/com.msgbyte.github/services/subscribe.service.ts index 6138005b..985cbef3 100644 --- a/server/plugins/com.msgbyte.github/services/subscribe.service.ts +++ b/server/plugins/com.msgbyte.github/services/subscribe.service.ts @@ -228,6 +228,16 @@ class GithubSubscribeService extends TcService { } await this.sendMessageToSubscribes(ctx, repo, message); + } else if ('starred_at' in event) { + if (event.action === 'created') { + const name = event.sender.login; + const userUrl = event.sender.html_url; + const repo = event.repository.full_name; + const repoUrl = event.repository.html_url; + const repoStarCount = event.repository.stargazers_count; + const message = `[url=${userUrl}]${name}[/url] starred [url=${repoUrl}]${repo}[/url](total ${repoStarCount} stargazers)`; + await this.sendMessageToSubscribes(ctx, repo, message); + } } } diff --git a/server/plugins/com.msgbyte.github/web/plugins/com.msgbyte.github/src/GroupSubscribePanel/index.tsx b/server/plugins/com.msgbyte.github/web/plugins/com.msgbyte.github/src/GroupSubscribePanel/index.tsx index 648c3305..2584c1c6 100644 --- a/server/plugins/com.msgbyte.github/web/plugins/com.msgbyte.github/src/GroupSubscribePanel/index.tsx +++ b/server/plugins/com.msgbyte.github/web/plugins/com.msgbyte.github/src/GroupSubscribePanel/index.tsx @@ -1,14 +1,19 @@ import React, { useCallback, useMemo } from 'react'; import { - openModal, - closeModal, useGroupIdContext, useAsyncRefresh, useAsyncRequest, getServiceUrl, useGroupPanelInfo, } from '@capital/common'; -import { Button, CopyableText, Space, Table } from '@capital/component'; +import { + openModal, + closeModal, + Button, + CopyableText, + Space, + Table, +} from '@capital/component'; import { Translate } from '../translate'; import { AddGroupSubscribeModal } from './AddGroupSubscribeModal'; import { request } from '../request';