{"id":47780025,"url":"https://github.com/osonsoft/tg-forms","last_synced_at":"2026-04-05T11:04:50.122Z","repository":{"id":65786195,"uuid":"437132576","full_name":"osonsoft/tg-forms","owner":"osonsoft","description":"Small JavaScript Library for Sending Telegram Forms","archived":false,"fork":false,"pushed_at":"2023-02-10T01:41:49.000Z","size":228,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T17:45:48.283Z","etag":null,"topics":["javascript","npm-package","telegram-bot","telegrambotapi"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/tg-forms","language":"TypeScript","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/osonsoft.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"custom":["https://payme.uz/@codeflow"]}},"created_at":"2021-12-10T22:40:31.000Z","updated_at":"2023-05-31T18:56:04.000Z","dependencies_parsed_at":"2023-02-22T01:15:23.296Z","dependency_job_id":null,"html_url":"https://github.com/osonsoft/tg-forms","commit_stats":null,"previous_names":["osonsoft/tg-forms","ainsoft-org/tg-forms"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/osonsoft/tg-forms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osonsoft%2Ftg-forms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osonsoft%2Ftg-forms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osonsoft%2Ftg-forms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osonsoft%2Ftg-forms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osonsoft","download_url":"https://codeload.github.com/osonsoft/tg-forms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osonsoft%2Ftg-forms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31352320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T08:03:20.796Z","status":"ssl_error","status_checked_at":"2026-04-03T08:00:37.834Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["javascript","npm-package","telegram-bot","telegrambotapi"],"created_at":"2026-04-03T13:03:21.015Z","updated_at":"2026-04-03T13:03:25.565Z","avatar_url":"https://github.com/osonsoft.png","language":"TypeScript","readme":"# Documentation\n\n![Logo](./assets/logo.png)\n\n@tg-forms is a simple library for sending and creating Telegram forms. It allows you to easily send messages to your Telegram chats, as well as validate your bot token and retrieve basic information about your bot.\n\n## Contents\n\n- [Documentation](#documentation)\n  - [Contents](#contents)\n  - [Getting started](#getting-started)\n    - [Importing the Library](#importing-the-library)\n    - [Initializing the Client](#initializing-the-client)\n    - [Validating the Bot Token](#validating-the-bot-token)\n    - [Sending Messages](#sending-messages)\n    - [Error Handling](#error-handling)\n  - [Contact us](#contact-us)\n  - [License](#license)\n\n## Getting started\n\nTo use the tg-forms library, you need to install it via npm:\n\n```sh\nnpm install tg-forms\n```\n\n### Importing the Library\n\nTo use the tg-forms library in your code, you can import it with the following code:\n\n```TypeScript\nimport 'dotenv/config'\nimport { TGForms } from 'tg-forms\n```\n\n### Initializing the Client\n\nTo initialize the client, you need to provide it with your bot token, which you can store in your environment variables. If you don't have a bot token, you can create one by talking to the BotFather on Telegram.\n\n```TypeScript\nconst client = new TGForms(process.env.BOT_TOKEN || '')\n```\n\n### Validating the Bot Token\n\nYou can use the `getBotInfo()` method to validate your bot token and retrieve basic information about your bot. The method returns an object with an ok field that indicates whether the token is valid.\n\n```TypeScript\nconst valid = await client.getBotInfo()\nconsole.log(valid) // {ok: true} if BOT TOKEN is valid\n```\n\n### Sending Messages\n\nTo send a message to your Telegram chat, you can use the `sendMessage()` method, which takes two arguments: the `chat_id` of your chat and the `text` of the message you want to send. The `chat_id` can be obtained by sending a message to the userinfobot on Telegram.\n\n```TypeScript\nconst sendMessage = await client.sendMessage(701469900, 'Hello World')\nconsole.log(sendMessage) // {ok: true} if message is sent\n```\n\n### Error Handling\n\nIn case of errors, you can catch them by using the catch statement. The error will be logged to the console.\n\n```TypeScript\nmain().catch((e) =\u003e console.log('Error:', e))\n```\n\n## Contact us\n\nIf you have any questions or suggestions, you can contact us at [ainsoft.org](https://ainsoft.org).\nOpen-source support: oss@ainsoft.org\n\n## License\n\nThe tg-forms library is released under the MIT License.\n\nMIT License\n\nCopyright (c) 2023 Ainsoft.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\n```sh\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","funding_links":["https://payme.uz/@codeflow"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosonsoft%2Ftg-forms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosonsoft%2Ftg-forms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosonsoft%2Ftg-forms/lists"}