-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteclado_externo.js
52 lines (40 loc) · 1.91 KB
/
teclado_externo.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
require('dotenv').config({ path: '/home/alexandre/Dev/node/xande_bot/.env' });
const apiUrl = `https://api.telegram.org/bot/process.env.token`;
const apiFileUrl = `https://api.telegram.org/file/bot/process.env.token`;
const { Telegraf } = require('telegraf');
const axios = require('axios')
const moment = require('moment')
const Markup = require('telegraf/markup')
const bot = new Telegraf(process.env.token);
const tecladoOpcao = Markup.keyboard([
['⚙️Backend', '💻FrontEnd', '🥸Cybersecurity'],
['🤓CienciadeDados', '♾DevOps'],
]).resize()
const tecladoVagas = Markup.keyboard([
['📱Remotar', '📀Nerdin', '🖥Revelo'],
['🕹GeekHunter', '⚔️ProgramadorThor'],
]).resize()
bot.start(async ctx => {
await ctx.reply(`Seja bem vindo, ${ctx.update.message.from.first_name}!`)
await ctx.reply(`Escolha uma opção`,
Markup.keyboard(['Cursos', 'Vagas']).resize().oneTime())
})
bot.hears('Vagas', ctx => ctx.reply('Show', tecladoVagas))
bot.hears('Remotar', ctx => ctx.reply('https://remotar.com.br/'))
bot.hears('Nerdin', ctx => ctx.reply('https://nerdin.com.br/'))
bot.hears('Revelo', ctx => ctx.reply('https://www.revelo.com.br/'))
bot.hears('GeekHunter', ctx => ctx.reply('https://www.geekhunter.com.br/'))
bot.hears('ProgramadorThor', ctx => ctx.reply('https://programathor.com.br/'))
bot.hears('Cursos', ctx => ctx.reply('Legal', tecladoOpcao))
bot.hears('Backend', ctx => ctx.reply('https://bit.ly/4aTbopa'))
bot.hears('FrontEnd', ctx => ctx.reply('https://bit.ly/3Ub94o1'))
bot.hears('Cybersecurity', ctx => ctx.reply('https://bit.ly/3Ugm1gk'))
bot.hears('CienciadeDados', ctx => ctx.reply('https://bit.ly/3Ueobx3'))
bot.hears('DevOps', ctx => ctx.reply('https://bit.ly/49A7pN6'))
bot.on('text', (ctx) => {
const text = ctx.message.text.toLowerCase();
if ((text === 'vagas') || (text === 'cursos')){
ctx.reply('Legal!', tecladoVagas);
}
});
bot.startPolling()