forked from felixbogen/Telegram-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cc.js
32 lines (28 loc) · 934 Bytes
/
cc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
var lookup = require('binlookup')();
const { Telegraf } = require('telegraf')
require('dotenv').config({ path: '/Users/felix/Developer/Telegram Bot/env' })
const token = process.env.API_KEY
const bot = new Telegraf(token)
bot.start((ctx) => ctx.reply('Welcome, type CC (uppercase) than the card number (no spaces)'))
bot.help((ctx) => ctx.reply('CC xxxxxxxxxxxxxxx'))
bot.hears('Error', (ctx) => ctx.reply('/help'))
bot.hears(/CC (.+)/, async (ctx) => {
const cardnumber = ctx.match[1];
lookup(cardnumber, function( err, data ){
if (err)
ctx.reply('Error')
ctx.reply(`
***********${data.type} Card**********
Sheme: ${data.scheme}
Brand: ${data.brand}
Emoji: ${data.country.emoji}
Country: ${data.country.name}
Currency: ${data.country.currency}
Bank: ${data.bank.name}
BankUrl: ${data.bank.url}
Phone: ${data.bank.phone}
lat: ${data.country.latitude}
long: ${data.country.longitude}`)
})
})
bot.launch()