Merge branch 'master' of https://github.com/tyanbiao/txc-webhooks
This commit is contained in:
commit
5205ba8bab
@ -56,4 +56,4 @@ async function main(req: VercelRequest, res: VercelResponse) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default main
|
export default main
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import fetch from 'node-fetch'
|
import fetch from 'node-fetch'
|
||||||
|
|
||||||
export async function sendToTelegram(text: string) {
|
export async function sendToTelegram(text: string) {
|
||||||
const URL = `https://api.telegram.org/bot${process.env.TELEGRAM_TOKEN}/sendMessage`
|
const URL = `https://api.telegram.org/bot${process.env.TELEGRAM_TOKEN}/sendMessage`
|
||||||
const body = `chat_id=${process.env.TELEGRAM_CHAT_ID}&text=${text}`
|
const body = `chat_id=${process.env.TELEGRAM_CHAT_ID}&text=${text}`
|
||||||
@ -13,4 +14,4 @@ export async function sendToTelegram(text: string) {
|
|||||||
if (!data.ok) {
|
if (!data.ok) {
|
||||||
console.error(data.StatusMessage)
|
console.error(data.StatusMessage)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user