zaileys 4.13.0 → 4.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import type { WAMessageKey } from 'baileys';
2
2
  import type { MessageContext } from '../events/context.js';
3
- import type { TextOptions } from '../builder/builder.js';
3
+ import type { MessageBuilder, TextOptions } from '../builder/builder.js';
4
4
  import type { Client as ZaileysClient } from '../client/client.js';
5
5
  export type CommandPrefix = string | string[];
6
6
  export interface ParsedArgs {
@@ -12,13 +12,13 @@ export interface ParsedArgs {
12
12
  raw: string;
13
13
  }
14
14
  export interface CommandContext extends MessageContext {
15
- /** The client that received this command, so a handler needs nothing else in scope. */
16
- client: ZaileysClient;
17
15
  raw: string;
18
16
  command: string;
19
17
  args: string[];
20
18
  flags: Record<string, string | boolean>;
21
19
  json: unknown;
20
+ client: ZaileysClient;
21
+ send(to?: string): MessageBuilder<'init'>;
22
22
  reply(content: string, opts?: TextOptions): Promise<WAMessageKey>;
23
23
  react(emoji: string): Promise<WAMessageKey>;
24
24
  edit(content: string): Promise<void>;
@@ -217,12 +217,12 @@ export interface MessageContext {
217
217
  mentionedGroups: string[];
218
218
  ad?: AdAttribution;
219
219
  business?: BusinessInfo;
220
+ media?: ContextMedia;
221
+ citation: CitationPredicates;
220
222
  roomName(): Promise<string | null>;
221
223
  receiverName(): Promise<string | null>;
222
- media?: ContextMedia;
223
224
  replied(): Promise<MessageContext | null>;
224
225
  message(): WAMessage;
225
- citation: CitationPredicates;
226
226
  reply(content: string, opts?: TextOptions): Promise<WAMessageKey>;
227
227
  react(emoji: string): Promise<WAMessageKey>;
228
228
  }
@@ -56,10 +56,10 @@ export interface PollVotePayload {
56
56
  pollKey: WAMessageKey;
57
57
  /** Raw SHA-256 hashes WhatsApp sends. Use {@link PollVotePayload.options} for readable text. */
58
58
  selectedOptions: string[];
59
- /** The option text the voter picked. Needs the original poll in the store; empty when unavailable. */
60
- options(): Promise<string[]>;
61
59
  voter: SenderInfo;
62
60
  timestamp: number;
61
+ /** The option text the voter picked. Needs the original poll in the store; empty when unavailable. */
62
+ options(): Promise<string[]>;
63
63
  }
64
64
  export interface ButtonClickPayload {
65
65
  key: WAMessageKey;