-
Notifications
You must be signed in to change notification settings - Fork 333
Expand file tree
/
Copy pathtypes.d.ts
More file actions
60 lines (55 loc) · 1.55 KB
/
types.d.ts
File metadata and controls
60 lines (55 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import type { WASocket } from '@whiskeysockets/baileys';
import type { WAMessage } from '@whiskeysockets/baileys/lib/Types/Message.js';
import type config from './config.js';
export interface ChannelInfo {
contextInfo: {
forwardingScore: number;
isForwarded: boolean;
forwardedNewsletterMessageInfo: {
newsletterJid: string;
newsletterName: string;
serverMessageId: number;
};
};
}
export interface GroupParticipant {
id: string;
lid?: string;
admin?: 'admin' | 'superadmin' | null;
}
export interface BotContext {
chatId: string;
senderId: string;
isGroup: boolean;
isSenderAdmin: boolean;
isBotAdmin: boolean;
senderIsOwnerOrSudo: boolean;
isOwnerOrSudoCheck: boolean;
channelInfo: ChannelInfo;
rawText: string;
userMessage: string;
messageText: string;
config: typeof config;
}
export interface Plugin {
command: string;
aliases?: string[];
category?: string;
description?: string;
usage?: string;
ownerOnly?: boolean;
strictOwnerOnly?: boolean;
groupOnly?: boolean;
adminOnly?: boolean;
isPrefixless?: boolean;
cooldown?: number;
handler: (sock: WASocket, message: WAMessage, args: string[], context: BotContext) => Promise<void | any>;
}
declare global {
var PAIRING_NUMBER: string | undefined;
var SESSION_ID: string | undefined;
var phoneNumber: string | undefined;
var botname: string | undefined;
var themeemoji: string | undefined;
var gc: (() => void) | undefined;
}