Skip to content

Instantly share code, notes, and snippets.

@Maxim-Kolmogorov
Last active December 15, 2023 10:24
Show Gist options
  • Save Maxim-Kolmogorov/5a1ab67150f3fd0a7556752fec59aa87 to your computer and use it in GitHub Desktop.
Save Maxim-Kolmogorov/5a1ab67150f3fd0a7556752fec59aa87 to your computer and use it in GitHub Desktop.
Telegram Bot (part 1)
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