Chat Settings
Main Walkthrough 17 of 25
Administrators can change a chat’s details and behavior.
Changing the Title and Description
With setChatTitle and setChatDescription, you can update a group, supergroup, or channel.
await client.setChatTitle(chatId, "MTKruto Community");
await client.setChatDescription(chatId, "A place to discuss MTKruto.");
An empty description removes the current one.
Changing the Photo
await client.setChatPhoto(chatId, "./community.jpg");
deleteChatPhoto removes the current photo.
await client.deleteChatPhoto(chatId);
Enabling Slow ModeUSER-ONLY
setSlowMode lets you limit how often members can send messages in a supergroup.
await client.setSlowMode(chatId, "30s");
See SlowModeDuration for the available durations. disableSlowMode turns slow mode off.
Automatically Deleting MessagesUSER-ONLY
To automatically delete messages after a number of seconds, call setMessageTtl.
await client.setMessageTtl(chatId, 7 * 24 * 60 * 60);
setDefaultMessageTtl sets the auto-delete period applied to new chats.
await client.setDefaultMessageTtl(7 * 24 * 60 * 60);
Personal Chat SettingsUSER-ONLY
getChatSettings returns the current user’s settings for a chat.
const settings = await client.getChatSettings(chatId);