Git Product home page Git Product logo

mtproto's Introduction

Telegram mtproto

MTProto implementation in Golang with example tool.

** This is just a WIP Fork based on Other WIP forkes :) **

Example tool

Example tool saves the authkey and other data in ~/.telegram_go. If you delete/lost this file, you will need to auth again.

install

$ go get -v -u github.com/carlosliracl/mtproto/example/telegram

proxy setting

Socks5 proxy is supported by env variable socks5_proxy

$ export socks5_proxy=192.168.1.4:1080

start as rpc server

$ telegram -daemon

phone authorization

Authorizes phone by code (sent by sms or through telegram app).

$ telegram
% auth 79998886655
Enter code: 25704
Signed in: id 104842610 name <Sergey Didyk>

get contact list

Shows user's contact list.

% list
        id        mutual    name                              username
    132597         false    Алексей Г*******                  O******
    326007         false    Татьяна К*******
    344375          true    Андрей П*********                 r******
    348798          true    Руслан Ч******
    473977         false    Тимур Д******

get dialogs

Shows user's dialogs.

% dialogs
        id          type    top_message    unread_count	title
  20071829	    User	9425      	1    	Raspberry Pi(hugozhu2)
  15626832	    Chat	8896      	0    	树莓派通知
  69443043	    User	8872      	0    	Hugo Zhu(hugozhu)
    777000	    User	8871      	0    	Telegram ()
    333000	    User	8624      	0    	Telegram ()

send message to contact

Sends a message to contact. Destination id should be from contact list or user himself.

% msg 104842610 "Hack the planet!"

send photo to contact or dialog(@dialog_id)

$ telegram sendmedia 45264534 ~/Pictures/IMG_1851.JPG

Library

documentation not ready yet

MTProto documentation

License

MIT License

mtproto's People

Contributors

beautyfree avatar carlosliracl avatar hugozhu avatar juanpotato avatar pi0 avatar sdidyk avatar sovietspaceship avatar

Watchers

 avatar  avatar

Forkers

forthxu

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.