{"id":27026260,"url":"https://github.com/tikrack/tel-js","last_synced_at":"2026-03-16T23:37:07.450Z","repository":{"id":284889632,"uuid":"956385353","full_name":"tikrack/tel-js","owner":"tikrack","description":"A repository for send message in the telegram and use this for the any bot","archived":false,"fork":false,"pushed_at":"2025-03-28T08:19:11.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T08:27:32.687Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tikrack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-28T06:58:10.000Z","updated_at":"2025-03-28T08:19:14.000Z","dependencies_parsed_at":"2025-03-28T08:28:01.854Z","dependency_job_id":"6b04b0cd-0c12-4e11-b6e2-a8fec399275d","html_url":"https://github.com/tikrack/tel-js","commit_stats":null,"previous_names":["tikrack/tel-js"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikrack%2Ftel-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikrack%2Ftel-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikrack%2Ftel-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikrack%2Ftel-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tikrack","download_url":"https://codeload.github.com/tikrack/tel-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256086,"owners_count":20909240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-04T22:17:12.716Z","updated_at":"2026-03-16T23:37:02.412Z","avatar_url":"https://github.com/tikrack.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cp\u003e\n  \u003cimg title=\"telegram\" width=\"120\" src=\"https://github.com/user-attachments/assets/ef93936f-f131-4fec-9804-38a3366dd3d9\" /\u003e\n  \u003cimg title=\"javascript\" width=\"120\" src=\"https://github.com/user-attachments/assets/5c6ae4d9-d6f3-40c3-88f1-b35471ad5fc0\" /\u003e\n\u003c/p\u003e\n\n# tel-js\nIf you are in a country where Telegram APIs are blocked for you, this package is your best choice. This package is designed to allow you to communicate with messaging APIs in bots without any problems. You can use this feature for front-end logging systems. This package can work without any dependencies.\n\u003cbr /\u003e\u003cbr /\u003e\n\u003c/div\u003e \n\n## How to install?\nThis package is very easy to use, you just need to install it first.\n\n```\nnpm i tel-js\n```\n\nThen you need to add it to your project. Like below:\n\n```html\n\u003cscript type=\"module\"\u003e\n    import TelJs from \"tel-js\";\n    // other codes ...\n\u003c/script\u003e\n```\n\nThe above method is for the case where you are using construction tools like Vite. And if you are not using them, you can proceed with the following methods:\n\n```html\n\u003cscript type=\"module\"\u003e\n    import TelJs from \"./node_modules/tel-js/index.js\";\n    // other codes ...\n\u003c/script\u003e\n```\n\nOr if you don't want to install anything, you can use CDNs like below:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import TelJS from 'https://cdn.jsdelivr.net/npm/tel-js@latest/index.js';\n\u003c/script\u003e\n```\n\n## How to use?\nLet's get to how to use it\nWe need some information before using it.\nYou first need to create a bot in Telegram in the @BotFather bot and have its token.\nThen you need to add it to a group or channel and get the chat_id of that group or channel or even a conversation and have it too. (For more information on this, you can refer to the Telegram documentation)\nFinally, you need to have the token and chat ID as follows:\n\n```\ntoken =\u003e \"7625382592:AAdX0jkcydTx7NG2e2X3zkUvnOMmh5DeS9s\"\nchat_id =\u003e \"-1302142270666\"\n```\n\nIf you've made it this far, congratulations, because you've completed 80% of the steps 🔥🚀🚀\n\n## last stage 🎉🎉\nHere you need to create an instance of the class you imported and then give it \nfirst token \nand second chat_id \nas props respectively.\n\n```html\n\u003cscript type=\"module\"\u003e\n  import TelJS from \"https://cdn.jsdelivr.net/npm/tel-js@latest/index.js\";\n\n  // new TelJS(token, chat_i)\n  const telegram = new TelJS(\n    \"7625185562:AAGX0jfcydTx7NG2erX3zkUvnOMmK5DeS9s\", // token\n    \"-3002192470356\" // chat_id\n  );\n\u003c/script\u003e\n```\n\nIn this way, you have done the initial configuration very correctly. Now let's move on to the message sending stage.\nTo do this, simply call a function called send on the instance of the class you created with the input of your desired message:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import TelJS from \"https://cdn.jsdelivr.net/npm/tel-js@latest/index.js\";\n\n  // new TelJS(token, chat_i)\n  const telegram = new TelJS(\n    \"7625185562:AAGX0jfcydTx7NG2erX3zkUvnOMmK5DeS9s\", // token\n    \"-3002192470356\" // chat_id\n  );\n\n  telegram.send(\"test message\").then((result) =\u003e {\n    console.log(result);\n  });\n\u003c/script\u003e\n```\n\nThat's it\nAlso, the result variable is the output of the API and your text should be in the props of the send function.\nAnother point is that the parse-HTML feature is also enabled and you can use it in your messages\nFor example:\n\n```javascript\ntelegram.send(\"\u003cb\u003eHello\u003c/b\u003e\").then((result) =\u003e {\n    console.log(result);\n});\n```\n\nDone.🎉🎉\nAlso, if you have any problems running the package, you can let me know in the issues section. \n🟢🟢\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftikrack%2Ftel-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftikrack%2Ftel-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftikrack%2Ftel-js/lists"}