@kamuridesu/whatframework
Version:
A simple WhatsApp Bot Framework on top of Baileys
70 lines (69 loc) • 2.91 kB
TypeScript
import { GroupParticipant, WAMessage } from "@whiskeysockets/baileys";
import { IBot, Media, IMessage, IAuthor, IGroup, IQuotedMessageUnparsed } from "../../@types/types.js";
import { IQuotedMessageParsed } from "../../@types/message.js";
export declare class Author implements IAuthor {
jid: string;
name: string;
chatJid: string;
isBotOwner: boolean;
isBot: boolean;
private group;
constructor(jid: string, name: string, chatJid: string, isBotOwner: boolean, isBot: boolean, group: IGroup | undefined);
get isGroupOwner(): Promise<boolean>;
get isAdmin(): Promise<boolean>;
}
export declare class QuotedMessageParsed implements IQuotedMessageParsed {
author: Author;
stanzaId: string;
body: string;
constructor(unparsedQuotedMessage: IQuotedMessageUnparsed, chatJid: string);
parseBody(body: any): string;
}
export declare class Group implements IGroup {
private bot;
private context;
private __name;
private __description;
private __groupId;
private __members;
private __admins;
private __locked;
private __botIsAdmin;
constructor(bot: IBot, originJid: string);
get name(): Promise<string>;
set name(n: string);
get description(): Promise<string | undefined>;
set description(d: string | undefined);
get groupId(): Promise<string>;
set groupId(g: string);
get members(): Promise<GroupParticipant[]>;
set members(m: GroupParticipant[]);
get admins(): Promise<GroupParticipant[]>;
set admins(m: GroupParticipant[]);
get locked(): Promise<boolean>;
set locked(l: boolean);
get botIsAdmin(): Promise<boolean>;
set botIsAdmin(l: boolean);
}
export declare class Message implements IMessage {
bot: IBot;
originalMessage: WAMessage;
type: string;
body: string;
mentionedUsers: string[];
author: IAuthor;
chatIsGroup: boolean;
isMedia: boolean;
hasQuotedMessage: boolean;
quotedMessageType: any;
quotedMessage: IMessage | undefined | IQuotedMessageParsed;
isReactionMessage: boolean;
reactionMessage: any;
group?: IGroup | undefined;
constructor(bot: IBot, originalMessage: WAMessage, type: string, body: string, mentionedUsers: string[], author: IAuthor, chatIsGroup: boolean, isMedia: boolean, hasQuotedMessage: boolean, quotedMessageType: any, quotedMessage: IMessage | undefined | IQuotedMessageParsed, isReactionMessage: boolean, reactionMessage: any, group?: IGroup | undefined);
replyText(text: string, options?: {}): Promise<IMessage | undefined>;
replyMedia(media: string | Media, messageType: string, mimeType?: string | undefined, mediaCaption?: string | undefined, options?: {}): Promise<IMessage | undefined>;
react(reaction: string): Promise<IMessage | undefined>;
edit(text: string, options?: {}): Promise<IMessage | undefined>;
downloadMedia(): Promise<Media>;
}