mirror of
https://github.com/pompurin404/mihomo-party.git
synced 2024-11-16 03:32:17 +08:00
adjust telegram notification
This commit is contained in:
parent
323c0e12d0
commit
e5265d25ed
|
@ -4,7 +4,7 @@ import { readFileSync } from 'fs'
|
||||||
const pkg = readFileSync('package.json', 'utf-8')
|
const pkg = readFileSync('package.json', 'utf-8')
|
||||||
const changelog = readFileSync('changelog.md', 'utf-8')
|
const changelog = readFileSync('changelog.md', 'utf-8')
|
||||||
const { version } = JSON.parse(pkg)
|
const { version } = JSON.parse(pkg)
|
||||||
let content = `<b>🌟Mihomo Party v${version} 正式发布</b>\n\n`
|
let content = `<b>🌟 <a href="https://github.com/pompurin404/mihomo-party/releases/tag/v${version}">Mihomo Party v${version}</a> 正式发布</b>\n\n`
|
||||||
for (const line of changelog.split('\n')) {
|
for (const line of changelog.split('\n')) {
|
||||||
if (line.length === 0) {
|
if (line.length === 0) {
|
||||||
content += '\n'
|
content += '\n'
|
||||||
|
@ -17,31 +17,10 @@ for (const line of changelog.split('\n')) {
|
||||||
axios.post(`https://api.telegram.org/bot${process.env.TELEGRAM_BOT_TOKEN}/sendMessage`, {
|
axios.post(`https://api.telegram.org/bot${process.env.TELEGRAM_BOT_TOKEN}/sendMessage`, {
|
||||||
chat_id: '@mihomo_party_channel',
|
chat_id: '@mihomo_party_channel',
|
||||||
text: content,
|
text: content,
|
||||||
parse_mode: 'HTML',
|
link_preview_options: {
|
||||||
reply_markup: {
|
is_disabled: false,
|
||||||
inline_keyboard: [
|
url: 'https://github.com/pompurin404/mihomo-party',
|
||||||
[
|
prefer_large_media: true
|
||||||
{
|
},
|
||||||
text: '官方群组',
|
parse_mode: 'HTML'
|
||||||
url: 'https://t.me/mihomo_party'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '官方频道',
|
|
||||||
url: 'https://t.me/mihomo_party_channel'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
text: '官方文档',
|
|
||||||
url: 'https://mihomo.party'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
text: '前往下载',
|
|
||||||
url: `https://github.com/pompurin404/mihomo-party/releases/tag/v${version}`
|
|
||||||
}
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user