-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtelegram-bot.ts
34 lines (24 loc) · 1.14 KB
/
telegram-bot.ts
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
import { Markup, Telegraf } from 'telegraf'
const bot = new Telegraf(process.env.BOT_TOKEN!)
const WEB_APP_URL = 'https://nshnas.ir'
const START_MESSAGE = `به ربات ناشناس امن خوش اومدی ⚡️
ما توی این ربات تمام مکالمات رو با ترکیب الگوریتمهای RSA و AES رمزنگاری میکنیم تا کسی جز خودت به دادهها دسترسی نداشته باشه.
کد ربات به صورت اوپنسورس روی گیتهاب هست، حتی می تونی خودت توی امن کردنش مشارکت کنی ^^🌱`
const SEND_MESSAGE = (username: string) =>
`الان داری به کاربر ${username} پیام میفرستی`
bot.start((ctx) => {
const query = ctx.update.message.text.split(' ')
if (query.length === 2) {
return ctx.reply(
SEND_MESSAGE(query[1]),
Markup.inlineKeyboard([
Markup.button.webApp('ورود به ربات', `${WEB_APP_URL}/@${query[1]}`),
]),
)
}
ctx.reply(
START_MESSAGE,
Markup.inlineKeyboard([Markup.button.webApp('ورود به ربات', WEB_APP_URL)]),
)
})
bot.launch()