Closed abbddo closed 6 years ago
I've solved it by requiring tgresolve
const tgresolve = require("tg-resolve");
then use it like this
tgresolve(token, "@tgeek", function(error, result) {
// ... handle error ...
console.log(result.id);
});
The chatIdResolution.resolve
constructor option you were using allows providing a custom resolution method. Currently, we do not expose any method for resolving username but we could work on a feature to expose such a method. Maybe something like,
bot.resolveChatId("@username").then(function(result) {
// ... do something ...
});
Tgfancy#resolveChatId()
added in v0.12.0
I want an example about extracting the user_id from the username this was my try
but I'm getting error says user is not defined