@juzi/wechaty-puppet-whatsapp
Version:
Wechaty Puppet for WhatsApp
127 lines • 3.68 kB
JavaScript
import { RateManager } from './rate-manager.js';
export class RequestManager {
whatsapp;
rateManager;
constructor(whatsapp) {
this.whatsapp = whatsapp;
this.rateManager = new RateManager();
}
logout() {
return this.whatsapp.logout();
}
acceptPrivateRoomInvite(invitation) {
return this.whatsapp.acceptGroupV4Invite(invitation);
}
acceptRoomInvite(inviteCode) {
return this.whatsapp.acceptInvite(inviteCode);
}
archiveChat(chatId) {
return this.whatsapp.archiveChat(chatId);
}
unarchiveChat(chatId) {
return this.whatsapp.unarchiveChat(chatId);
}
createRoom(name, participants) {
return this.whatsapp.createGroup(name, participants);
}
destroy() {
return this.whatsapp.destroy();
}
getBLockedContacts() {
return this.whatsapp.getBlockedContacts();
}
getChatById(chatId) {
return this.whatsapp.getChatById(chatId);
}
getChatLabels(chatId) {
return this.whatsapp.getChatLabels(chatId);
}
getChats() {
return this.whatsapp.getChats();
}
getChatsByLabelId(labelId) {
return this.whatsapp.getChatsByLabelId(labelId);
}
getContactById(contactId) {
return this.whatsapp.getContactById(contactId);
}
getContacts() {
return this.whatsapp.getContacts();
}
getCountryCode(whatsappId) {
return this.whatsapp.getCountryCode(whatsappId);
}
getFormattedNumber(whatsappId) {
return this.whatsapp.getFormattedNumber(whatsappId);
}
getInviteInfo(inviteId) {
return this.whatsapp.getInviteInfo(inviteId);
}
getLabelById(labelId) {
return this.whatsapp.getLabelById(labelId);
}
getLabels() {
return this.whatsapp.getLabels();
}
getMessageWithId(id) {
return this.whatsapp.getMessageWithId(id);
}
getWhatsappIdByNumber(number) {
return this.whatsapp.getNumberId(number);
}
getAvatarUrl(contactId) {
return this.whatsapp.getProfilePicUrl(contactId);
}
getState() {
return this.whatsapp.getState();
}
getWhatsAppVersion() {
return this.whatsapp.getWWebVersion();
}
init() {
return this.whatsapp.initialize();
}
isWhatsappUser(contactId) {
return this.whatsapp.isRegisteredUser(contactId);
}
markChatUnread(chatId) {
return this.whatsapp.markChatUnread(chatId);
}
muteChat(chatId) {
return this.whatsapp.muteChat(chatId);
}
unmuteChat(chatId) {
return this.whatsapp.unmuteChat(chatId);
}
pinChat(chatId) {
return this.whatsapp.pinChat(chatId);
}
unpinChat(chatId) {
return this.whatsapp.unpinChat(chatId);
}
resetConnection() {
return this.whatsapp.resetState();
}
searchMessage(query, options) {
return this.whatsapp.searchMessages(query, options);
}
sendMessage(chatId, content, options) {
return this.rateManager.exec(async () => {
return this.whatsapp.sendMessage(chatId, content, options);
}, { delayAfter: 1, queueId: chatId });
}
sendPresenceAvailable() {
return this.whatsapp.sendPresenceAvailable();
}
markChatRead(chatId) {
return this.whatsapp.sendSeen(chatId);
}
setNickname(name) {
return this.whatsapp.setDisplayName(name);
}
setStatusMessage(status) {
return this.whatsapp.setStatus(status);
}
}
export const requestManagerKeys = Object.getOwnPropertyNames(RequestManager.prototype);
//# sourceMappingURL=request-manager.js.map