{"id":19736653,"url":"https://github.com/fosslife/grambot","last_synced_at":"2025-04-30T04:32:10.905Z","repository":{"id":52290994,"uuid":"169280140","full_name":"fosslife/grambot","owner":"fosslife","description":"A simple userbot for telegram written in Python","archived":false,"fork":false,"pushed_at":"2023-05-20T18:36:59.000Z","size":6867,"stargazers_count":9,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-05T22:31:56.467Z","etag":null,"topics":["telegram","telegram-userbot","telethon","telethon-userbot"],"latest_commit_sha":null,"homepage":"","language":"Python","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/fosslife.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}},"created_at":"2019-02-05T17:16:51.000Z","updated_at":"2023-07-13T08:54:51.000Z","dependencies_parsed_at":"2023-01-31T05:00:25.622Z","dependency_job_id":null,"html_url":"https://github.com/fosslife/grambot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fosslife%2Fgrambot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fosslife%2Fgrambot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fosslife%2Fgrambot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fosslife%2Fgrambot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fosslife","download_url":"https://codeload.github.com/fosslife/grambot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251643173,"owners_count":21620443,"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":["telegram","telegram-userbot","telethon","telethon-userbot"],"created_at":"2024-11-12T01:08:02.284Z","updated_at":"2025-04-30T04:32:10.466Z","avatar_url":"https://github.com/fosslife.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Grambot\n\n## What is it\n\nIt's a telegram userbot. if you don't know what a userbot is, it's a normal user account but backed by the power of programming. Think it like, a programming language is handling your account and that's all. It knows when someone sends you a message, what is the message, if you want to send something to someone etc etc. Thus, automation!\n\n## How does it work?\n\nThis bot is written in Python, with a famous telegram MTProto framework known as [Telethon](https://github.com/LonamiWebs/Telethon). With the help of Telethon, we can keep the server in `listening` mode for events such as New Incoming message etc etc and then for a specific type of message, take a specific action.\n\n## Deploy\n\n\u003cp style=\"text-align: left;\"\u003e\u003ca href=\"https://heroku.com/deploy\"\u003e \u003cimg style=\"float: left;\" src=\"https://www.herokucdn.com/deploy/button.svg\" alt=\"Deploy to Heroku\" /\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003e Note that heroku deploys the bot successfully, but somehow doesn't start the bot automatically. I am not good\n\u003e with heroku. if someone knows the issue feel free to open PR. otherwise, for now, once bot is deployed with above\n\u003e button, go to following section from heroku dashboard, and toggle it to turn dyno on.\n\n![heroku](./heroku.png)\n\nto get the `string_session` key, just clone the repo, get apiid and apikey from telegram (see steps below), paste them in .env file.\nthen run `stringsession.py` it will output the key for you, paste it in heroku deploy dashboard you see after you click above button.\n\nto check logs:\n\n```\nheroku logs -a heroku-app-id --tail\n```\n\nit's always a good idea to connect heroku with repository, so just fork the repo and connect it with github, for manual deploys\n\n## Example\n\n[See full list [Here](./Plugins.md)]\n\nfor this bot I have enabled `commands` such as `.help` and `.weather`.\nWhen the bot encounters a new message on telegram that matches exact `.weather` i.e start from `(dot)(weather)`, it executes a special coroutine that fetches weather from open weather API of given city. thus\n\n```\n.weather(Berlin) =\u003e weather details of berlin\n.help =\u003e help message on how to use other commands\n```\n\nThese output are sent to the same channel the command was sent on, by YOUR account.\n\n[![Demo](https://img.youtube.com/vi/wybDkn1q3mA/0.jpg)](https://www.youtube.com/watch?v=wybDkn1q3mA)\n\n## Installation:\n\n- Pull the latest source. Clone the repo or download zip and extract it, whatever works for you\n- get apiid and apihash from telegram (free). [Instructions](https://core.telegram.org/api/obtaining_api_id)\n- get openweather api key (free). [Instructions](https://openweathermap.org/appid)\n- rename `sample.env` to `.env` at the root of folder. and edit it accordingly\n- if you have pipenv installed\n  - run `pipenv shell`\n  - run `pipenv install`\n  - run `python3 -m userbot`\n  - it should start the bot.\n- if you don't have pipenv\n  - use virtualenv if possible\n  - run `pip install -r requirements.txt`\n  - run `python3 -m userbot`\n\nif you face any issues contact me on Telegram or feel free to open issue :D\n\n## License\n\ngrambot is licensed under MIT. Please see LICENSE file for more information\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffosslife%2Fgrambot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffosslife%2Fgrambot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffosslife%2Fgrambot/lists"}