Browse Source

Initial Commit

master
Pavan Jadhaw 6 years ago
commit
813b7b655a
  1. 2
      .gitignore
  2. 14
      app.js
  3. 1
      index.js
  4. 57
      package-lock.json
  5. 16
      package.json

2
.gitignore

@ -0,0 +1,2 @@
config.js
node_modules

14
app.js

@ -0,0 +1,14 @@
const Telegraf = require('telegraf');
const config = require('./config')
const bot = new Telegraf(config.apiKey)
bot.command('start', ctx => {
return ctx.reply('Bot succesfully started!');
})
bot.hears('hi', ctx => {
return ctx.reply('Hey!, How are you?');
})
bot.startPolling();

1
index.js

@ -0,0 +1 @@
require('./app');

57
package-lock.json

@ -0,0 +1,57 @@
{
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"@types/node": {
"version": "10.5.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.2.tgz",
"integrity": "sha512-m9zXmifkZsMHZBOyxZWilMwmTlpC8x5Ty360JKTiXvlXZfBWYpsg9ZZvP/Ye+iZUh+Q+MxDLjItVTWIsfwz+8Q=="
},
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"requires": {
"ms": "2.0.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"node-fetch": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz",
"integrity": "sha1-q4hOjn5X44qUR1POxwb3iNF2i7U="
},
"sandwich-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/sandwich-stream/-/sandwich-stream-1.0.0.tgz",
"integrity": "sha1-eDDkV5e1kzKH8fmyj4cZB0ViYvI="
},
"telegraf": {
"version": "3.21.2",
"resolved": "https://registry.npmjs.org/telegraf/-/telegraf-3.21.2.tgz",
"integrity": "sha512-hstPgYodQZuPN3yEZp1FRfeawz7yxrLx0C7KYYz4v4BPF53PnWYTpbwl4bg+VCRf0B/YIN1dYo/wZVQIxTWArw==",
"requires": {
"@types/node": "^10.1.2",
"debug": "^3.0.0",
"node-fetch": "^2.0.0",
"sandwich-stream": "^1.0.0",
"telegram-typings": "^3.6.0",
"typescript": "^2.8.3"
}
},
"telegram-typings": {
"version": "3.6.1",
"resolved": "https://registry.npmjs.org/telegram-typings/-/telegram-typings-3.6.1.tgz",
"integrity": "sha512-njVv1EAhIZnmQVLocZEADYUyqA1WIXuVcDYlsp+mXua/XB0pxx+PKtMSPeZ/EE4wPWTw9h/hA9ASTT6yQelkiw=="
},
"typescript": {
"version": "2.9.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz",
"integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w=="
}
}
}

16
package.json

@ -0,0 +1,16 @@
{
"name": "telegram_bot_test",
"version": "1.0.1",
"description": "",
"main": "index.js",
"dependencies": {
"telegraf": "^3.21.2"
},
"devDependencies": {},
"scripts": {
"start": "node index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "MIT"
}
Loading…
Cancel
Save