Skip to content

Instantly share code, notes, and snippets.

@headStyleColorRed
Last active August 16, 2021 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save headStyleColorRed/2d90b56da084e32eb0592b7fa5b91dfa to your computer and use it in GitHub Desktop.
Save headStyleColorRed/2d90b56da084e32eb0592b7fa5b91dfa to your computer and use it in GitHub Desktop.
MEDIUM Missing telegram server
// Modules
const MichaelBot = require("./botLogic.js")
[. . . ]
// ++++++++++++++++ HTTP METHODS +++++++++++++++++++ //
[. . . ]
app.post("/send_message", async (req, res) => {
let body = req.body
if (!body.message || !body.botId || !body.chatId) {
return res.send("Error: All fields are required")
}
let result = MichaelBot.sendMessage(body.message, body.botId, body.chatId)
res.send(result)
})
[. . . ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment