diff --git a/delta/about.ts b/delta/about.ts
deleted file mode 100644
index e695119..0000000
--- a/delta/about.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { Composer, Context, InlineKeyboard } from "../deps.ts";
-import isPrivate from "../hooks/isPrivate.ts";
-import { reply } from "../utils/sender.ts";
-
-const composer = new Composer();
-
-export const message = `Hurmatli foydalanuvchi! \n` +
- `\n` +
- `Bizning botimiz aktiv tarzda shakllantirib boriladi. ` +
- `Buning ustida esa bir necha avtor va dasturchilar turadi, ` +
- `ushbu havolalar orqali bizning sinovchilarimizdan biriga aylaning ` +
- `va biz bilan botimiz, hamda guruhimiz ishlatish qulayligini oshiring.`;
-
-export const keyboard = new InlineKeyboard().url(
- `Ochiq Havolalar`,
- `https://github.com/rust-lang-uz/rustina`,
-);
-
-composer.command("about", isPrivate, async (ctx: Context): Promise => {
- await reply(ctx, message, keyboard);
-});
-
-export default composer;
diff --git a/delta/help.ts b/delta/help.ts
deleted file mode 100644
index a3f3034..0000000
--- a/delta/help.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import { Composer, Context } from "../deps.ts";
-import * as start from "./start.ts";
-import { reply } from "../utils/sender.ts";
-
-const composer = new Composer();
-
-export const message = `Mavjud komandalar ro'yxati:` +
- `\n` +
- `\n` +
- `/doc - reply qilingan odamga dok borligi haqida eslatish
` +
- `\n` +
- `/useful - rust haqida foydali yoki kerakli ma'lumotlar
` +
- `\n` +
- `/last - eng oxirgi reliz haqida qisqacha ma'lumot
` +
- `\n` +
- `/version - biron anniq reliz haqida to'liq ma'lumot
` +
- `\n` +
- `/off - reply qilingan odamga offtop borligi haqida eslatish
` +
- `\n` +
- `/nometa - to'g'ri savol berish haqida eslatma
` +
- `\n` +
- `/group - rust ga oid guruh va hamjamiyatlar
` +
- `\n` +
- `/help - ushbu xabarni qayta ko'rsatish
` +
- `\n` +
- `/about - ushbu botimizning rivojlantirish qismi
` +
- `\n` +
- `/rules - qoidalarni aks ettirish
` +
- `\n` +
- `/which - ushbu guruh va foydalanuvchi metrik ma'lumotlarini ko'rsatish
`;
-export const keyboard = start.keyboard;
-
-composer.command("help", async (ctx: Context): Promise => {
- await reply(ctx, message, keyboard);
-});
-
-export default composer;
diff --git a/delta/rules.ts b/delta/rules.ts
deleted file mode 100644
index dc2e4de..0000000
--- a/delta/rules.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { Composer, Context, InlineKeyboard } from "../deps.ts";
-import isPrivate from "../hooks/isPrivate.ts";
-import { reply } from "../utils/sender.ts";
-
-const composer = new Composer();
-
-export const message = `Hurmatli guruh a'zosi... ` +
- `\n` +
- `\n` +
- `Iltimos qoidalarga oz bo'lsada vaqt ajratishni unutmang, bu muhim! Ushbu guruhda quyidagi harakatlar taqiqlanadi:` +
- `\n` +
- `\n` +
- `* Besabab bir-birini kamsitish yoki so'kinish
` +
- `\n` +
- `* Sababsiz guruhga spam yozaverish yoki tashash
` +
- `\n` +
- `* So'ralgan narsani yana qayta ezmalash
` +
- `\n` +
- `* Administratorlarga nisbatan juddayam qattiq kritika
` +
- `\n` +
- `* Faoliyat ustidan shikoyat qilaverish yoki nolish
` +
- `\n` +
- `\n` +
- `Ushbu qoidalarni doimiy tarzda buzish, butunlay ban yoki bir necha ogohlantirishlirga olib keladi!`;
-
-export const keyboard = new InlineKeyboard().url(
- `Guruhga qaytish`,
- `https://t.me/rustlanguz`,
-);
-
-composer.command("rules", isPrivate, async (ctx: Context): Promise => {
- await reply(ctx, message, keyboard);
-});
-
-export default composer;
diff --git a/delta/start.ts b/delta/start.ts
deleted file mode 100644
index a657435..0000000
--- a/delta/start.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { Composer, Context, InlineKeyboard } from "../deps.ts";
-import { reply } from "../utils/sender.ts";
-
-const composer = new Composer();
-
-export const message: string =
- `Assalomu alaykum, hurmatli Rustacean! \n` +
- `\n` +
- `Sizni ko'rib turganimdan bag'oyatda xursandman. ` +
- `Men O'zbek Rust jamiyati tomonidan yaratilgan bot hisoblanib, ` +
- `O'zbek Rust jamiyati foydalanuvchilari uchun foydali resurslarni yetkazish, saqlash va ` +
- `ularni saralash uchun xizmat qilaman.`;
-
-export const keyboard = new InlineKeyboard()
- .url("Jamiyat", "https://t.me/rustlanguz")
- .url("Web Sahifa", "https://rust-lang.uz");
-
-composer.command("start", async (ctx: Context): Promise => {
- await reply(ctx, message, keyboard);
-});
-
-export default composer;
diff --git a/src/functions/about.rs b/src/functions/about.rs
index 5519ff4..e1ef996 100644
--- a/src/functions/about.rs
+++ b/src/functions/about.rs
@@ -1,4 +1,4 @@
-use crate::utils::kbmng::Keyboard;
+use crate::{utils::kbmng::Keyboard, hooks};
use teloxide::{
payloads::SendMessageSetters,
prelude::*,
@@ -20,6 +20,13 @@ pub fn keyboard() -> InlineKeyboardMarkup {
}
pub async fn command(bot: &Bot, msg: &Message) -> ResponseResult<()> {
+ if !msg.chat.is_private() {
+ return {
+ hooks::is_private(bot, msg).await.unwrap();
+ Ok(())
+ }
+ }
+
bot.send_message(msg.chat.id, TEXT)
.parse_mode(ParseMode::Html)
.reply_markup(keyboard())