پرش به مطلب اصلی

getChat

استفاده از متد getChat برای دریافت اطلاعات مرتبط با چت فعلی.

ورودی ها

نامنوعتوضیح
chat_idstringشناسه چتی که باید اطلاعات آن بازیابی شود

خروجی

فیلدنوعتوضیح
chat_idstringشناسه چت
chat_typeChatTypeEnumنوع چت
user_idstringشناسه کاربر
first_namestringنام کوچک
last_namestringنام خانوادگی
titlestringعنوان چت
usernamestringنام کاربری

نحوه استفاده

const { Bot } = require("rubjs");

const bot = new Bot("YOUR_TOKEN");

bot.command("/chatInfo", async (ctx) => {
const chatInfo = await bot.getChat(ctx.chat_id);

await ctx.replay(JSON.stringify(chatInfo));
});

bot.run();