Skip to content
This repository was archived by the owner on Oct 21, 2023. It is now read-only.
This repository was archived by the owner on Oct 21, 2023. It is now read-only.

Couldn't run on Now. No error and No result #22

@mortezae

Description

@mortezae

Hello. I'm struggling with a micro-bot setup on Zeit Now and tried many different configs but get no result. I'm newbie on both Now and Telegraf, BTW I can run a simple echo web server on the same Now project but no success with bot code. It doesn't give any error when deploying and bot doesn't work at all. I don't know where I went wrong
This is all the code and files:

index.js: I used different codes such as this simple lines

const { mount, reply } = require('micro-bot')
module.exports = mount('sticker', reply('👍'))

packages.json

{
  "name": "mybot",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "start": "micro-bot -t ${BOT_TOKEN} -d ${NOW_URL} index.js"
  },
  "dependencies": {
    "micro-bot": "^2.5.3"
  }
}

now.json

{
    "version": 2,
    "name": "mybot",
    "builds": [
        { "src": "*.js", "use": "@now/node" }
    ],
}

And my deploy command:

now -e BOT_TOKEN='828040278:AAG-NPbrdM5LkIUA1V5tbNxpA-yxemh5Cdc'

I don't know if the bot automatically sets Webhook, so I did it manually. https://api.telegram.org/botMYTOKEN/setWebhook?url=https://projecturl.me.now.sh

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions