{"id":15191232,"url":"https://github.com/nushell-prophet/nu-telegram-bot","last_synced_at":"2025-10-02T06:32:15.005Z","repository":{"id":232977410,"uuid":"779669830","full_name":"nushell-prophet/nu-telegram-bot","owner":"nushell-prophet","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-16T10:14:13.000Z","size":32,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-28T21:05:02.322Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nushell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nushell-prophet.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":"2024-03-30T13:24:28.000Z","updated_at":"2024-06-26T10:57:39.000Z","dependencies_parsed_at":"2024-06-11T11:16:39.268Z","dependency_job_id":null,"html_url":"https://github.com/nushell-prophet/nu-telegram-bot","commit_stats":null,"previous_names":["nushell-prophet/nu-telegram-bot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nushell-prophet%2Fnu-telegram-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nushell-prophet%2Fnu-telegram-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nushell-prophet%2Fnu-telegram-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nushell-prophet%2Fnu-telegram-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nushell-prophet","download_url":"https://codeload.github.com/nushell-prophet/nu-telegram-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234951863,"owners_count":18912480,"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":"2024-09-27T21:00:43.098Z","updated_at":"2025-10-02T06:32:09.761Z","avatar_url":"https://github.com/nushell-prophet.png","language":"Nushell","funding_links":[],"categories":["Scripts"],"sub_categories":[],"readme":"# nu-telegram-bot\n\n[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)\n\nA basic Nushell module for interacting with the Telegram Bot API.\n\n![nutgb-demo](https://github.com/nushell-prophet/nu-telegram-bot/assets/4896754/ab93a871-54a8-4c5c-99c9-1ae54fce19e2)\n\n# Quick start\n\n1. Clone this repository\n\n```nu no-run\n\u003e git clone https://github.com/nushell-prophet/nu-telegram-bot\n\u003e cd nu-telegram-bot\n\u003e use nutgb.nu\n```\n2. Obtain the token for your bot from [@botfather](https://t.me/botfather) and add it to `nutgb`\n\n```nu no-run\nnutgb add-bot \u003cyour-token\u003e\n```\n3. Send any message to your new bot from the account that will later receive messages from the bot.\n(optionally, you can add this bot to the group or channel).\n\n4. Receive updates (sent messages to the bot or events of adding him to groups).\nMind that you can use `tab` auto-completion for the bot's name here.\n\n```nu no-run\nnutgb get-updates \u003cbot-name\u003e\n```\n\n5. If the previous command gave you some data, it means that now you can send messages using `nutgb send-message`\n\n```nu no-run\nnutgb send-message 'some message' --recipient \u003ctab-completed-recipient-name\u003e\n```\n\n`nutgb` saves tokens and conversations with users:\n1. If `$env.nutgb-path` is set - in that folder.\n2. If `$env.XDG_CONFIG_HOME` is set, then in `nutgb` folder inside.\n3. Otherwise, in `.nutgb` folder in home `$nu.home-path`.\n\nYou are welcome to read the code and make your understanding.\nThe part about locating needed files is described [here](https://github.com/nushell-prophet/nu-telegram-bot/blob/a4528eef02de23e9faa0054304cce46f35ef584e/nutgb.nu#L167).\n\n# commands help\n\n```nushell\nuse nutgb.nu\nnutgb add-bot -h\n```\n\nOutput:\n\n```\nadd a Telegram bot using the provided token and optionally return bot information\n\nUsage:\n  \u003e add-bot {flags} \u003cbot_token\u003e\n\nFlags:\n  --return_info - if set, returns bot information instead of saving it\n  --default - make this bot default for sending messages from\n  -h, --help - Display the help message for this command\n\nParameters:\n  bot_token \u003cstring\u003e: the bot token provided by Telegram's Botfather https://t.me/botfather\n```\n\n```nushell\nnutgb get-updates -h\n```\n\nOutput:\n\n```\nretrieve messages sent to a bot by users in last hours and save them locally\n\nUsage:\n  \u003e get-updates \u003cbot_name\u003e\n\nFlags:\n  -h, --help - Display the help message for this command\n\nParameters:\n  bot_name \u003cstring\u003e: the name of the bot to retrieve updates for\n```\n\n```nushell\nnutgb send-message -h\n```\n\nOutput:\n\n```\nsend a text message to a recipient via a bot\n\nUsage:\n  \u003e send-message {flags} (message_text)\n\nFlags:\n  --silent_notification - if set, disables notification for the recipient\n  --text_format \u003cCompleterWrapper(String, 2076)\u003e - the mode for parsing the message - 'MarkdownV2', 'Markdown', 'HTML' (default: '')\n  --recipient_id \u003cCompleterWrapper(String, 2077)\u003e - the recipient of the message\n  --reply_to_id \u003cString\u003e - the message ID to reply to (default: '')\n  --suppress_output - don't output send details\n  -h, --help - Display the help message for this command\n\nParameters:\n  message_text \u003cstring\u003e: the message text to be sent (optional)\n```\n\n```nushell\nnutgb send-image -h\n```\n\nOutput:\n\n```\nsend an image or animation file to a recipient via a bot\n\nUsage:\n  \u003e send-image {flags} (media_path)\n\nFlags:\n  --recipient_id \u003cCompleterWrapper(String, 2077)\u003e - the recipient of the message\n  --text_format \u003cCompleterWrapper(String, 2076)\u003e - the mode for parsing the message caption (default: '')\n  --media_caption \u003cString\u003e - the caption for the image or animation (default: '')\n  --reply_to_id \u003cString\u003e - the message ID to reply to (default: '')\n  --silent_notification - if set, disables notification for the recipient\n  --suppress_output - don't output send details\n  -h, --help - Display the help message for this command\n\nParameters:\n  media_path \u003cpath\u003e: the path to the image or animation file to be sent (optional)\n```\n\n```nushell\nnutgb get-recipients -h\n```\n\nOutput:\n\n```\nget a list of recipients for a bot, optionally updating the list\n\nUsage:\n  \u003e get-recipients {flags} (bot_name)\n\nFlags:\n  --refresh_chat_list - if set, updates the recipient list by making a request\n  --set-default - set default recipient to omit setting in other commands\n  -h, --help - Display the help message for this command\n\nParameters:\n  bot_name \u003cstring\u003e: the name of the bot to retrieve recipients for (optional)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnushell-prophet%2Fnu-telegram-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnushell-prophet%2Fnu-telegram-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnushell-prophet%2Fnu-telegram-bot/lists"}