feat(github_parser): 添加GitHub仓库信息查询功能

- 新增github_parser插件,支持通过命令或自动解析链接查询GitHub仓库信息
- 添加github_repo.html模板用于渲染仓库信息图片
- 优化图片管理器支持高质量截图和CSS缩放
- 重构消息事件类权限常量定义方式
- 更新帮助页面样式为三列布局并优化响应式设计
This commit is contained in:
2026-01-20 18:33:46 +08:00
parent 1ec066c9cb
commit 5f943c1792
6 changed files with 526 additions and 51 deletions

200
templates/github_repo.html Normal file
View File

@@ -0,0 +1,200 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GitHub仓库信息</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap');
body {
font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
margin: 0;
padding: 0;
color: #ffffff;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.container {
max-width: 100%;
width: 100%;
height: 100vh;
margin: 0;
padding: 60px;
background-color: rgba(26, 26, 46, 0.95);
border-radius: 0;
box-shadow: none;
border: none;
backdrop-filter: blur(10px);
display: flex;
flex-direction: column;
justify-content: center;
}
.repo-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 80px;
}
.repo-info {
flex: 1;
}
.repo-title {
font-size: 28px;
font-weight: 700;
color: #00d4ff;
margin: 0 0 24px 0;
text-transform: uppercase;
letter-spacing: 2.5px;
}
.repo-full-name {
font-size: 72px;
font-weight: 900;
color: #ffffff;
margin: 0 0 30px 0;
line-height: 1.1;
}
.repo-description {
font-size: 32px;
color: #ffffff;
margin: 0 0 36px 0;
line-height: 1.6;
}
.owner-avatar {
width: 240px;
height: 240px;
border-radius: 50%;
margin-left: 80px;
object-fit: cover;
border: 5px solid #00d4ff;
box-shadow: 0 12px 36px rgba(0, 212, 255, 0.5);
}
.stats-container {
display: flex;
justify-content: space-between;
gap: 40px;
margin-top: 80px;
padding-top: 40px;
border-top: 3px solid rgba(15, 52, 96, 0.8);
}
.stat-item {
text-align: center;
flex: 1;
min-width: 180px;
}
.stat-number {
font-size: 96px;
font-weight: 900;
color: #00d4ff;
display: block;
line-height: 1;
}
.stat-label {
font-size: 24px;
color: #ffffff;
margin-top: 16px;
text-transform: uppercase;
letter-spacing: 1.5px;
font-weight: 600;
}
.footer {
margin-top: 100px;
padding-top: 40px;
border-top: 3px solid rgba(15, 52, 96, 0.8);
text-align: center;
}
.bot-info {
font-size: 30px;
color: rgba(0, 212, 255, 1);
font-weight: 700;
text-transform: uppercase;
letter-spacing: 4px;
}
@media (max-width: 768px) {
body {
padding: 0;
}
.container {
padding: 20px;
}
.repo-header {
flex-direction: column;
align-items: center;
}
.owner-avatar {
margin-left: 0;
margin-bottom: 24px;
width: 160px;
height: 160px;
}
.repo-title {
font-size: 20px;
text-align: center;
}
.repo-full-name {
font-size: 48px;
text-align: center;
}
.repo-description {
text-align: center;
font-size: 24px;
}
.stats-container {
flex-direction: column;
gap: 20px;
}
.stat-item {
margin-bottom: 20px;
}
.stat-number {
font-size: 64px;
}
.stat-label {
font-size: 20px;
}
.bot-info {
font-size: 24px;
}
}
</style>
</head>
<body>
<div class="container">
<div class="repo-header">
<div class="repo-info">
<div class="repo-title">GitHub Repository</div>
<h1 class="repo-full-name">{{ full_name }}</h1>
<p class="repo-description">{{ description }}</p>
</div>
{% if owner_avatar %}
<img src="{{ owner_avatar }}" alt="Owner Avatar" class="owner-avatar">
{% endif %}
</div>
<div class="stats-container">
<div class="stat-item">
<span class="stat-number">{{ stargazers_count }}</span>
<div class="stat-label">Stars</div>
</div>
<div class="stat-item">
<span class="stat-number">{{ forks_count }}</span>
<div class="stat-label">Forks</div>
</div>
<div class="stat-item">
<span class="stat-number">{{ open_issues_count }}</span>
<div class="stat-label">Issues</div>
</div>
<div class="stat-item">
<span class="stat-number">{{ watchers_count }}</span>
<div class="stat-label">Watchers</div>
</div>
</div>
<div class="footer">
<div class="bot-info">by CalglauBOT</div>
</div>
</div>
</body>
</html>