alik0211 / mtproto-core

Telegram API JS (MTProto) client library for Node.js and browser
https://mtproto-core.js.org
GNU General Public License v3.0
625 stars 111 forks source link

I want create one flux using this lib, but i dont know if this lib can make this #294

Open JulioVianaDev opened 8 months ago

JulioVianaDev commented 8 months ago

I want create this flux , with my api_id and api_hash, automatically create one bot, and channel, and make the bot is admin of channel, but i dont know how make this my code in this moment stay liked this:

const mtproto = new MTProto({ api_id, api_hash,

storageOptions: { path: path.resolve(__dirname, './data/1.json'), }, });

// 2. Print the user country code // mtproto.call('help.getNearestDc').then(result => { // console.log('', result); // });

mtproto.call('channels.createChannel',{ title: "my first channel", }).then(result=>{ console.log(result) }).catch(error=>console.log("error: ",error));