diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
deleted file mode 100644
index a206208..0000000
--- a/.github/workflows/test.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-name: Test CI
-
-on: [push, pull_request]
-
-jobs:
- lint:
- runs-on: ubuntu-latest
- steps:
- - name: Clone repository
- uses: actions/checkout@v2
- with:
- submodules: false
- persist-credentials: false
-
- - name: Set up Deno
- uses: denoland/setup-deno@v1
- with:
- deno-version: vx.x.x
-
- - name: Format
- run: deno fmt
-
- - name: Lint
- run: deno lint
diff --git a/.gitignore b/.gitignore
index 9135a54..9eb8abc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,4 @@
.env
-.idea
# Added by cargo
/target
diff --git a/core.ts b/core.ts
deleted file mode 100644
index 97f1ae1..0000000
--- a/core.ts
+++ /dev/null
@@ -1,71 +0,0 @@
-import { blue, Bot, serve, webhookCallback } from "./deps.ts";
-import "./utils/config.ts";
-import env from "./utils/config.ts";
-import delta from "./delta/mod.ts";
-import { Telegraph } from "./deps.ts";
-
-export const bot = new Bot(env["TOKEN"] || "");
-export const handle = webhookCallback(bot, "std/http");
-export const editor = new Telegraph({ accessToken: env["EDITOR"] });
-
-const initializer = async () => {
- await console.log(blue("[INFO]"), `bot is starting on ${env["HOST"]}`);
- await delta(bot);
- await bot.catch((error) => {
- console.log(error, error.ctx.api);
- });
-};
-
-const webhook = async () => {
- await console.log(blue("[INFO]"), `bot is starting on ${env["HOST"]}`);
- await serve(async (req) => {
- const url = new URL(req.url);
-
- if (req.method == "POST") {
- switch (url.pathname) {
- case "/bot":
- try {
- return await handle(req);
- } catch (err) {
- console.error(err);
- return new Response("Nope, not working...");
- }
- default:
- return new Response("What you're trying to post?");
- }
- }
-
- switch (url.pathname) {
- case "/webhook":
- try {
- await bot.api.setWebhook(`https://${url.hostname}/bot`);
- return new Response("Done. Set");
- } catch (_) {
- return new Response("Couldn't succeed with installing webhook");
- }
- default:
- return Response.redirect("https://t.me/rustinabot", 302);
- }
- });
-};
-
-const polling = async () => {
- await bot.start();
-};
-
-export const launch = async () => {
- switch (env["HOST"]) {
- case "WEBHOOK":
- await initializer();
- await webhook();
- break;
- case "POLLING":
- await initializer();
- await polling();
- break;
- default:
- throw new Error("Deploy method not validated!");
- }
-};
-
-await launch();
diff --git a/delta/mod.ts b/delta/mod.ts
deleted file mode 100644
index 793a25e..0000000
--- a/delta/mod.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { Bot } from "../deps.ts";
-import useful from "./useful.ts";
-
-export default async (bot: Bot) => {
- await bot
- .use(useful)
-};
diff --git a/delta/useful.ts b/delta/useful.ts
deleted file mode 100644
index 236b600..0000000
--- a/delta/useful.ts
+++ /dev/null
@@ -1,122 +0,0 @@
-import { Composer, Context, InlineKeyboard } from "../deps.ts";
-import {
- categories,
- Category,
- indexer,
- material,
- pager,
-} from "../utils/picker.ts";
-import { reply } from "../utils/sender.ts";
-
-const composer = new Composer();
-const ctxMainMenuText =
- "Rustga oid foydali materiallar:\nAgar o'zingizdan material qo'shmoqchi bo'lsangiz, bizni source.json ni yangilang!";
-
-composer.command("useful", async (ctx: Context): Promise => {
- const keyboard = new InlineKeyboard();
-
- for (const category of categories()) {
- keyboard.text(
- category.charAt(0).toUpperCase() + category.slice(1).replaceAll("_", " "),
- `category_${category}_1`,
- ).row();
- }
-
- await reply(ctx, ctxMainMenuText, keyboard, {
- disable_web_page_preview: true,
- });
-});
-
-composer.callbackQuery("useful", async (ctx: Context): Promise => {
- const keyboard = new InlineKeyboard();
-
- for (const category of categories()) {
- keyboard.text(
- category.charAt(0).toUpperCase() + category.slice(1).replaceAll("_", " "),
- `category_${category}_1`,
- ).row();
- }
-
- await ctx.editMessageText(ctxMainMenuText, {
- parse_mode: "HTML",
- reply_markup: keyboard,
- disable_web_page_preview: true,
- });
-});
-
-composer.callbackQuery(/^category_(.*)_(\d+)$/, async (ctx: Context) => {
- const page = Number(ctx.match![2]);
- const category = ctx.match![1] as Category;
- const keyboard = new InlineKeyboard();
-
- for (const material of pager(category, page)) {
- keyboard.text(
- material.name,
- `material_${page}_${category}_${indexer(category, material)}`,
- ).row();
- }
-
- if (pager(category, page - 1).length > 0) {
- keyboard.text(`⬅️ Oldingi`, `category_${category}_${page - 1}`);
- }
-
- if (pager(category, page + 1).length > 0) {
- keyboard.text(`Keyingi ➡️`, `category_${category}_${page + 1}`);
- }
-
- keyboard.row().text(`🔙 Orqaga`, `useful`);
-
- await ctx.editMessageText(
- `Siz hozirda ${
- category.charAt(0).toUpperCase() + category.slice(1).replaceAll("_", " ")
- } kategoriyasi ichida turibsiz.\n` +
- `Iltimos, keltirilgan materiallardan birini tanlang...`,
- {
- parse_mode: "HTML",
- reply_markup: keyboard,
- disable_web_page_preview: true,
- },
- );
-});
-
-composer.callbackQuery(/^material_(\d+)_(.*)_(\d+)$/, async (ctx: Context) => {
- const keyboard = new InlineKeyboard();
- const page = Number(ctx.match![1]);
- const cat = ctx.match![2] as Category;
- const index = Number(ctx.match![3]);
- const result = material(cat, index);
-
- if (result) {
- const data = result;
-
- if (data.link) {
- keyboard.url(`Web Sahifasi`, data.link);
- }
-
- keyboard.row().text(`🔙 Orqaga`, `category_${cat}_${page}`);
-
- await ctx.editMessageText(
- `${data.name}` +
- `\n` +
- `\n` +
- `${data.desc}` +
- `\n` +
- `\n` +
- `Ushbu pastdagi tugmacha orqali lavha ga o'tib oling:`,
- {
- parse_mode: "HTML",
- reply_markup: keyboard,
- },
- );
- } else {
- await ctx.editMessageText(`Ushbu material mavjud emas!`, {
- parse_mode: "HTML",
- reply_markup: new InlineKeyboard().text(
- `🔙 Orqaga`,
- `category_${cat}_${page}`,
- ),
- });
- }
-});
-
-export default composer;
diff --git a/deno.json b/deno.json
deleted file mode 100644
index ab4c52b..0000000
--- a/deno.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "fmt": {
- "exclude": [
- "all.json"
- ]
- }
-}
diff --git a/deno.lock b/deno.lock
deleted file mode 100644
index 3e074d1..0000000
--- a/deno.lock
+++ /dev/null
@@ -1,182 +0,0 @@
-{
- "version": "2",
- "remote": {
- "https://cdn.skypack.dev/-/@grammyjs/types@v2.6.0-cPMaGVlPbprnM8Sq7dE3/dist=es2019,mode=imports/optimized/@grammyjs/types.js": "fabf6997a3adf11e45d11e3c4d58d0634ab98f9d72f3116f3694123818ccd457",
- "https://cdn.skypack.dev/-/@grammyjs/types@v2.6.0-cPMaGVlPbprnM8Sq7dE3/dist=es2019,mode=types/api.d.ts": "8198d0f61fe0c0b35d824e10405d0b8a1d842b2e5339ef5dd6027e7b521c3047",
- "https://cdn.skypack.dev/-/@grammyjs/types@v2.6.0-cPMaGVlPbprnM8Sq7dE3/dist=es2019,mode=types/bot-command-scope.d.ts": "86c5f851bfb0eb1eddf0a309710de30c307b6c5fdaf7609b1fc455d72a2b750e",
- "https://cdn.skypack.dev/-/@grammyjs/types@v2.6.0-cPMaGVlPbprnM8Sq7dE3/dist=es2019,mode=types/callback.d.ts": "0b7f6c3625c80d894bf3733ada1380f7cd53e14dd9593394d584f00b6c1954c5",
- "https://cdn.skypack.dev/-/@grammyjs/types@v2.6.0-cPMaGVlPbprnM8Sq7dE3/dist=es2019,mode=types/index.d.ts": "9bdbddce52c91f61c478681eda997525cb028c561bb94ead0f799f4aafb49fc6",
- "https://cdn.skypack.dev/-/@grammyjs/types@v2.6.0-cPMaGVlPbprnM8Sq7dE3/dist=es2019,mode=types/inline.d.ts": "adde52500fd04693f88fecdcf069c3663954dd0baa644b9c78c1d8c8bec32559",
- "https://cdn.skypack.dev/-/@grammyjs/types@v2.6.0-cPMaGVlPbprnM8Sq7dE3/dist=es2019,mode=types/manage.d.ts": "194c5c7df20f9410f3cecf97110b608dc6491fe8c4182c38e53ca95ffec58df2",
- "https://cdn.skypack.dev/-/@grammyjs/types@v2.6.0-cPMaGVlPbprnM8Sq7dE3/dist=es2019,mode=types/message.d.ts": "89aa19a7621850406bbb2dbf8eb77e29581d55f1d26469646b0f03741ca7b2f4",
- "https://cdn.skypack.dev/-/@grammyjs/types@v2.6.0-cPMaGVlPbprnM8Sq7dE3/dist=es2019,mode=types/passport.d.ts": "ceeffb3c37c0843cf53049343473106327994415f8f6057e02bc904a2278c57a",
- "https://cdn.skypack.dev/-/@grammyjs/types@v2.6.0-cPMaGVlPbprnM8Sq7dE3/dist=es2019,mode=types/payment.d.ts": "163170c512d0f7bdd56dc6eb021c172fffcddb8e2742318e6f3973a27962e2d0",
- "https://cdn.skypack.dev/-/@grammyjs/types@v2.6.0-cPMaGVlPbprnM8Sq7dE3/dist=es2019,mode=types/proxied.d.ts": "7bbfd1f2431ec17f980b719568aeb6cde2dbbfcd67532149fe8b8933251dfec3",
- "https://cdn.skypack.dev/-/@grammyjs/types@v2.6.0-cPMaGVlPbprnM8Sq7dE3/dist=es2019,mode=types/update.d.ts": "73b0130f0a488e54f6537eac633fc5cad4b7e50fdcd620c82cc1776457930e4d",
- "https://cdn.skypack.dev/-/debug@v4.3.4-o4liVvMlOnQWbLSYZMXw/dist=es2019,mode=imports/optimized/debug.js": "671100993996e39b501301a87000607916d4d2d9f8fc8e9c5200ae5ba64a1389",
- "https://cdn.skypack.dev/-/ms@v2.1.2-giBDZ1IA5lmQ3ZXaa87V/dist=es2019,mode=imports/optimized/ms.js": "fd88e2d51900437011f1ad232f3393ce97db1b87a7844b3c58dd6d65562c1276",
- "https://cdn.skypack.dev/@grammyjs/types@v2.6.0?dts": "2871c1b8a348fcc9a3752158b2e2f9c618fe2ca9176edbaa9cf18454434f51db",
- "https://cdn.skypack.dev/debug@4.3.4": "7b1d010cc930f71b940ba5941da055bc181115229e29de7214bdb4425c68ea76",
- "https://cdn.skypack.dev/debug@^4.3.3": "7b1d010cc930f71b940ba5941da055bc181115229e29de7214bdb4425c68ea76",
- "https://deno.land/std@0.123.0/_util/assert.ts": "2f868145a042a11d5ad0a3c748dcf580add8a0dbc0e876eaa0026303a5488f58",
- "https://deno.land/std@0.123.0/_util/os.ts": "dfb186cc4e968c770ab6cc3288bd65f4871be03b93beecae57d657232ecffcac",
- "https://deno.land/std@0.123.0/async/deferred.ts": "ab60d46ba561abb3b13c0c8085d05797a384b9f182935f051dc67136817acdee",
- "https://deno.land/std@0.123.0/bytes/bytes_list.ts": "3bff6a09c72b2e0b1e92e29bd3b135053894196cca07a2bba842901073efe5cb",
- "https://deno.land/std@0.123.0/bytes/equals.ts": "69f55fdbd45c71f920c1a621e6c0865dc780cd8ae34e0f5e55a9497b70c31c1b",
- "https://deno.land/std@0.123.0/bytes/mod.ts": "fedb80b8da2e7ad8dd251148e65f92a04c73d6c5a430b7d197dc39588c8dda6f",
- "https://deno.land/std@0.123.0/io/buffer.ts": "8f10342821b81990acf859cdccb4e4031c7c9187a0ffc3ed6b356ee29ecc6681",
- "https://deno.land/std@0.123.0/io/types.d.ts": "89a27569399d380246ca7cdd9e14d5e68459f11fb6110790cc5ecbd4ee7f3215",
- "https://deno.land/std@0.123.0/path/_constants.ts": "1247fee4a79b70c89f23499691ef169b41b6ccf01887a0abd131009c5581b853",
- "https://deno.land/std@0.123.0/path/_interface.ts": "1fa73b02aaa24867e481a48492b44f2598cd9dfa513c7b34001437007d3642e4",
- "https://deno.land/std@0.123.0/path/_util.ts": "2e06a3b9e79beaf62687196bd4b60a4c391d862cfa007a20fc3a39f778ba073b",
- "https://deno.land/std@0.123.0/path/common.ts": "f41a38a0719a1e85aa11c6ba3bea5e37c15dd009d705bd8873f94c833568cbc4",
- "https://deno.land/std@0.123.0/path/glob.ts": "7bf2349e818e332a830f3d8874c3f45dd7580b6c742ed50dbf6282d84ab18405",
- "https://deno.land/std@0.123.0/path/mod.ts": "4465dc494f271b02569edbb4a18d727063b5dbd6ed84283ff906260970a15d12",
- "https://deno.land/std@0.123.0/path/posix.ts": "34349174b9cd121625a2810837a82dd8b986bbaaad5ade690d1de75bbb4555b2",
- "https://deno.land/std@0.123.0/path/separator.ts": "8fdcf289b1b76fd726a508f57d3370ca029ae6976fcde5044007f062e643ff1c",
- "https://deno.land/std@0.123.0/path/win32.ts": "11549e8c6df8307a8efcfa47ad7b2a75da743eac7d4c89c9723a944661c8bd2e",
- "https://deno.land/std@0.123.0/streams/conversion.ts": "7ff9af42540063fa72003ab31a377ba9dde8532d43b16329b933c37a6d7aac5f",
- "https://deno.land/std@0.123.0/streams/delimiter.ts": "25a35824fffaaf620f7304bf4522eb4fc8b205a9e98120e8956ea113ec6898aa",
- "https://deno.land/std@0.123.0/streams/merge.ts": "493cee5e547f6f0304d1891f3126701e707c0162f375b5bf26d8541b08e52c62",
- "https://deno.land/std@0.123.0/streams/mod.ts": "fb4b333ae079bfaefa7601ac4b6f591ab6ddfbdd47f5cb10f6280cfba892bf96",
- "https://deno.land/std@0.128.0/async/deadline.ts": "48ac998d7564969f3e6ec6b6f9bf0217ebd00239b1b2292feba61272d5dd58d0",
- "https://deno.land/std@0.128.0/async/debounce.ts": "564273ef242bcfcda19a439132f940db8694173abffc159ea34f07d18fc42620",
- "https://deno.land/std@0.128.0/async/deferred.ts": "bc18e28108252c9f67dfca2bbc4587c3cbf3aeb6e155f8c864ca8ecff992b98a",
- "https://deno.land/std@0.128.0/async/delay.ts": "cbbdf1c87d1aed8edc7bae13592fb3e27e3106e0748f089c263390d4f49e5f6c",
- "https://deno.land/std@0.128.0/async/mod.ts": "a28709190a1966cb50e5815ef269bb588ee192373cde73b1096641820dc52a36",
- "https://deno.land/std@0.128.0/async/mux_async_iterator.ts": "f4d1d259b0c694d381770ddaaa4b799a94843eba80c17f4a2ec2949168e52d1e",
- "https://deno.land/std@0.128.0/async/pool.ts": "97b0dd27c69544e374df857a40902e74e39532f226005543eabacb551e277082",
- "https://deno.land/std@0.128.0/async/tee.ts": "1341feb1f5b1a96f8628d0f8fc07d8c43d3813423f18a63bf1b4785568d21b1f",
- "https://deno.land/std@0.128.0/fmt/colors.ts": "4575bb20edc666d3ae75fa9fac75f20e4cd423b280008094b05e423cc85047bb",
- "https://deno.land/std@0.128.0/http/server.ts": "10c3a7814666cdbabd6f9c18acdcc4593e222275a628280a4868881445fbb5bc",
- "https://deno.land/std@0.184.0/_util/asserts.ts": "178dfc49a464aee693a7e285567b3d0b555dc805ff490505a8aae34f9cfb1462",
- "https://deno.land/std@0.184.0/_util/os.ts": "d932f56d41e4f6a6093d56044e29ce637f8dcc43c5a90af43504a889cf1775e3",
- "https://deno.land/std@0.184.0/async/deferred.ts": "42790112f36a75a57db4a96d33974a936deb7b04d25c6084a9fa8a49f135def8",
- "https://deno.land/std@0.184.0/bytes/bytes_list.ts": "31d664f4d42fa922066405d0e421c56da89d751886ee77bbe25a88bf0310c9d0",
- "https://deno.land/std@0.184.0/bytes/copy.ts": "939d89e302a9761dcf1d9c937c7711174ed74c59eef40a1e4569a05c9de88219",
- "https://deno.land/std@0.184.0/io/buffer.ts": "17f4410eaaa60a8a85733e8891349a619eadfbbe42e2f319283ce2b8f29723ab",
- "https://deno.land/std@0.184.0/path/_constants.ts": "e49961f6f4f48039c0dfed3c3f93e963ca3d92791c9d478ac5b43183413136e0",
- "https://deno.land/std@0.184.0/path/_interface.ts": "6471159dfbbc357e03882c2266d21ef9afdb1e4aa771b0545e90db58a0ba314b",
- "https://deno.land/std@0.184.0/path/_util.ts": "d7abb1e0dea065f427b89156e28cdeb32b045870acdf865833ba808a73b576d0",
- "https://deno.land/std@0.184.0/path/common.ts": "ee7505ab01fd22de3963b64e46cff31f40de34f9f8de1fff6a1bd2fe79380000",
- "https://deno.land/std@0.184.0/path/glob.ts": "d479e0a695621c94d3fd7fe7abd4f9499caf32a8de13f25073451c6ef420a4e1",
- "https://deno.land/std@0.184.0/path/mod.ts": "bf718f19a4fdd545aee1b06409ca0805bd1b68ecf876605ce632e932fe54510c",
- "https://deno.land/std@0.184.0/path/posix.ts": "8b7c67ac338714b30c816079303d0285dd24af6b284f7ad63da5b27372a2c94d",
- "https://deno.land/std@0.184.0/path/separator.ts": "0fb679739d0d1d7bf45b68dacfb4ec7563597a902edbaf3c59b50d5bcadd93b1",
- "https://deno.land/std@0.184.0/path/win32.ts": "d186344e5583bcbf8b18af416d13d82b35a317116e6460a5a3953508c3de5bba",
- "https://deno.land/std@0.184.0/streams/_common.ts": "f45cba84f0d813de3326466095539602364a9ba521f804cc758f7a475cda692d",
- "https://deno.land/std@0.184.0/streams/buffer.ts": "d5b3d7d0299114e5b2ea895a8bf202a687fd915c5282f8096c7bae23b5a04407",
- "https://deno.land/std@0.184.0/streams/byte_slice_stream.ts": "225d57263a34325d7c96cb3dafeb478eec0e6fd05cd0458d678752eadd132bb4",
- "https://deno.land/std@0.184.0/streams/copy.ts": "75cbc795ff89291df22ddca5252de88b2e16d40c85d02840593386a8a1454f71",
- "https://deno.land/std@0.184.0/streams/delimiter_stream.ts": "f69e849b3d1f59f02424497273f411105a6f76a9f13da92aeeb9a2d554236814",
- "https://deno.land/std@0.184.0/streams/early_zip_readable_streams.ts": "4005fa74162b943f79899e5d7cb96adcbc0a6b867f9144974ed12d30e0a556e1",
- "https://deno.land/std@0.184.0/streams/iterate_reader.ts": "bbec1d45c2df2c0c5920bad0549351446fdc8e0886d99e95959b259dbcdb6072",
- "https://deno.land/std@0.184.0/streams/limited_bytes_transform_stream.ts": "05dc592ffaab83257494d22dd53917e56243c26e5e3129b3f13ddbbbc4785048",
- "https://deno.land/std@0.184.0/streams/limited_transform_stream.ts": "d69ab790232c1b86f53621ad41ef03c235f2abb4b7a1cd51960ad6e12ee55e38",
- "https://deno.land/std@0.184.0/streams/merge_readable_streams.ts": "5d6302888f4bb0616dafb5768771be0aec9bedc05fbae6b3d726d05ffbec5b15",
- "https://deno.land/std@0.184.0/streams/mod.ts": "c07ec010e700b9ea887dc36ca08729828bc7912f711e4054e24d33fd46282252",
- "https://deno.land/std@0.184.0/streams/read_all.ts": "ee319772fb0fd28302f97343cc48dfcf948f154fd0d755d8efe65814b70533be",
- "https://deno.land/std@0.184.0/streams/readable_stream_from_iterable.ts": "cd4bb9e9bf6dbe84c213beb1f5085c326624421671473e410cfaecad15f01865",
- "https://deno.land/std@0.184.0/streams/readable_stream_from_reader.ts": "bfc416c4576a30aac6b9af22c9dc292c20c6742141ee7c55b5e85460beb0c54e",
- "https://deno.land/std@0.184.0/streams/reader_from_iterable.ts": "55f68110dce3f8f2c87b834d95f153bc904257fc65175f9f2abe78455cb8047c",
- "https://deno.land/std@0.184.0/streams/reader_from_stream_reader.ts": "fa4971e5615a010e49492c5d1688ca1a4d17472a41e98b498ab89a64ebd7ac73",
- "https://deno.land/std@0.184.0/streams/text_delimiter_stream.ts": "20e680ab8b751390e359288ce764f9c47d164af11a263870746eeca4bc7d976b",
- "https://deno.land/std@0.184.0/streams/text_line_stream.ts": "0f2c4b33a5fdb2476f2e060974cba1347cefe99a4af33c28a57524b1a34750fa",
- "https://deno.land/std@0.184.0/streams/to_transform_stream.ts": "7f55fc0b14cf3ed0f8d10d8f41d05bdc40726e44a65c37f58705d10a615f0159",
- "https://deno.land/std@0.184.0/streams/writable_stream_from_writer.ts": "56fff5c82fb736fdd669b567cc0b2bbbe0351002cd13254eae26c366e2bed89a",
- "https://deno.land/std@0.184.0/streams/write_all.ts": "aec90152978581ea62d56bb53a5cbf487e6a89c902f87c5969681ffbdf32b998",
- "https://deno.land/std@0.184.0/streams/writer_from_stream_writer.ts": "07c7ee025151a190f37fc42cbb01ff93afc949119ebddc6e0d0df14df1bf6950",
- "https://deno.land/std@0.184.0/streams/zip_readable_streams.ts": "a9d81aa451240f79230add674809dbee038d93aabe286e2d9671e66591fc86ca",
- "https://deno.land/std@0.184.0/types.d.ts": "dbaeb2c4d7c526db9828fc8df89d8aecf53b9ced72e0c4568f97ddd8cda616a4",
- "https://deno.land/std@0.188.0/async/abortable.ts": "fd682fa46f3b7b16b4606a5ab52a7ce309434b76f820d3221bdfb862719a15d7",
- "https://deno.land/std@0.188.0/async/deadline.ts": "58f72a3cc0fcb731b2cc055ba046f4b5be3349ff6bf98f2e793c3b969354aab2",
- "https://deno.land/std@0.188.0/async/debounce.ts": "adab11d04ca38d699444ac8a9d9856b4155e8dda2afd07ce78276c01ea5a4332",
- "https://deno.land/std@0.188.0/async/deferred.ts": "42790112f36a75a57db4a96d33974a936deb7b04d25c6084a9fa8a49f135def8",
- "https://deno.land/std@0.188.0/async/delay.ts": "73aa04cec034c84fc748c7be49bb15cac3dd43a57174bfdb7a4aec22c248f0dd",
- "https://deno.land/std@0.188.0/async/mod.ts": "f04344fa21738e5ad6bea37a6bfffd57c617c2d372bb9f9dcfd118a1b622e576",
- "https://deno.land/std@0.188.0/async/mux_async_iterator.ts": "70c7f2ee4e9466161350473ad61cac0b9f115cff4c552eaa7ef9d50c4cbb4cc9",
- "https://deno.land/std@0.188.0/async/pool.ts": "f1b8d3df4d7fd3c73f8cbc91cc2e8b8e950910f1eab94230b443944d7584c657",
- "https://deno.land/std@0.188.0/async/retry.ts": "dd19d93033d8eaddbfcb7654c0366e9d3b0a21448bdb06eba4a7d8a8cf936a92",
- "https://deno.land/std@0.188.0/async/tee.ts": "47e42d35f622650b02234d43803d0383a89eb4387e1b83b5a40106d18ae36757",
- "https://deno.land/std@0.188.0/fmt/colors.ts": "d67e3cd9f472535241a8e410d33423980bec45047e343577554d3356e1f0ef4e",
- "https://deno.land/std@0.188.0/http/server.ts": "1b23463b5b36e4eebc495417f6af47a6f7d52e3294827a1226d2a1aab23d9d20",
- "https://deno.land/x/crates@v1.0.1/api.ts": "5166e6c9867e577bdb4183e7a099739469a854850f1ea7fc45c759d89bb7f789",
- "https://deno.land/x/crates@v1.0.1/client.ts": "1448f7658dc2740b6a8d65cb3fb172c86d2506b0c4fa3cd5305d7b4f6d343c92",
- "https://deno.land/x/crates@v1.0.1/mod.ts": "0ac461462f26518ef47fca42cc87c3c3e2f607231479fb85e3356e1310cba43f",
- "https://deno.land/x/crates@v1.0.1/types/info.ts": "0204979bb2e9785245748e4a54bab6aca2b1bba4f1cdac58e8a70f0225025fd3",
- "https://deno.land/x/crates@v1.0.1/types/mod.ts": "ab02d523917e8cc1398ba1e73f8557efaaa7beefec3c78c87451abb85b5e1c79",
- "https://deno.land/x/crates@v1.0.1/types/search.ts": "fafa578a104ca199f2c49397de90baff0722d11268345a140ad74a57a903ce38",
- "https://deno.land/x/deno_dom@v0.1.38/build/deno-wasm/deno-wasm.js": "98b1ad24a1c13284557917659402202e5c5258ab1431b3f3a82434ad36ffa05a",
- "https://deno.land/x/deno_dom@v0.1.38/deno-dom-wasm.ts": "bfd999a493a6974e9fca4d331bee03bfb68cfc600c662cd0b48b21d67a2a8ba0",
- "https://deno.land/x/deno_dom@v0.1.38/src/api.ts": "0ff5790f0a3eeecb4e00b7d8fbfa319b165962cf6d0182a65ba90f158d74f7d7",
- "https://deno.land/x/deno_dom@v0.1.38/src/constructor-lock.ts": "59714df7e0571ec7bd338903b1f396202771a6d4d7f55a452936bd0de9deb186",
- "https://deno.land/x/deno_dom@v0.1.38/src/deserialize.ts": "f4d34514ca00473ca428b69ad437ba345925744b5d791cb9552e2d7a0e7b0439",
- "https://deno.land/x/deno_dom@v0.1.38/src/dom/document-fragment.ts": "a40c6e18dd0efcf749a31552c1c9a6f7fa614452245e86ee38fc92ba0235e5ae",
- "https://deno.land/x/deno_dom@v0.1.38/src/dom/document.ts": "b8f4e4ccabaaa063d6562a0f2f8dea9c0419515d63d8bd79bfde95f7cd64bd93",
- "https://deno.land/x/deno_dom@v0.1.38/src/dom/dom-parser.ts": "609097b426f8c2358f3e5d2bca55ed026cf26cdf86562e94130dfdb0f2537f92",
- "https://deno.land/x/deno_dom@v0.1.38/src/dom/element.ts": "77c454e228dfeb5c570da5aa61d91850400116bfa0f5a85505acdd3c667171a4",
- "https://deno.land/x/deno_dom@v0.1.38/src/dom/elements/html-template-element.ts": "127bb291bb08afeb7e9a66294a5aa6ff2780f4eb4601fa6f7869fe8b70a81472",
- "https://deno.land/x/deno_dom@v0.1.38/src/dom/html-collection.ts": "ae90197f5270c32074926ad6cf30ee07d274d44596c7e413c354880cebce8565",
- "https://deno.land/x/deno_dom@v0.1.38/src/dom/node-list.ts": "4c6e4b4585301d4147addaccd90cb5f5a80e8d6290a1ba7058c5e3dfea16e15d",
- "https://deno.land/x/deno_dom@v0.1.38/src/dom/node.ts": "3069e6fc93ac4111a136ed68199d76673339842b9751610ba06f111ba7dc10a7",
- "https://deno.land/x/deno_dom@v0.1.38/src/dom/selectors/custom-api.ts": "852696bd58e534bc41bd3be9e2250b60b67cd95fd28ed16b1deff1d548531a71",
- "https://deno.land/x/deno_dom@v0.1.38/src/dom/selectors/nwsapi-types.ts": "c43b36c36acc5d32caabaa54fda8c9d239b2b0fcbce9a28efb93c84aa1021698",
- "https://deno.land/x/deno_dom@v0.1.38/src/dom/selectors/nwsapi.js": "985d7d8fc1eabbb88946b47a1c44c1b2d4aa79ff23c21424219f1528fa27a2ff",
- "https://deno.land/x/deno_dom@v0.1.38/src/dom/selectors/selectors.ts": "83eab57be2290fb48e3130533448c93c6c61239f2a2f3b85f1917f80ca0fdc75",
- "https://deno.land/x/deno_dom@v0.1.38/src/dom/selectors/sizzle-types.ts": "78149e2502409989ce861ed636b813b059e16bc267bb543e7c2b26ef43e4798b",
- "https://deno.land/x/deno_dom@v0.1.38/src/dom/selectors/sizzle.js": "c3aed60c1045a106d8e546ac2f85cc82e65f62d9af2f8f515210b9212286682a",
- "https://deno.land/x/deno_dom@v0.1.38/src/dom/utils-types.ts": "96db30e3e4a75b194201bb9fa30988215da7f91b380fca6a5143e51ece2a8436",
- "https://deno.land/x/deno_dom@v0.1.38/src/dom/utils.ts": "55f3e9dc71d6c4a54605888d3f99d26fb0cf9973924709f159252a6933ceeabe",
- "https://deno.land/x/deno_dom@v0.1.38/src/parser.ts": "b65eb7e673fa7ca611de871de109655f0aa9fa35ddc1de73df1a5fc2baafc332",
- "https://deno.land/x/dotenv@v3.2.0/mod.ts": "077b48773de9205266a0b44c3c3a3c3083449ed64bb0b6cc461b95720678d38e",
- "https://deno.land/x/dotenv@v3.2.0/util.ts": "693730877b13f8ead2b79b2aa31e2a0652862f7dc0c5f6d2f313f4d39c7b7670",
- "https://deno.land/x/grammy@v1.16.1/bot.ts": "885e3b11a5bb16f923dc09d9351bdf2d2bda8cb29dc1c85d0c3930d59b256f68",
- "https://deno.land/x/grammy@v1.16.1/composer.ts": "1d2e164f9934466553d7f9bf9bf2fe65a1f453b7f7ce3cf57066d87382c6dac2",
- "https://deno.land/x/grammy@v1.16.1/context.ts": "eb582b86219d66979c0a1ff06b3c705f7418157687d2f92c74bceabdae968dbf",
- "https://deno.land/x/grammy@v1.16.1/convenience/frameworks.ts": "f5cc53bd8f2b939b847997f5a6fd1043f5be0b69747f2039eed79a76cd1ec719",
- "https://deno.land/x/grammy@v1.16.1/convenience/keyboard.ts": "5d284a61750731e413bd7292c07e48ce1b3e4e69cee87372e3dc69faae7d8b4d",
- "https://deno.land/x/grammy@v1.16.1/convenience/session.ts": "f9b7a0737cb813810731a3c29c3f5f84a457f493f9e7651e132daab9b58b08e9",
- "https://deno.land/x/grammy@v1.16.1/convenience/webhook.ts": "f1da7d6426171fb7b5d5f6b59633f91d3bab9a474eea821f714932650965eb9e",
- "https://deno.land/x/grammy@v1.16.1/core/api.ts": "5d2f479696e273d41a7f87fbf174a9cef7e82f1b7d25e73e8b505dc24c80e423",
- "https://deno.land/x/grammy@v1.16.1/core/client.ts": "8914f13b2cb69f16104a9711e4fea0a4500edd0950736dcc3ac078ab46f7a5ab",
- "https://deno.land/x/grammy@v1.16.1/core/error.ts": "4638b2127ebe60249c78b83011d468f5e1e1a87748d32fe11a8200d9f824ad13",
- "https://deno.land/x/grammy@v1.16.1/core/payload.ts": "420e17c3c2830b5576ea187cfce77578fe09f1204b25c25ea2f220ca7c86e73b",
- "https://deno.land/x/grammy@v1.16.1/filter.ts": "2c341f376bff726ca300e547843abcd989219cd10a05ae612844efaaa2cefe50",
- "https://deno.land/x/grammy@v1.16.1/mod.ts": "6d96b0c7b4c8b9448b9f9903a95a78c3379febd36b0f6485ad567d79b153c794",
- "https://deno.land/x/grammy@v1.16.1/platform.deno.ts": "a6b2425761dd47067de3ad342754b598dc9d931e8bbeb94e647508905e295b20",
- "https://deno.land/x/grammy@v1.16.1/types.deno.ts": "b7378afc2779a4e6aecb274bee0fcf5c69968b0074627686d7ff7e4dba6b7022",
- "https://deno.land/x/grammy@v1.16.1/types.ts": "729415590dfa188dbe924dea614dff4e976babdbabb28a307b869fc25777cdf0",
- "https://deno.land/x/grammy@v1.7.0/bot.ts": "9e368e705feb87b5a17c312c57eae5421322c4f5249bbc8f179b9bd919386ffc",
- "https://deno.land/x/grammy@v1.7.0/composer.ts": "6a70b043b58fe509b0607b2e1a2b9e721327645b94c350c278e50417bc3731b9",
- "https://deno.land/x/grammy@v1.7.0/context.ts": "9252605b86c0fc9a4e431857dd808ce88d7868ef9e7d7e60ecd9544c569445a4",
- "https://deno.land/x/grammy@v1.7.0/convenience/frameworks.deno.ts": "aa4e1df1dd5c610e900ff3779f0b320e6e688cd067900f71c000c34138ff023c",
- "https://deno.land/x/grammy@v1.7.0/convenience/keyboard.ts": "39fe5119085de94bcd4b0b8a216b254afa8dda8595d73052355590ee943d8d17",
- "https://deno.land/x/grammy@v1.7.0/convenience/session.ts": "e44b538eb8cffacf68c75d158c2a504c9077560bd0ff385430161385173ac1df",
- "https://deno.land/x/grammy@v1.7.0/convenience/webhook.ts": "07c23c5830f49e42c2f33a49a3100f7ba69d54d6f23770b43eda5b5d608de77d",
- "https://deno.land/x/grammy@v1.7.0/core/api.ts": "ed32fbefb98935657f92efed4feb97057379bbb2b1558ca0ceec9d758a2bf0c2",
- "https://deno.land/x/grammy@v1.7.0/core/client.ts": "9f30bf49573c30af4f379388f620b6f511acd7fbae1cb998168d8c046b96e15f",
- "https://deno.land/x/grammy@v1.7.0/core/error.ts": "400bb976677f0ce620402b025fef36887395760c00a74c7e2c7833e074e33465",
- "https://deno.land/x/grammy@v1.7.0/core/payload.ts": "294a570a432090bc8cd0cda9a6eb07682831967d2a0562d913467afff4d0b419",
- "https://deno.land/x/grammy@v1.7.0/filter.ts": "0f9b3ac87ad930958578a689030a277e1ab3b7bff100bc9b236feea44e393414",
- "https://deno.land/x/grammy@v1.7.0/mod.ts": "31d8dc2b34a990c05199348245c4ef441277627e3661be8c448bf92502021a33",
- "https://deno.land/x/grammy@v1.7.0/platform.deno.ts": "0a6f2be374f7165ef0176066c0e31b4c004b0147681d370615c37d1cc375842e",
- "https://deno.land/x/grammy_types@v3.1.1/api.ts": "efc90a31eb6f59ae5e7a4cf5838f46529e2fa6fa7e97a51a82dbd28afad21592",
- "https://deno.land/x/grammy_types@v3.1.1/inline.ts": "8b94cee32f193dc5c689202a78d6525f6c167cc3e10b5e568c0315f654654586",
- "https://deno.land/x/grammy_types@v3.1.1/manage.ts": "0872ba14a17318bc9a3b8911bea2f24e92bae84a9d0493251454a7b03c357614",
- "https://deno.land/x/grammy_types@v3.1.1/markup.ts": "73348ed0be8926a3057fe7d9e60212326b65bb0fe7848f3cf198dd0eb42734f4",
- "https://deno.land/x/grammy_types@v3.1.1/message.ts": "e21f2df52dd1948353a93db742bcc3b4deacf9f7117b70c358bde7042d79cf83",
- "https://deno.land/x/grammy_types@v3.1.1/methods.ts": "91d345f824360650c1c2aaaebb1bed8bab7df0bb38570cc7a5c58f9b7bb2c658",
- "https://deno.land/x/grammy_types@v3.1.1/mod.ts": "42b1229baba254db0e5b9232580940e3c14e02048d5a982d29c67d2c86dc14e0",
- "https://deno.land/x/grammy_types@v3.1.1/passport.ts": "e3fb63aec96510bcc317ef48fd25b435444b8f407502d7568c00fce15f2958fd",
- "https://deno.land/x/grammy_types@v3.1.1/payment.ts": "d23e9038c5b479b606e620dd84e3e67b6642ada110a962f2d5b5286e99ec7de5",
- "https://deno.land/x/grammy_types@v3.1.1/settings.ts": "5e989f5bd6c587d55673bd8052293869aa2f372e9223dd7f6e28632bfe021b6e",
- "https://deno.land/x/grammy_types@v3.1.1/update.ts": "b60c2aa5f8060a3fa429dda282cb5c7267899fa17bb9000e248f31abadfb5087",
- "https://deno.land/x/marky@v1.1.6/marky.ts": "9c90564d79a7a4d704faef20ac97619cd20b967e48885351b6ef8a22ffdf99eb",
- "https://deno.land/x/marky@v1.1.6/mod.ts": "fcae8411be5ae4399695689883dc09d0f279d59369f4562a9f2762d47cce39f4",
- "https://deno.land/x/marky@v1.1.6/parsers.ts": "494d7611f2d316cfe8c2f88abd1558ddb5afb62b7af89f71f39c3154919169a7",
- "https://deno.land/x/telegraph@v1.0.2/deps.ts": "990bc76aad450e24e0a7817aa09160f68f6b670121d4528a26cdb16654cd3b0f",
- "https://deno.land/x/telegraph@v1.0.2/src/parse.ts": "628abafbc08d9580b229ec0c316aa6d8ab2591eda7165c3c8b6c074760cbf629",
- "https://deno.land/x/telegraph@v1.0.2/src/telegraph.ts": "c6e282ba4fee683a35c242b1f12b505e51519deca5cb42746b7eaf6d6ca6e0b9",
- "https://deno.land/x/telegraph@v1.0.2/src/types.ts": "6c46ce878850c652244d0b0be2d2ec264092b1bfd282de5da0ff349c2240ca45"
- }
-}
diff --git a/deps.ts b/deps.ts
deleted file mode 100644
index 3d734fd..0000000
--- a/deps.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-export {
- Bot,
- Composer,
- Context,
- InlineKeyboard,
- InputFile,
- webhookCallback,
-} from "https://deno.land/x/grammy@v1.16.1/mod.ts";
-export {
- blue,
- bold,
- green,
- red,
- yellow,
-} from "https://deno.land/std@0.188.0/fmt/colors.ts";
-export { config } from "https://deno.land/x/dotenv@v3.2.0/mod.ts";
-export { serve } from "https://deno.land/std@0.188.0/http/server.ts";
-export type { NextFunction } from "https://deno.land/x/grammy@v1.16.1/mod.ts";
-export { api, Types } from "https://deno.land/x/crates@v1.0.1/mod.ts";
-export type { Page } from "https://deno.land/x/telegraph@v1.0.2/src/types.ts";
-export { parseMarkdown } from "https://deno.land/x/telegraph@v1.0.2/src/parse.ts";
-export { Telegraph } from "https://deno.land/x/telegraph@v1.0.2/src/telegraph.ts";
diff --git a/hooks/isGroup.ts b/hooks/isGroup.ts
deleted file mode 100644
index f581b98..0000000
--- a/hooks/isGroup.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { Context, NextFunction } from "../deps.ts";
-
-export default async (ctx: Context, next: NextFunction) => {
- if (ctx.chat!.type === "private") {
- return await ctx.reply(`⚠️ Bu komanda faqat guruh uchun!`);
- }
- await next();
-};
diff --git a/hooks/isHome.ts b/hooks/isHome.ts
deleted file mode 100644
index 2f20ea3..0000000
--- a/hooks/isHome.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { Context, InlineKeyboard, NextFunction } from "../deps.ts";
-import { reply } from "../utils/sender.ts";
-
-export default async (ctx: Context, next: NextFunction) => {
- if (ctx.chat!.id !== -1001518595284) {
- return await reply(
- ctx,
- `⚠️ Bu komanda faqat o'zimizni guruh uchun`,
- new InlineKeyboard().url(
- `Guruhimizga o'ting`,
- `https://t.me/rustlanguz`,
- ),
- );
- }
- await next();
-};
diff --git a/hooks/isPrivate.ts b/hooks/isPrivate.ts
deleted file mode 100644
index a629120..0000000
--- a/hooks/isPrivate.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { Context, InlineKeyboard, NextFunction } from "../deps.ts";
-
-export default async (ctx: Context, next: NextFunction) => {
- if (ctx.chat!.type !== "private") {
- return await ctx.reply(`⚠️ Bu komanda faqat shaxsiy chat uchun!`, {
- reply_markup: new InlineKeyboard().url(
- `Shaxsiy Chat`,
- `https://t.me/rustlanguz`,
- ),
- });
- }
- await next();
-};
diff --git a/hooks/isReply.ts b/hooks/isReply.ts
deleted file mode 100644
index 2f112c4..0000000
--- a/hooks/isReply.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { reply } from "../utils/sender.ts";
-import { Context, NextFunction } from "../deps.ts";
-import topics from "../topics.json" assert { type: "json" };
-
-export default async (ctx: Context, next: NextFunction) => {
- if (!ctx.message?.is_topic_message) {
- return await reply(
- ctx,
- `⚠️ Biz topicda emasmiz bu komandani ishlatish uchun!`,
- );
- }
-
- if (
- !ctx.message?.reply_to_message ||
- Object.values(topics).includes(ctx.message!.reply_to_message!.message_id)
- ) {
- return await reply(ctx, `↪ Reply bilan ko'rsatingchi habarni!`);
- }
- await next();
-};
diff --git a/mod.ts b/mod.ts
deleted file mode 100644
index 13873f9..0000000
--- a/mod.ts
+++ /dev/null
@@ -1 +0,0 @@
-import "./core.ts";
diff --git a/types/Github.d.ts b/types/Github.d.ts
deleted file mode 100644
index b4f5f38..0000000
--- a/types/Github.d.ts
+++ /dev/null
@@ -1,55 +0,0 @@
-export interface Reactions {
- url: string;
- total_count: number;
- "+1": number;
- "-1": number;
- laugh: number;
- hooray: number;
- confused: number;
- heart: number;
- rocket: number;
- eyes: number;
-}
-
-export interface ReleaseAuthor {
- "login": string;
- "id": number;
- "node_id": string;
- "avatar_url": string;
- "gravatar_id": string;
- "url": string;
- "html_url": string;
- "followers_url": string;
- "following_url": string;
- "gists_url": string;
- "starred_url": string;
- "subscriptions_url": string;
- "organizations_url": string;
- "repos_url": string;
- "events_url": string;
- "received_events_url": string;
- "type": string;
- "site_admin": boolean;
-}
-
-export interface Release {
- "url": string;
- "assets_url": string;
- "upload_url": string;
- "html_url": string;
- "id": number;
- "author": ReleaseAuthor;
- "node_id": string;
- "tag_name": string;
- "target_commitish": string;
- "name": string;
- "draft": boolean;
- "prerelease": boolean;
- "created_at": string | Date;
- "published_at": string | Date;
- "assets": [];
- "tarball_url": string;
- "zipball_url": string;
- "body": string;
- "reactions": Reactions;
-}
diff --git a/utils/checker.ts b/utils/checker.ts
deleted file mode 100644
index 3ffaedc..0000000
--- a/utils/checker.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { editor } from "../core.ts";
-import type { Page } from "../deps.ts";
-import { parseMarkdown } from "../deps.ts";
-
-export const hecker = async (
- version: string,
- content: string,
-): Promise => {
- const existing = await editor.getPages();
-
- for (const some of existing.pages) {
- if (some.title === `Rust ${version}`) {
- return some;
- }
- }
-
- return await editor.create({
- title: `Rust ${version}`,
- content: parseMarkdown(content) ||
- "Oops, something happened while fetching data",
- });
-};
-
-export default hecker;
diff --git a/utils/config.ts b/utils/config.ts
deleted file mode 100644
index 0116f32..0000000
--- a/utils/config.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { config } from "../deps.ts";
-
-const inits = () => {
- if (Deno.env.get("MODE") === "NOFS") {
- return Deno.env.toObject();
- } else {
- return config();
- }
-};
-
-const dots = inits();
-
-export default dots;
diff --git a/utils/encoder.ts b/utils/encoder.ts
deleted file mode 100644
index b945090..0000000
--- a/utils/encoder.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export default (input: string) =>
- input.replaceAll(/[\u00A0-\u9999<>\&]/g, (i) => {
- return "" + i.charCodeAt(0) + ";";
- });
diff --git a/utils/generator.ts b/utils/generator.ts
deleted file mode 100644
index e151ef6..0000000
--- a/utils/generator.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import type { Release } from "../types/Github.d.ts";
-
-export const finder = async (id: number) => {
- const request = await fetch(
- `https://api.github.com/repos/rust-lang/rust/releases/${id}`,
- );
-
- return await request.json() as Release;
-};
-
-export const pager = async (page: number, size = 5) => {
- const request = await fetch(
- `https://api.github.com/repos/rust-lang/rust/releases?per_page=${size}&page=${page}`,
- );
-
- return await request.json() as Release[];
-};
-
-export const last = async () => {
- const request = await fetch(
- `https://api.github.com/repos/rust-lang/rust/releases/latest`,
- );
-
- return await request.json() as Release;
-};
diff --git a/utils/pager.ts b/utils/pager.ts
deleted file mode 100644
index 11b8e0f..0000000
--- a/utils/pager.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import communities from "../communities.json" assert { type: "json" };
-
-export default (page_number: number, page_size = 5) => {
- return communities.slice(
- (page_number - 1) * page_size,
- page_number * page_size,
- );
-};
diff --git a/utils/picker.ts b/utils/picker.ts
deleted file mode 100644
index bc551d0..0000000
--- a/utils/picker.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-import source from "../source.json" assert { type: "json" };
-
-export type Category =
- | "tutorial"
- | "podcasts"
- | "books"
- | "videos"
- | "more"
- | "even_more";
-
-export interface Material {
- name: string;
- desc: string;
- link: string;
-}
-
-export const categories = (): string[] => {
- return Object.keys(source);
-};
-
-export const indexer = (category: Category, element: Material) => {
- return source[category].indexOf(element);
-};
-
-export const material = (category: Category, index: number): Material => {
- return source[category][index];
-};
-
-export const pager = (
- category: Category,
- page_number: number,
- page_size = 5,
-): Material[] => {
- return source[category].slice(
- (page_number - 1) * page_size,
- page_number * page_size,
- );
-};
diff --git a/utils/sender.ts b/utils/sender.ts
deleted file mode 100644
index 15c59c3..0000000
--- a/utils/sender.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-// deno-lint-ignore-file no-explicit-any
-import { Context, InlineKeyboard } from "../deps.ts";
-
-/**
- * Reply to message api but with topics support
- * @param ctx Context from Grammy.js middleware
- * @param message The message you want to send
- * @param buttons InlineKeyboard button to attach to the message
- * @param configs Other configs to pass to the api
- */
-export const reply = async (
- ctx: Context,
- message: string,
- buttons?: InlineKeyboard,
- configs?: { [key: string]: any },
-): Promise => {
- const config: { [key: string]: any } = {
- parse_mode: "HTML",
- ...configs,
- };
-
- if (ctx.message!.is_topic_message) {
- config["message_thread_id"] = ctx.message!.message_thread_id;
- }
-
- if (buttons) {
- config["reply_markup"] = buttons;
- }
-
- return await ctx.reply(message, config);
-};