tgsnake
Version:
Telegram MTProto framework for nodejs.
38 lines (37 loc) • 1.25 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChatJoinRequest = void 0;
const TL_js_1 = require("../TL.js");
const index_js_1 = require("../Advanced/index.js");
class ChatJoinRequest extends TL_js_1.TLObject {
chat;
from;
userChatId;
date;
bio;
inviteLink;
constructor({ chat, from, userChatId, date, bio, inviteLink, }, client) {
super(client);
this.chat = chat;
this.from = from;
this.userChatId = userChatId;
this.date = date;
this.bio = bio;
this.inviteLink = inviteLink;
}
static async parse(client, update, chats, users) {
return new ChatJoinRequest({
userChatId: update.userId,
date: new Date(update.date * 1000),
bio: 'bio' in update
? update.bio
: 'about' in update
? update.about
: '',
inviteLink: update.invite,
from: await index_js_1.User.parse(client, users.find((user) => user.id === update.userId)),
chat: await index_js_1.Chat.parseDialog(client, update.peer, users, chats),
}, client);
}
}
exports.ChatJoinRequest = ChatJoinRequest;