Git Product home page Git Product logo

basic-ptb-usage's Introduction

Telegram-python-bot

Some codes with functions using python-telegram-bot library. Just to not have to write again. I'm noob in coding, so suggestions are welcome. I intend to add more functions for other actions.

Based on python-telegram-bot library.

How can it be used?

Few examples of usage:

  • Forward received e-mails automatically;
  • Send status, logs, any kind of verbose from your script to your Telegram;
  • Use APIs to get informations such as weather, stocks prices, flights informations and send to Telegram channel, group or contact;
  • And many other applications.

Setting up basics

How to create a Telegram Bot

  • Start a conversation with BotFather;
  • Send it to the BotFather: /newbot
  • Choose a name for your bot;
  • Choose a username for your bot;
  • Done! You'll get a token to access the HTTP API.

How to get channel or chat (contact) ID from Telegram

  • Start a conversation with JsonDumpBot;
  • It will reply with a json with information from the message;
  • Go to the channel or chat you want the id and forward a message from there to JsonDumpBot;
  • Find the id in the reply. It'll look something like this:
   {...
    "forward_from_chat": {
          "id": xxxxxxxxx,
   ...}
  • Don't forget to add the bot as admin in channel so messages can be sent.

Getting a group ID

  • Open Telegram web;
  • Go to group and check the url on address bar of browser;
  • That's the group ID (-xxxxxxxxx), it'll look something like this:
  https://web.telegram.org/z/#-xxxxxxxxx

To do

  • Firstly a to do list.

basic-ptb-usage's People

Contributors

rcbonz avatar

Watchers

 avatar

basic-ptb-usage's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.