Skip to content

A simple userbot for telegram written in Python

License

Notifications You must be signed in to change notification settings

muhammedfurkan/grambot

 
 

Repository files navigation

Grambot

What is it

It'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!

How does it work?

This bot is written in Python, with a famous telegram MTProto framework known as 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.

Example

[See full list Here]

for this bot I have enabled commands such as .help and .weather. When 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

.weather(Berlin) => weather details of berlin
.help => help message on how to use other commands

These output are sent to the same channel the command was sent on, by YOUR account.

Demo

Installation:

  • Pull the latest source. Clone the repo or download zip and extract it, whatever works for you
  • get apiid and apihash from telegram (free). Instructions
  • get openweather api key (free). Instructions
  • rename sample.env to .env at the root of folder. and edit it accordingly
  • if you have pipenv installed
    • run pipenv shell
    • run pipenv install
    • run python3 -m userbot
    • it should start the bot.
  • if you don't have pipenv
    • use virtualenv if possible
    • run pip install -r requirements.txt
    • run python3 -m userbot

if you face any issues contact me on Telegram or feel free to open issue :D

License

grambot is licensed under MIT. Please see LICENSE file for more information

About

A simple userbot for telegram written in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%