-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.ts
81 lines (65 loc) · 1.93 KB
/
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
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
73
74
75
76
77
78
79
80
81
import { Bot } from "https://deno.land/x/[email protected]/mod.ts";
import { Composer, Context, InlineKeyboard,NextFunction } from "./deps.ts";
import 'https://deno.land/x/[email protected]/load.ts';
const bot = new Bot(Deno.env.get('BOT_TOKEN')!);
bot.command("about", (ctx) => {
ctx.reply("Bu bot <b>TUIT TEAM</b> boti hisoblanadi", {
parse_mode: "HTML",
});
});
export const message = `<b>Hurmatli guruh a'zosi...</b> ` +
`\n` +
`\n` +
`Iltimos qoidalarga oz bo'lsada vaqt ajratishni unutmang, bu muhim! Ushbu guruhda quyidagi harakatlar taqiqlanadi:` +
`\n` +
`\n` +
`<code>* Besabab bir-birini kamsitish yoki so'kinish</code>` +
`\n` +
`<code>* Sababsiz guruhga spam yozaverish yoki tashash</code>` +
`\n` +
`<code>* So'ralgan narsani yana qayta ezmalash</code> ` +
`\n` +
`<code>* Administratorlarga nisbatan juddayam qattiq kritika</code>` +
`\n` +
`<code>* Faoliyat ustidan shikoyat qilaverish yoki nolish</code>` +
`\n` +
`\n` +
`<b>Ushbu qoidalarni doimiy tarzda buzish, butunlay ban yoki bir necha ogohlantirishlirga olib keladi!</b>`;
export const keyboar = new InlineKeyboard().url(
`Guruhga qaytish`,
`https://t.me/tatu_tuit_hub`,
);
bot.command("rules", async (ctx) => {
await ctx.reply(message, {
parse_mode: "HTML",
reply_markup: keyboar,
});
});
export const keyboard = new InlineKeyboard().url(
"TEAM",
"https://t.me/tatu_tuit_hub"
);
bot.command("start", (ctx) => {
ctx.reply(
`Assalamu alaykum ${
ctx!.from!.first_name
} <b>TUIT TEAM </b> ga xush kelibsiz`,
{
parse_mode: "HTML",
reply_markup: keyboard,
}
);
});
bot.on("message:text", async (ctx) => {
if (ctx?.message?.from?.username) {
if (
ctx?.message?.from?.username === "Channel_Bot"
) {
await ctx.deleteMessage()
}
}
})
bot.on("channel_post", (ctx) => {
console.log("Type:", ctx.chat!.type, " with ID of:", ctx.chat!.id);
})
bot.start();