Chanages chat name and sends a service message on it.
Example
const {Api,TelegramClient} =require('telegram');const {StringSession} =require('telegram/sessions');constsession=newStringSession('');constclient=newTelegramClient(session, apiId, apiHash, {});(asyncfunctionrun() {constresult=awaitclient.invoke(newApi.messages.editChatTitle({ chatId:8881391, title:'random string here', }));console.log(result); // prints the result})();
import {Api, TelegramClient} from'telegram';import {StringSession} from'telegram/sessions';constsession=newStringSession('');constclient=newTelegramClient(session, apiId, apiHash, {});(asyncfunctionrun() { const result: Api.Returns a messages.StatedMessage object containing a service message sent during an action. = await client.invoke(new Api.messages.editChatTitle({
chatId:8881391, title:'random string here', }));console.log(result); // prints the result})();