Skip to content
Telegram I/O Bot
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Telegram I/O Bot

Telegram I/O Bot, an easy way to send messages to you in Telegram with code. Ideal when you have a really long code running and want to know when it is done.

Currently under development, the database may be re-generated and your tokens revoked at any time.

Sending messages via code

  1. Curl
curl --header "Content-Type: application/json" --request POST --data '{"token":"<YOUR-TOKEN>","text":"Testing"}'
  1. Python
import requests, json

def send_telegram_message(token, message):
    url = ''
    data = {'token': token, 'text': message}
    headers = {'Content-type': 'application/json'}
        r =, data=json.dumps(data), headers=headers)
        return r
        return None

If you cant install requests and only want to use native Python Libraries

import json, urllib.request
def send_telegram_message(message, token):
    url = ''
    data = {'token': token, 'text': message}

        req = urllib.request.Request(url)
        req.add_header('Content-Type', 'application/json; charset=utf-8')
        jsondata = json.dumps(data)
        jsondataasbytes = jsondata.encode('utf-8')
        req.add_header('Content-Length', len(jsondataasbytes))
        r = urllib.request.urlopen(req, jsondataasbytes)
        return r
        return None        

Things that need to be done

  • Re-factor code
  • Check if UUID exists before adding to the database
  • Make good return messages
  • Add option to revoke key
  • Add a way to use input via code
  • More extensive README
You can’t perform that action at this time.