Last active
December 15, 2023 10:24
-
-
Save Maxim-Kolmogorov/5a1ab67150f3fd0a7556752fec59aa87 to your computer and use it in GitHub Desktop.
Telegram Bot (part 1)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios' | |
export default eventHandler(async () => { | |
const reqResult = await axios | |
.get(`https://api.telegram.org/bot@token@/getUpdates`) | |
.then((res) => { | |
if (!res.data) { return [] } | |
return res.data.result | |
}) | |
return { bot: reqResult } | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment