Coder Social home page Coder Social logo

telegram.link's People

Contributors

enricostara avatar mien avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

telegram.link's Issues

auth.signIn problem

i have telegram account but after sign in i got an error : PHONE_NUMBER_UNOCCUPIED
what's wrong ?

`termgram` dead link

The introduction says

To start with the telegram.link library, you can install and study the Termgram application.

With the word "Termgram" linking to http://termgram.me/

Currently that appears to be dead:

$ dig termgram.me

; <<>> DiG 9.10.3-P4-Debian <<>> termgram.me
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 31843
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;termgram.me.                   IN      A

Can't send non-english messages

I can send English text and numbers easily via telegram.link.messages.sendMessage.
But when I'm trying to send non-English text (like Cyrillic characters, or Japanese characters etc) I'm getting an error INPUT_REQUEST_TOO_LONG.
I've checked everything: my text is utf8 and it's less than 4096.

Vector

Hi,

How can create a Vector and ImportContacts?
Will you continue working on the lib?

THX.

Copy message from other channel

Hi
Sorry,I have a question about your project(telegram).
Can I get the message channels that I'm not their admin?
I want write a script that read message from other chanel and write to
my chanel.
I can do it?
I can use messages.getHistory(peer, offset, max_id, limit, [callback]) fot do it(how can find perr)?
best regards
thanks

[ERROR] telegram-link Client is not yet ready!

Hi Enrico,

I have similar issue to #8 , but decided to open a new issue too cause issue #8 is closed and you could leave my comment without attention.

My purpose is to know whether the passed phone number was registered in Telegram or no. I have same problem when requesting with your library auth.checkPhone method, which even doesn't requre authorization according API docs.

Here is my script

var data = {} // Hold all global data
data.telegramLink = require('../telegram.link')();

data.app = {
   id: 12345,
     hash: '12345678901234567890',
     version: '1.0.0',
     lang: 'en'
};

data.client = data.telegramLink.createClient(data.app, data.telegramLink.TEST_PRIMARY_DC, function(ex){
  if(!ex) { 
    console.log('Connected to Telegram!');
    data.client.auth.checkPhone('79885851900', function (result) {
      console.log(result);
    }); 
  } 
  else { 
    console.log(ex);
  }
})

I have checked and tested telecommander.js, it works fine. My code is very similar to it, but I can't figure out what's wrong.

Please help to correct my code.

can this be used for group moderation?

this looks like an impressive project!

what is the main goal of the project to differentiate from features in the bot API?
it maybe interesting to prioritize APIs that are not available through the public (and easy to use) bot API?

I don't have a full list but group/spam management is badly needed within TG. creating groups and managing user add/remove is not there in the bot api. ~= an open source liberbot...

Basic example

Hi Pal,

Am new to Telegram api.

Am currently trying to implement Telegram in an Ionic / Cordova app, can this code base be intergraded on a mobile device or does it need to run on a node server,

Also do you have a basic example on how to get this up and running.

SendCode callback never called

Hello.
I'm using this code:
https://gist.github.com/overjt/ae2ebc85b8308beac40c

data.onPhoneNumber = function(s) {
    if (data.user === undefined) {
        data.user = {};
    }
    data.user.phone = s.trim();
    //i.close();
    console.log('Checking your phone number with Telegram...');
    data.client.auth.sendCode(data.user.phone, 5, 'en', function(result) {
        console.log("never called");
        console.log(result);
    });
}

The login code arrives but the function passed as callback is never executed.

console

there's something I'm doing wrong?

example

Hi. Where can i see example of usage.

authorize
get messages
mark read
send message

PEER_ID_INVALID problem

Hi!

i need send a message to a bot.
i used telegramLink.type.InputPeerChat and telegramLink.type.InputPeerContact
but i received a PEER_ID_INVALID

any idea?

thanks!!

Cheers

DEBUG is not recognized as a command

C:\Users\juanpotato\Documents\telegram.link>npm test

> [email protected] test C:\Users\juanpotato\Documents\telegram.link
> DEBUG=-mocha*,-TypeBuilder,* ./node_modules/gulp/bin/gulp.js test

'DEBUG' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Test failed.  See above for more details.

I'm on windows 10 and have run npm install before running test, what do I do?

Use for web

I want to make custom web version of telegram like web.telegram.org.
Can you make some document that shows how to use telegram.link for browser?
It's possible?

tests not passing

If you download the code and follow the instruction to test it (just exec npm test), the tests are failling. Don't know if the library needs some configuration an the readme needs to be updated, or it's a problem in the dependencies... :-/

HttpPollLoop receives same updates again and again

In my client I have

    client.startHttpPollLoop(function(data) {});
    client.registerOnUpdates(function(data) { 
        // create notification when the update holds a message
    });

And when someone sends me a message I receive infinite notifications. Do I have to tell the server somehow I ve received the update or is it a bug in the API?

On the telegram api homepage it states:

the current value of seq should be overwritten with the value in the update’s seq field

So i checked if the API does so by calling updates.getDifference. Telegram.link does what it should do, but why do I keep getting the updates then?

Status of project?

Hi

Was thinking about making an irc->Telegram gateway, and found this to be looking interesting? Is the project status up to date with the readme, or how far have you come?

Thanks,
Walliski

send a message to a phone number...

Hi ..
First of all i have to say thank you for telegram.link
Actually i have some problem with telegram.link and now i can't send a message from it through telegram(the only thing that i need for now).As a matter of fact i'm a Asp.net MVC programmer and Node.Js is not my expert but when i saw your project on Github i started to learn Node.Js so i'm just beginner in Nod.Js and i'm really confused how to send a message from telegram.link by the way
1- i declare var telegramLink = require('telegram.link')();
and create client (client.isReady()return true)

2-then i call client.createAuthKey()and it return a key(when i have to use AuthKey? )

3-but client.auth.sendCode()doesn't send any cod for my mobile number('+98939...5241')

pleas help me that how can i send a message to a phone number with this

thanx for every thing and sorry for that my English is not well(-_-).....

Codes....
app.get("/createAuthKey" , function (req, resp, next) {
console.log("Get_createAuthKey") ;
client.createAuthKey(function(e){
console.log(e);
console.log('createauthkey')
fs.appendFile(process.cwd() + "\createauthkey.txt" , "\n--------------------- \n "+ e, function(err){
if (err) {console.log(err) ; }
else {
console.log("append createauthkey! :D ") ;
}
})

})
resp.end("createAuthKey");

}) ;
////////////////////////////////////////

app.get("/SendCode" , function (req, resp, next) {
console.log("Get_sendCode") ;
client.auth.sendCode('+98939....5241',0,'en',function(e){
fs.appendFile(process.cwd() + "\sendCode.txt" , "\n------------------------ \n "+ e , function(err){
if (err) {console.log(err) ; }
else {
console.log("append sendCode! :D ") ;
}
})

})
resp.end("SendCode");

}) ;
///////////////////////////////////////////////////////////////////////

app.get("/SignIn" , function (req, resp, next) {
console.log("Get_sendCode") ;
client.auth.signIn('+98939...5241',req.body['phone-code-hash'],req.body['phone-code'],function(e){
fs.appendFile(process.cwd() + "\SignIn.txt" , "\n------------------------ \n "+e , function(err){
if (err) {console.log(err) ; }
else {
console.log("append SignIn! :D ") ;
}
})

})
resp.end("SignIn");

}) ;

////////////////////////////////////////////////////////////////////
app.get("/SendMessage" , function (req, resp, next) {
console.log("Get_SendMessage") ;

var peer = new telegramLink.type.InputPeerContact({
    props: {
        user_id: 98939...5241
    }
});


client.messages.sendMessage(
    peer,
    'My UTF8 first msg!!',
    3571334511  // random id...
).then(function (sentMsg) {
        console.log('sentMsg:', sentMsg.toPrintable());
        fs.appendFile(process.cwd() + "\\sentMsg.txt" , "\n------------------------ \n "+sentMsg , function(err){
            if (err) {console.log(err) ; }
            else {
                console.log("append sentMsg! :D ") ;
            }
        })
    });
resp.end("SendMessage");

}) ;
////////////////////////////////////////

Error while retrieving chats and contacts

/home/omid/Documents/test2/.meteor/local/isopacks/npm-container/npm/node_modules/telegram.link/node_modules/telegram-mt-node/lib/net/encrypted-rpc-channel.js:75 W20160218-11:19:25.870(3.5)? (STDERR) var buffer = zlib.gunzipSync(packedData); W20160218-11:19:25.870(3.5)? (STDERR) ^ W20160218-11:19:25.873(3.5)? (STDERR) TypeError: Object [object Object] has no method 'gunzipSync' W20160218-11:19:25.874(3.5)? (STDERR) at checkIfGzipped (/home/omid/Documents/test2/.meteor/local/isopacks/npm-container/npm/node_modules/telegram.link/node_modules/telegram-mt-node/lib/net/encrypted-rpc-channel.js:75:27) W20160218-11:19:25.874(3.5)? (STDERR) at [object Object]._onTimeout (/home/omid/Documents/test2/.meteor/local/isopacks/npm-container/npm/node_modules/telegram.link/node_modules/telegram-mt-node/lib/net/encrypted-rpc-channel.js:67:28) W20160218-11:19:25.874(3.5)? (STDERR) at Timer.listOnTimeout [as ontimeout] (timers.js:121:15)

My Nodejs version is 5.6.0 and I use it with meteorhacks:npm in my Meteor app.
It seems the problem is about zlib

Client not ready!

Hello guys....
i keep getting "Client not ready!" error with the code bellow....

anyone know why??

var telegramLink = require('telegram.link')();
var os = require('os');

var client = telegramLink.createClient(
{
id: 11111, //some id
hash: '111111111111111111111111', //some hash
version: '1.0.0',
lang: 'en',
deviceModel: os.type(),
systemVersion: os.platform() + '/' + os.release()
},
telegramLink.PROD_PRIMARY_DC,
function(ex){
if(!ex) { console.log('Connected to Telegram!'); }
else {console.log(ex);}
}
);

var peer = new telegramLink.type.InputPeerContact({
props: {
user_id: 'userID'
}
});

client.messages.sendMessage(
peer,
'My UTF8 first msg!!',
'9876543211' // random id...
).then(function(sentMsg) {
console.log('sentMsg:', sentMsg.toPrintable());
});

Wrong server_salt

hi
i try to save authKey in my system and then i use telegramLink.retrieveAuthKey method to get my authKey back and it doesn't get null, it return real authKey and i make new client with this authKey

but when i try to get information like calling 'client.messages.getDialogs' method
but print this in terminal:
[INFO] Sun, 28 Aug 2016 22:38:17 GMT net.EncryptedRpcChannel Call of 'mtproto.service.invokeWithLayer' took 1299ms
[INFO] Sun, 28 Aug 2016 22:38:17 GMT net.EncryptedRpcChannel Wrong server_salt in message [0x57c367d88ac07c18]
[INFO] Sun, 28 Aug 2016 22:38:18 GMT net.EncryptedRpcChannel Call of 'mtproto.service.invokeAfterMsg' took 477ms
and stop working

why this happens and what can i do?

I can't install it!

Hello.
I can't install it in my project!
Error:
npm ERR! code ENOGIT npm ERR! No git binary found in $PATH npm ERR! npm ERR! Failed using git. npm ERR! Please check if you have git installed and in your PATH.

Phone_Not_Registered

HI,

I get the the feedback "phone_registered = false" when sending code2phone.
But my phonnumber is regsistered. Im using Desktop and Android client.

Any idea?

THX.

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.