-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot_v1-1.js
72 lines (70 loc) · 3.4 KB
/
bot_v1-1.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
const { Bot } = require('grammy')
const bot = new Bot('1935343602:AAFofE4L6Or_vt4Zq_DY1ON3vY4IHiXD7-o')
const { need,hi,no,thanks,quality,quality_prompt,terms,fine,cmdbot,no_prompt1,no_prompt2,thanks_prompt,need_prompt,terms_prompt,happy_stickers,hi_stickers,no_stickers,need_stickers,fast } = require('./variables.js')
var fileid
bot.on("message:text",async (ctx)=>{
msg=" "+ctx.message.text
if(hi.some(word=>msg.toString().toLowerCase().includes(word))){
ctx.reply("Hi There. How are You doing "+ctx.from.first_name,{
reply_to_message_id:ctx.message.message_id
})
fileid=fileId(hi_stickers)
await ctx.replyWithSticker(fileid)
}
else if(need.some(word=>msg.toString().toLowerCase().includes(word))){
ctx.reply(need_prompt,{
reply_to_message_id:ctx.message.message_id
})
fileid=fileId(need_stickers)
await ctx.replyWithSticker(fileid)
}
else if(thanks.some(word=>msg.toString().toLowerCase().includes(word))){
ctx.reply(thanks_prompt)
fileid=fileId(happy_stickers)
await ctx.replyWithSticker(fileid)
}
else if(fine.some(word=>msg.toString().toLowerCase().includes(word))){
ctx.reply("Oh Great I am fine too "+ctx.from.first_name +". Well Request your movie and we will get you your movie(it may take a while)")
}
else if(cmdbot.some(word=>msg.toString().toLowerCase().includes(word))){
ctx.reply("No I am not.I am feeling better than ever "+ctx.from.first_name+".Guys Please don't spread rumours.")
await ctx.replyWithSticker("CAACAgUAAxkBAAELkfVhCJGFHbSleaC19FsNHreRSl9gpgACgQAD77YjLKBbOuNhBKAyIAQ")
}
else if(no.some(word=>msg.toString().toLowerCase().includes(word))){
ctx.replyWithSticker("CAACAgUAAxkBAAEKSPlgmhIiZooyu3g7tIp12oRUQBal5wACqwAD77YjLE7OMknP0pIhHwQ")
await ctx.reply(no_prompt1+ctx.from.first_name+no_prompt2)
}
else if(terms.some(word=>msg.toString().toLowerCase().includes(word))){
ctx.reply(terms_prompt,{
reply_to_message_id:ctx.message.message_id
})
}
else if(quality.some(word=>msg.toString().toLowerCase().includes(word))){
ctx.reply(quality_prompt,{
reply_to_message_id:ctx.message.message_id
})
}
else if(fast.some(word=>msg.toString().toLowerCase().includes(word))){
ctx.reply("Varum ana varaathu.")
await ctx.replyWithSticker("CAACAgUAAxkBAAELke9hCI-DixYiGvDTai7XzDfpNvbpBwAChgAD77YjLLFu0Hf8jh7ZIAQ")
}
})
bot.on("message:new_chat_members",async (ctx)=>{
ctx.reply("Hi "+ctx.from.first_name+". Welcome to Movie Holics.Request your movies with correct name")
ctx.reply("Welcome "+ctx.from.first_name+". You can request your movies.And kindly agree to our T&C. "+terms_prompt,{
reply_to_message_id:ctx.message.message_id
})
fileid=fileId(hi_stickers)
await ctx.replyWithSticker(fileid)
})
bot.on("message:left_chat_member",(ctx)=>{
ctx.reply("Good Bye "+ctx.from.last_name+" .")
})
bot.on("edited_message",async (ctx)=>{
ctx.replyWithSticker("CAACAgIAAxkBAAELjw1hCC9fGMZhHnzStiJu9kePbhyRpgAC8gYAAkb7rASw5ylYz5DqKSAE")
await ctx.reply("Yaarum Paakalanu nenachu "+ctx.from.first_name+" yetho panitan")
})
function fileId(sticker_set) {
return sticker_set[Math.floor(Math.random()*sticker_set.length)]
}
bot.start()