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:
// 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));
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));