File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -8,19 +8,20 @@ export default {
8
8
try {
9
9
const body = await request . json ( )
10
10
11
- // 构建发送到 Telegram 的消息内容
12
11
let message = "Hello world"
13
12
if ( githubEvent === 'watch' ) {
14
13
message = makeMessage ( body )
15
14
}
16
15
17
- // 发送消息到 Telegram
16
+ // send message to Telegram
17
+ // api docs - https://core.telegram.org/bots/api#sendmessage
18
18
const telegramUrl = `https://api.telegram.org/bot${ env . TELEGRAM_TOKEN } /sendMessage`
19
19
20
20
const telegramPayload = {
21
21
chat_id : env . TELEGRAM_CHAT_ID ,
22
22
text : message ,
23
- parse_mode : "Markdown"
23
+ parse_mode : "Markdown" ,
24
+ link_preview_options : { is_disabled : true }
24
25
}
25
26
26
27
const telegramResponse = await fetch ( telegramUrl , {
@@ -54,7 +55,7 @@ function makeMessage(body) {
54
55
55
56
return `
56
57
New Github star for [${ repo } ](${ repoUrl } ) repo!
57
- The ${ repo } repo now has ${ stargazers_count } starts and ${ forks_count } forks!🎉
58
+ The * ${ repo } * repo now has * ${ stargazers_count } * starts and * ${ forks_count } * forks!🎉
58
59
Your new fan is [${ follwer } ](${ follwerUrl } )
59
60
`
60
61
}
You can’t perform that action at this time.
0 commit comments