baileys-joss 1.0.0 → 1.0.2

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.
Files changed (127) hide show
  1. package/README.md +2554 -78
  2. package/lib/Socket/business.d.ts +4 -0
  3. package/lib/Socket/business.d.ts.map +1 -1
  4. package/lib/Socket/chats.d.ts +4 -0
  5. package/lib/Socket/chats.d.ts.map +1 -1
  6. package/lib/Socket/chats.js +44 -1
  7. package/lib/Socket/chats.js.map +1 -1
  8. package/lib/Socket/communities.d.ts +4 -0
  9. package/lib/Socket/communities.d.ts.map +1 -1
  10. package/lib/Socket/groups.d.ts +4 -0
  11. package/lib/Socket/groups.d.ts.map +1 -1
  12. package/lib/Socket/index.d.ts +4 -0
  13. package/lib/Socket/index.d.ts.map +1 -1
  14. package/lib/Socket/messages-recv.d.ts +4 -0
  15. package/lib/Socket/messages-recv.d.ts.map +1 -1
  16. package/lib/Socket/messages-send.d.ts +4 -0
  17. package/lib/Socket/messages-send.d.ts.map +1 -1
  18. package/lib/Socket/messages-send.js +130 -1
  19. package/lib/Socket/messages-send.js.map +1 -1
  20. package/lib/Socket/newsletter.d.ts +4 -0
  21. package/lib/Socket/newsletter.d.ts.map +1 -1
  22. package/lib/Types/Message.d.ts +25 -1
  23. package/lib/Types/Message.d.ts.map +1 -1
  24. package/lib/Utils/activity-logger.d.ts +189 -0
  25. package/lib/Utils/activity-logger.d.ts.map +1 -0
  26. package/lib/Utils/activity-logger.js +418 -0
  27. package/lib/Utils/activity-logger.js.map +1 -0
  28. package/lib/Utils/anti-spam.d.ts +145 -0
  29. package/lib/Utils/anti-spam.d.ts.map +1 -0
  30. package/lib/Utils/anti-spam.js +398 -0
  31. package/lib/Utils/anti-spam.js.map +1 -0
  32. package/lib/Utils/auto-reply.d.ts +123 -0
  33. package/lib/Utils/auto-reply.d.ts.map +1 -0
  34. package/lib/Utils/auto-reply.js +234 -0
  35. package/lib/Utils/auto-reply.js.map +1 -0
  36. package/lib/Utils/broadcast.d.ts +121 -0
  37. package/lib/Utils/broadcast.d.ts.map +1 -0
  38. package/lib/Utils/broadcast.js +223 -0
  39. package/lib/Utils/broadcast.js.map +1 -0
  40. package/lib/Utils/bulk-messaging.d.ts +79 -0
  41. package/lib/Utils/bulk-messaging.d.ts.map +1 -0
  42. package/lib/Utils/bulk-messaging.js +148 -0
  43. package/lib/Utils/bulk-messaging.js.map +1 -0
  44. package/lib/Utils/chat-analytics.d.ts +92 -0
  45. package/lib/Utils/chat-analytics.d.ts.map +1 -0
  46. package/lib/Utils/chat-analytics.js +337 -0
  47. package/lib/Utils/chat-analytics.js.map +1 -0
  48. package/lib/Utils/chat-control.d.ts +156 -0
  49. package/lib/Utils/chat-control.d.ts.map +1 -0
  50. package/lib/Utils/chat-control.js +224 -0
  51. package/lib/Utils/chat-control.js.map +1 -0
  52. package/lib/Utils/chat-export.d.ts +75 -0
  53. package/lib/Utils/chat-export.d.ts.map +1 -0
  54. package/lib/Utils/chat-export.js +309 -0
  55. package/lib/Utils/chat-export.js.map +1 -0
  56. package/lib/Utils/content-detector.d.ts +199 -0
  57. package/lib/Utils/content-detector.d.ts.map +1 -0
  58. package/lib/Utils/content-detector.js +442 -0
  59. package/lib/Utils/content-detector.js.map +1 -0
  60. package/lib/Utils/index.d.ts +23 -0
  61. package/lib/Utils/index.d.ts.map +1 -1
  62. package/lib/Utils/index.js +52 -0
  63. package/lib/Utils/index.js.map +1 -1
  64. package/lib/Utils/link-scanner.d.ts +112 -0
  65. package/lib/Utils/link-scanner.d.ts.map +1 -0
  66. package/lib/Utils/link-scanner.js +433 -0
  67. package/lib/Utils/link-scanner.js.map +1 -0
  68. package/lib/Utils/media-downloader.d.ts +86 -0
  69. package/lib/Utils/media-downloader.d.ts.map +1 -0
  70. package/lib/Utils/media-downloader.js +269 -0
  71. package/lib/Utils/media-downloader.js.map +1 -0
  72. package/lib/Utils/meme-generator.d.ts +96 -0
  73. package/lib/Utils/meme-generator.d.ts.map +1 -0
  74. package/lib/Utils/meme-generator.js +368 -0
  75. package/lib/Utils/meme-generator.js.map +1 -0
  76. package/lib/Utils/message-search.d.ts +96 -0
  77. package/lib/Utils/message-search.d.ts.map +1 -0
  78. package/lib/Utils/message-search.js +261 -0
  79. package/lib/Utils/message-search.js.map +1 -0
  80. package/lib/Utils/messages-media.d.ts +20 -1
  81. package/lib/Utils/messages-media.d.ts.map +1 -1
  82. package/lib/Utils/messages-media.js +100 -5
  83. package/lib/Utils/messages-media.js.map +1 -1
  84. package/lib/Utils/messages.d.ts.map +1 -1
  85. package/lib/Utils/messages.js +14 -2
  86. package/lib/Utils/messages.js.map +1 -1
  87. package/lib/Utils/mini-games.d.ts +155 -0
  88. package/lib/Utils/mini-games.d.ts.map +1 -0
  89. package/lib/Utils/mini-games.js +445 -0
  90. package/lib/Utils/mini-games.js.map +1 -0
  91. package/lib/Utils/pomodoro.d.ts +139 -0
  92. package/lib/Utils/pomodoro.d.ts.map +1 -0
  93. package/lib/Utils/pomodoro.js +434 -0
  94. package/lib/Utils/pomodoro.js.map +1 -0
  95. package/lib/Utils/qr-generator.d.ts +95 -0
  96. package/lib/Utils/qr-generator.d.ts.map +1 -0
  97. package/lib/Utils/qr-generator.js +226 -0
  98. package/lib/Utils/qr-generator.js.map +1 -0
  99. package/lib/Utils/quotes.d.ts +110 -0
  100. package/lib/Utils/quotes.d.ts.map +1 -0
  101. package/lib/Utils/quotes.js +325 -0
  102. package/lib/Utils/quotes.js.map +1 -0
  103. package/lib/Utils/scheduling.d.ts +88 -0
  104. package/lib/Utils/scheduling.d.ts.map +1 -0
  105. package/lib/Utils/scheduling.js +163 -0
  106. package/lib/Utils/scheduling.js.map +1 -0
  107. package/lib/Utils/status-posting.d.ts +151 -0
  108. package/lib/Utils/status-posting.d.ts.map +1 -0
  109. package/lib/Utils/status-posting.js +162 -0
  110. package/lib/Utils/status-posting.js.map +1 -0
  111. package/lib/Utils/templates.d.ts +154 -0
  112. package/lib/Utils/templates.d.ts.map +1 -0
  113. package/lib/Utils/templates.js +368 -0
  114. package/lib/Utils/templates.js.map +1 -0
  115. package/lib/Utils/vcard.d.ts +86 -0
  116. package/lib/Utils/vcard.d.ts.map +1 -0
  117. package/lib/Utils/vcard.js +195 -0
  118. package/lib/Utils/vcard.js.map +1 -0
  119. package/lib/Utils/voice-note.d.ts +115 -0
  120. package/lib/Utils/voice-note.d.ts.map +1 -0
  121. package/lib/Utils/voice-note.js +212 -0
  122. package/lib/Utils/voice-note.js.map +1 -0
  123. package/lib/Utils/weather.d.ts +118 -0
  124. package/lib/Utils/weather.d.ts.map +1 -0
  125. package/lib/Utils/weather.js +362 -0
  126. package/lib/Utils/weather.js.map +1 -0
  127. package/package.json +6 -3
@@ -0,0 +1,226 @@
1
+ /**
2
+ * Baileys-Joss: QR Code Generator
3
+ *
4
+ * Generate QR code custom untuk pairing
5
+ */
6
+ /**
7
+ * Default QR code options
8
+ */
9
+ const DEFAULT_OPTIONS = {
10
+ size: 256,
11
+ errorCorrectionLevel: 'M',
12
+ foregroundColor: '#000000',
13
+ backgroundColor: '#FFFFFF',
14
+ margin: 4,
15
+ format: 'terminal',
16
+ logoSizeRatio: 0.2
17
+ };
18
+ /**
19
+ * Character sets for terminal rendering
20
+ */
21
+ const TERMINAL_CHARS = {
22
+ FULL: '██',
23
+ UPPER: '▀▀',
24
+ LOWER: '▄▄',
25
+ EMPTY: ' '
26
+ };
27
+ /**
28
+ * Simple QR code generator (uses qrcode library if available)
29
+ */
30
+ export class QRCodeGenerator {
31
+ constructor(options = {}) {
32
+ this.options = { ...DEFAULT_OPTIONS, ...options };
33
+ }
34
+ /**
35
+ * Generate QR code as terminal string (fallback without library)
36
+ */
37
+ async generateTerminal(data) {
38
+ try {
39
+ // Try to use qrcode library if available
40
+ const qrcode = await import('qrcode');
41
+ return await qrcode.toString(data, {
42
+ type: 'terminal',
43
+ small: true,
44
+ errorCorrectionLevel: this.options.errorCorrectionLevel
45
+ });
46
+ }
47
+ catch {
48
+ // Fallback: return placeholder message
49
+ return `
50
+ ┌─────────────────────────────────────┐
51
+ │ │
52
+ │ QR CODE PLACEHOLDER │
53
+ │ │
54
+ │ Install 'qrcode' package for │
55
+ │ actual QR code generation: │
56
+ │ │
57
+ │ npm install qrcode │
58
+ │ │
59
+ │ Data: ${data.substring(0, 20)}... │
60
+ │ │
61
+ └─────────────────────────────────────┘
62
+ `;
63
+ }
64
+ }
65
+ /**
66
+ * Generate QR code as SVG
67
+ */
68
+ async generateSvg(data) {
69
+ try {
70
+ const qrcode = await import('qrcode');
71
+ return await qrcode.toString(data, {
72
+ type: 'svg',
73
+ errorCorrectionLevel: this.options.errorCorrectionLevel,
74
+ margin: this.options.margin,
75
+ color: {
76
+ dark: this.options.foregroundColor,
77
+ light: this.options.backgroundColor
78
+ },
79
+ width: this.options.size
80
+ });
81
+ }
82
+ catch {
83
+ return `<svg xmlns="http://www.w3.org/2000/svg" width="${this.options.size}" height="${this.options.size}">
84
+ <rect width="100%" height="100%" fill="${this.options.backgroundColor}"/>
85
+ <text x="50%" y="50%" text-anchor="middle" fill="${this.options.foregroundColor}">QR Code (install qrcode package)</text>
86
+ </svg>`;
87
+ }
88
+ }
89
+ /**
90
+ * Generate QR code as base64 PNG
91
+ */
92
+ async generateBase64(data) {
93
+ try {
94
+ const qrcode = await import('qrcode');
95
+ return await qrcode.toDataURL(data, {
96
+ errorCorrectionLevel: this.options.errorCorrectionLevel,
97
+ margin: this.options.margin,
98
+ color: {
99
+ dark: this.options.foregroundColor,
100
+ light: this.options.backgroundColor
101
+ },
102
+ width: this.options.size
103
+ });
104
+ }
105
+ catch {
106
+ // Return a placeholder 1x1 pixel PNG
107
+ return 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==';
108
+ }
109
+ }
110
+ /**
111
+ * Generate QR code as Buffer (PNG)
112
+ */
113
+ async generateBuffer(data) {
114
+ try {
115
+ const qrcode = await import('qrcode');
116
+ return await qrcode.toBuffer(data, {
117
+ errorCorrectionLevel: this.options.errorCorrectionLevel,
118
+ margin: this.options.margin,
119
+ color: {
120
+ dark: this.options.foregroundColor,
121
+ light: this.options.backgroundColor
122
+ },
123
+ width: this.options.size
124
+ });
125
+ }
126
+ catch {
127
+ throw new Error('qrcode package is required for buffer generation. Install with: npm install qrcode');
128
+ }
129
+ }
130
+ /**
131
+ * Generate QR code based on format option
132
+ */
133
+ async generate(data) {
134
+ switch (this.options.format) {
135
+ case 'svg':
136
+ return this.generateSvg(data);
137
+ case 'base64':
138
+ case 'dataUrl':
139
+ return this.generateBase64(data);
140
+ case 'terminal':
141
+ default:
142
+ return this.generateTerminal(data);
143
+ }
144
+ }
145
+ /**
146
+ * Update options
147
+ */
148
+ setOptions(options) {
149
+ Object.assign(this.options, options);
150
+ }
151
+ }
152
+ /**
153
+ * Create a styled QR code for WhatsApp pairing
154
+ */
155
+ export const createWhatsAppQR = async (pairingCode, options = {}) => {
156
+ const generator = new QRCodeGenerator({
157
+ ...options,
158
+ foregroundColor: options.foregroundColor || '#128C7E', // WhatsApp green
159
+ backgroundColor: options.backgroundColor || '#FFFFFF',
160
+ errorCorrectionLevel: 'H' // High error correction for logo support
161
+ });
162
+ return generator.generateTerminal(pairingCode);
163
+ };
164
+ /**
165
+ * Create QR code generator instance
166
+ */
167
+ export const createQRGenerator = (options) => {
168
+ return new QRCodeGenerator(options);
169
+ };
170
+ /**
171
+ * Quick QR code generation helpers
172
+ */
173
+ export const QRHelper = {
174
+ /**
175
+ * Generate terminal QR
176
+ */
177
+ terminal: async (data) => {
178
+ const generator = new QRCodeGenerator({ format: 'terminal' });
179
+ return generator.generateTerminal(data);
180
+ },
181
+ /**
182
+ * Generate SVG QR
183
+ */
184
+ svg: async (data, options) => {
185
+ const generator = new QRCodeGenerator({ ...options, format: 'svg' });
186
+ return generator.generateSvg(data);
187
+ },
188
+ /**
189
+ * Generate base64 QR
190
+ */
191
+ base64: async (data, options) => {
192
+ const generator = new QRCodeGenerator({ ...options, format: 'base64' });
193
+ return generator.generateBase64(data);
194
+ },
195
+ /**
196
+ * Generate buffer QR
197
+ */
198
+ buffer: async (data, options) => {
199
+ const generator = new QRCodeGenerator(options);
200
+ return generator.generateBuffer(data);
201
+ }
202
+ };
203
+ /**
204
+ * Create a QR code handler with custom rendering
205
+ */
206
+ export const createQRHandler = (options = {}) => {
207
+ const generator = new QRCodeGenerator(options);
208
+ let attempts = 0;
209
+ const maxAttempts = options.maxAttempts || 5;
210
+ return async (qr) => {
211
+ attempts++;
212
+ if (attempts > maxAttempts) {
213
+ console.log(`Maximum QR code attempts (${maxAttempts}) reached`);
214
+ return;
215
+ }
216
+ const rendered = await generator.generateTerminal(qr);
217
+ if (options.onQR) {
218
+ options.onQR(rendered, qr, attempts);
219
+ }
220
+ else {
221
+ console.log(`\nScan QR Code (Attempt ${attempts}/${maxAttempts}):\n`);
222
+ console.log(rendered);
223
+ }
224
+ };
225
+ };
226
+ //# sourceMappingURL=qr-generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qr-generator.js","sourceRoot":"","sources":["../../src/Utils/qr-generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAqBH;;GAEG;AACH,MAAM,eAAe,GAA0C;IAC9D,IAAI,EAAE,GAAG;IACT,oBAAoB,EAAE,GAAG;IACzB,eAAe,EAAE,SAAS;IAC1B,eAAe,EAAE,SAAS;IAC1B,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,UAAU;IAClB,aAAa,EAAE,GAAG;CAClB,CAAA;AAED;;GAEG;AACH,MAAM,cAAc,GAAG;IACtB,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;CACX,CAAA;AAED;;GAEG;AACH,MAAM,OAAO,eAAe;IAG3B,YAAY,UAAyB,EAAE;QACtC,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG,eAAe,EAAE,GAAG,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C,IAAI,EAAE,CAAC;YAClB,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAA;QACrC,CAAC;aAAM,CAAC;YACP,OAAO,CAAC,GAAG,CAAC,2BAA2B,QAAQ,IAAI,WAAW,MAAM,CAAC,CAAA;YACrE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACtB,CAAC;IACF,CAAC,CAAA;AACF,CAAC,CAAA"}
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Baileys-Joss: Quote Generator
3
+ *
4
+ * Random quotes, motivational quotes, dan quotes harian
5
+ */
6
+ export interface Quote {
7
+ id: string;
8
+ text: string;
9
+ author: string;
10
+ category: QuoteCategory;
11
+ language: 'en' | 'id' | string;
12
+ tags?: string[];
13
+ }
14
+ export type QuoteCategory = 'motivational' | 'inspirational' | 'love' | 'life' | 'success' | 'friendship' | 'wisdom' | 'funny' | 'islamic' | 'philosophy';
15
+ export interface QuoteOfTheDay {
16
+ quote: Quote;
17
+ date: string;
18
+ }
19
+ export declare const QUOTES: Quote[];
20
+ export declare class QuoteManager {
21
+ private quotes;
22
+ private quotesOfTheDay;
23
+ private customQuotes;
24
+ constructor();
25
+ /**
26
+ * Get random quote
27
+ */
28
+ getRandomQuote(options?: {
29
+ category?: QuoteCategory;
30
+ language?: string;
31
+ tag?: string;
32
+ }): Quote;
33
+ /**
34
+ * Get quote of the day (same quote for entire day)
35
+ */
36
+ getQuoteOfTheDay(category?: QuoteCategory): QuoteOfTheDay;
37
+ /**
38
+ * Add custom quote
39
+ */
40
+ addQuote(quote: Omit<Quote, 'id'>): Quote;
41
+ /**
42
+ * Get all quotes by category
43
+ */
44
+ getByCategory(category: QuoteCategory): Quote[];
45
+ /**
46
+ * Get all quotes by author
47
+ */
48
+ getByAuthor(author: string): Quote[];
49
+ /**
50
+ * Search quotes by text
51
+ */
52
+ search(query: string): Quote[];
53
+ /**
54
+ * Format quote for display
55
+ */
56
+ formatQuote(quote: Quote, style?: 'simple' | 'fancy' | 'minimal'): string;
57
+ /**
58
+ * Get available categories
59
+ */
60
+ getCategories(): QuoteCategory[];
61
+ /**
62
+ * Get quote count
63
+ */
64
+ getQuoteCount(): {
65
+ total: number;
66
+ byCategory: Record<string, number>;
67
+ };
68
+ /**
69
+ * Get help message
70
+ */
71
+ getHelpMessage(): string;
72
+ /**
73
+ * Parse command and return formatted quote
74
+ */
75
+ parseCommand(command: string): string;
76
+ /**
77
+ * Get category emoji
78
+ */
79
+ private getCategoryEmoji;
80
+ /**
81
+ * Capitalize first letter
82
+ */
83
+ private capitalizeFirst;
84
+ }
85
+ export declare const createQuoteManager: () => QuoteManager;
86
+ /**
87
+ * Get random quote
88
+ */
89
+ export declare const getRandomQuote: (category?: QuoteCategory) => string;
90
+ /**
91
+ * Get quote of the day
92
+ */
93
+ export declare const getQuoteOfTheDay: () => string;
94
+ /**
95
+ * Get motivational quote
96
+ */
97
+ export declare const getMotivationalQuote: () => string;
98
+ /**
99
+ * Get Islamic quote
100
+ */
101
+ export declare const getIslamicQuote: () => string;
102
+ /**
103
+ * Get funny quote
104
+ */
105
+ export declare const getFunnyQuote: () => string;
106
+ /**
107
+ * Parse quote command
108
+ */
109
+ export declare const quoteCommand: (cmd: string) => string;
110
+ //# sourceMappingURL=quotes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quotes.d.ts","sourceRoot":"","sources":["../../src/Utils/quotes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,MAAM,WAAW,KAAK;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,aAAa,CAAA;IACvB,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,CAAA;IAC9B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;CACf;AAED,MAAM,MAAM,aAAa,GACtB,cAAc,GACd,eAAe,GACf,MAAM,GACN,MA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,OAAO,EAAE,MAAM,GAAG,MAAM;IAqDrC;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAgBxB;;OAEG;IACH,OAAO,CAAC,eAAe;CAGvB;AAMD,eAAO,MAAM,kBAAkB,QAAO,YAErC,CAAA;AAQD;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,WAAW,aAAa,KAAG,MAGzD,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAO,MAGnC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,QAAO,MAEvC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,QAAO,MAElC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,QAAO,MAEhC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,MAE1C,CAAA"}
@@ -0,0 +1,325 @@
1
+ /**
2
+ * Baileys-Joss: Quote Generator
3
+ *
4
+ * Random quotes, motivational quotes, dan quotes harian
5
+ */
6
+ // =====================================================
7
+ // BUILT-IN QUOTES DATABASE
8
+ // =====================================================
9
+ export const QUOTES = [
10
+ // Motivational - English
11
+ { id: 'mot1', text: 'The only way to do great work is to love what you do.', author: 'Steve Jobs', category: 'motivational', language: 'en', tags: ['work', 'passion'] },
12
+ { id: 'mot2', text: 'Success is not final, failure is not fatal: it is the courage to continue that counts.', author: 'Winston Churchill', category: 'motivational', language: 'en', tags: ['success', 'failure'] },
13
+ { id: 'mot3', text: 'Believe you can and you\'re halfway there.', author: 'Theodore Roosevelt', category: 'motivational', language: 'en', tags: ['belief'] },
14
+ { id: 'mot4', text: 'The future belongs to those who believe in the beauty of their dreams.', author: 'Eleanor Roosevelt', category: 'motivational', language: 'en', tags: ['dreams', 'future'] },
15
+ { id: 'mot5', text: 'It does not matter how slowly you go as long as you do not stop.', author: 'Confucius', category: 'motivational', language: 'en', tags: ['perseverance'] },
16
+ // Motivational - Indonesian
17
+ { id: 'mot6', text: 'Hidup ini seperti sepeda. Agar tetap seimbang, kau harus terus bergerak.', author: 'Albert Einstein', category: 'motivational', language: 'id', tags: ['life', 'balance'] },
18
+ { id: 'mot7', text: 'Kesuksesan adalah kemampuan untuk pergi dari satu kegagalan ke kegagalan lain tanpa kehilangan semangat.', author: 'Winston Churchill', category: 'motivational', language: 'id', tags: ['success'] },
19
+ { id: 'mot8', text: 'Jangan takut untuk memulai lagi dari awal. Kali ini, kamu tidak memulai dari nol, tapi dari pengalaman.', author: 'Unknown', category: 'motivational', language: 'id', tags: ['start', 'experience'] },
20
+ // Inspirational
21
+ { id: 'ins1', text: 'In the middle of every difficulty lies opportunity.', author: 'Albert Einstein', category: 'inspirational', language: 'en', tags: ['opportunity'] },
22
+ { id: 'ins2', text: 'The only impossible journey is the one you never begin.', author: 'Tony Robbins', category: 'inspirational', language: 'en', tags: ['journey'] },
23
+ { id: 'ins3', text: 'Be the change you wish to see in the world.', author: 'Mahatma Gandhi', category: 'inspirational', language: 'en', tags: ['change'] },
24
+ { id: 'ins4', text: 'What lies behind us and what lies before us are tiny matters compared to what lies within us.', author: 'Ralph Waldo Emerson', category: 'inspirational', language: 'en', tags: ['inner strength'] },
25
+ // Life
26
+ { id: 'lif1', text: 'Life is what happens when you\'re busy making other plans.', author: 'John Lennon', category: 'life', language: 'en', tags: ['plans'] },
27
+ { id: 'lif2', text: 'The purpose of our lives is to be happy.', author: 'Dalai Lama', category: 'life', language: 'en', tags: ['happiness'] },
28
+ { id: 'lif3', text: 'Life is really simple, but we insist on making it complicated.', author: 'Confucius', category: 'life', language: 'en', tags: ['simplicity'] },
29
+ { id: 'lif4', text: 'Hidup itu bukan tentang menemukan diri sendiri. Hidup itu tentang menciptakan diri sendiri.', author: 'George Bernard Shaw', category: 'life', language: 'id', tags: ['self'] },
30
+ // Success
31
+ { id: 'suc1', text: 'Success usually comes to those who are too busy to be looking for it.', author: 'Henry David Thoreau', category: 'success', language: 'en', tags: ['busy', 'work'] },
32
+ { id: 'suc2', text: 'Don\'t be afraid to give up the good to go for the great.', author: 'John D. Rockefeller', category: 'success', language: 'en', tags: ['greatness'] },
33
+ { id: 'suc3', text: 'I find that the harder I work, the more luck I seem to have.', author: 'Thomas Jefferson', category: 'success', language: 'en', tags: ['luck', 'work'] },
34
+ // Wisdom
35
+ { id: 'wis1', text: 'The only true wisdom is in knowing you know nothing.', author: 'Socrates', category: 'wisdom', language: 'en', tags: ['knowledge'] },
36
+ { id: 'wis2', text: 'Knowledge speaks, but wisdom listens.', author: 'Jimi Hendrix', category: 'wisdom', language: 'en', tags: ['knowledge', 'listening'] },
37
+ { id: 'wis3', text: 'Turn your wounds into wisdom.', author: 'Oprah Winfrey', category: 'wisdom', language: 'en', tags: ['growth'] },
38
+ // Love
39
+ { id: 'lov1', text: 'The best thing to hold onto in life is each other.', author: 'Audrey Hepburn', category: 'love', language: 'en', tags: ['together'] },
40
+ { id: 'lov2', text: 'Love is composed of a single soul inhabiting two bodies.', author: 'Aristotle', category: 'love', language: 'en', tags: ['soul'] },
41
+ { id: 'lov3', text: 'Cinta sejati tidak datang dengan menemukan seseorang yang sempurna, tetapi dengan belajar melihat orang yang tidak sempurna dengan sempurna.', author: 'Sam Keen', category: 'love', language: 'id', tags: ['true love'] },
42
+ // Friendship
43
+ { id: 'fri1', text: 'A friend is someone who knows all about you and still loves you.', author: 'Elbert Hubbard', category: 'friendship', language: 'en', tags: ['friends'] },
44
+ { id: 'fri2', text: 'Friendship is born at that moment when one person says to another, "What! You too?"', author: 'C.S. Lewis', category: 'friendship', language: 'en', tags: ['connection'] },
45
+ // Funny
46
+ { id: 'fun1', text: 'I\'m not lazy. I\'m just on energy saving mode.', author: 'Unknown', category: 'funny', language: 'en', tags: ['lazy'] },
47
+ { id: 'fun2', text: 'I\'m not arguing. I\'m just explaining why I\'m right.', author: 'Unknown', category: 'funny', language: 'en', tags: ['argument'] },
48
+ { id: 'fun3', text: 'My bed is a magical place where I suddenly remember everything I forgot to do.', author: 'Unknown', category: 'funny', language: 'en', tags: ['sleep'] },
49
+ { id: 'fun4', text: 'Aku tidak malas. Aku hanya sangat termotivasi untuk tidak melakukan apa-apa.', author: 'Unknown', category: 'funny', language: 'id', tags: ['lazy'] },
50
+ // Islamic
51
+ { id: 'isl1', text: 'Verily, with hardship comes ease.', author: 'Quran 94:6', category: 'islamic', language: 'en', tags: ['patience'] },
52
+ { id: 'isl2', text: 'Allah does not burden a soul beyond that it can bear.', author: 'Quran 2:286', category: 'islamic', language: 'en', tags: ['strength'] },
53
+ { id: 'isl3', text: 'Sesungguhnya sesudah kesulitan itu ada kemudahan.', author: 'QS. Al-Insyirah: 6', category: 'islamic', language: 'id', tags: ['patience'] },
54
+ { id: 'isl4', text: 'Barang siapa yang bersabar, maka Allah akan membuatnya sabar.', author: 'HR. Bukhari', category: 'islamic', language: 'id', tags: ['patience'] },
55
+ // Philosophy
56
+ { id: 'phi1', text: 'I think, therefore I am.', author: 'René Descartes', category: 'philosophy', language: 'en', tags: ['existence'] },
57
+ { id: 'phi2', text: 'The unexamined life is not worth living.', author: 'Socrates', category: 'philosophy', language: 'en', tags: ['life'] },
58
+ { id: 'phi3', text: 'He who has a why to live can bear almost any how.', author: 'Friedrich Nietzsche', category: 'philosophy', language: 'en', tags: ['purpose'] }
59
+ ];
60
+ // =====================================================
61
+ // QUOTE MANAGER CLASS
62
+ // =====================================================
63
+ export class QuoteManager {
64
+ constructor() {
65
+ this.quotes = [];
66
+ this.quotesOfTheDay = new Map();
67
+ this.customQuotes = [];
68
+ this.quotes = [...QUOTES];
69
+ }
70
+ /**
71
+ * Get random quote
72
+ */
73
+ getRandomQuote(options) {
74
+ let filtered = [...this.quotes, ...this.customQuotes];
75
+ if (options?.category) {
76
+ filtered = filtered.filter(q => q.category === options.category);
77
+ }
78
+ if (options?.language) {
79
+ filtered = filtered.filter(q => q.language === options.language);
80
+ }
81
+ if (options?.tag) {
82
+ const tagToFind = options.tag;
83
+ filtered = filtered.filter(q => q.tags?.includes(tagToFind));
84
+ }
85
+ if (filtered.length === 0) {
86
+ const idx = Math.floor(Math.random() * this.quotes.length);
87
+ return this.quotes[idx] ?? QUOTES[0];
88
+ }
89
+ const filteredIdx = Math.floor(Math.random() * filtered.length);
90
+ return filtered[filteredIdx] ?? QUOTES[0];
91
+ }
92
+ /**
93
+ * Get quote of the day (same quote for entire day)
94
+ */
95
+ getQuoteOfTheDay(category) {
96
+ const todayArr = new Date().toISOString().split('T');
97
+ const today = todayArr[0] ?? new Date().toDateString();
98
+ const key = `${today}_${category || 'all'}`;
99
+ const existingQotd = this.quotesOfTheDay.get(key);
100
+ if (existingQotd) {
101
+ return existingQotd;
102
+ }
103
+ const quote = this.getRandomQuote({ category });
104
+ const qotd = { quote, date: today };
105
+ this.quotesOfTheDay.set(key, qotd);
106
+ return qotd;
107
+ }
108
+ /**
109
+ * Add custom quote
110
+ */
111
+ addQuote(quote) {
112
+ const newQuote = {
113
+ ...quote,
114
+ id: `custom_${Date.now()}_${Math.random().toString(36).substring(7)}`
115
+ };
116
+ this.customQuotes.push(newQuote);
117
+ return newQuote;
118
+ }
119
+ /**
120
+ * Get all quotes by category
121
+ */
122
+ getByCategory(category) {
123
+ return [...this.quotes, ...this.customQuotes].filter(q => q.category === category);
124
+ }
125
+ /**
126
+ * Get all quotes by author
127
+ */
128
+ getByAuthor(author) {
129
+ const normalizedAuthor = author.toLowerCase();
130
+ return [...this.quotes, ...this.customQuotes].filter(q => q.author.toLowerCase().includes(normalizedAuthor));
131
+ }
132
+ /**
133
+ * Search quotes by text
134
+ */
135
+ search(query) {
136
+ const normalizedQuery = query.toLowerCase();
137
+ return [...this.quotes, ...this.customQuotes].filter(q => q.text.toLowerCase().includes(normalizedQuery) ||
138
+ q.author.toLowerCase().includes(normalizedQuery));
139
+ }
140
+ /**
141
+ * Format quote for display
142
+ */
143
+ formatQuote(quote, style = 'fancy') {
144
+ switch (style) {
145
+ case 'simple':
146
+ return `"${quote.text}"\n— ${quote.author}`;
147
+ case 'minimal':
148
+ return `${quote.text} - ${quote.author}`;
149
+ case 'fancy':
150
+ default:
151
+ const categoryEmoji = this.getCategoryEmoji(quote.category);
152
+ return [
153
+ `${categoryEmoji} *Quote of the Day*`,
154
+ '',
155
+ `_"${quote.text}"_`,
156
+ '',
157
+ `— *${quote.author}*`,
158
+ '',
159
+ `📂 ${this.capitalizeFirst(quote.category)}`
160
+ ].join('\n');
161
+ }
162
+ }
163
+ /**
164
+ * Get available categories
165
+ */
166
+ getCategories() {
167
+ const categories = new Set();
168
+ for (const quote of [...this.quotes, ...this.customQuotes]) {
169
+ categories.add(quote.category);
170
+ }
171
+ return Array.from(categories);
172
+ }
173
+ /**
174
+ * Get quote count
175
+ */
176
+ getQuoteCount() {
177
+ const allQuotes = [...this.quotes, ...this.customQuotes];
178
+ const byCategory = {};
179
+ for (const quote of allQuotes) {
180
+ byCategory[quote.category] = (byCategory[quote.category] || 0) + 1;
181
+ }
182
+ return { total: allQuotes.length, byCategory };
183
+ }
184
+ /**
185
+ * Get help message
186
+ */
187
+ getHelpMessage() {
188
+ const categories = this.getCategories();
189
+ return [
190
+ '💬 *Quote Generator - Help*',
191
+ '',
192
+ '*Commands:*',
193
+ '• /quote - Random quote',
194
+ '• /quote daily - Quote of the day',
195
+ '• /quote <category> - Quote by category',
196
+ '• /quote search <text> - Search quotes',
197
+ '• /quote list - List categories',
198
+ '',
199
+ '*Available Categories:*',
200
+ categories.map(c => `• ${c}`).join('\n')
201
+ ].join('\n');
202
+ }
203
+ /**
204
+ * Parse command and return formatted quote
205
+ */
206
+ parseCommand(command) {
207
+ const parts = command.toLowerCase().trim().split(/\s+/);
208
+ const action = parts[0];
209
+ switch (action) {
210
+ case 'daily':
211
+ case 'hari':
212
+ case 'harian':
213
+ const qotd = this.getQuoteOfTheDay();
214
+ return this.formatQuote(qotd.quote);
215
+ case 'search':
216
+ case 'cari':
217
+ const query = parts.slice(1).join(' ');
218
+ if (!query) {
219
+ return '❌ Please provide search query';
220
+ }
221
+ const results = this.search(query);
222
+ const firstResult = results[0];
223
+ if (results.length === 0 || !firstResult) {
224
+ return '❌ No quotes found';
225
+ }
226
+ return this.formatQuote(firstResult);
227
+ case 'list':
228
+ case 'categories':
229
+ case 'kategori':
230
+ const counts = this.getQuoteCount();
231
+ const lines = ['📂 *Quote Categories*', ''];
232
+ for (const [cat, count] of Object.entries(counts.byCategory)) {
233
+ lines.push(`• ${this.getCategoryEmoji(cat)} ${this.capitalizeFirst(cat)}: ${count}`);
234
+ }
235
+ lines.push('', `Total: ${counts.total} quotes`);
236
+ return lines.join('\n');
237
+ case 'help':
238
+ case 'bantuan':
239
+ return this.getHelpMessage();
240
+ default:
241
+ // Check if it's a category
242
+ const category = action;
243
+ if (this.getCategories().includes(category)) {
244
+ const quote = this.getRandomQuote({ category });
245
+ return this.formatQuote(quote);
246
+ }
247
+ // Default: random quote
248
+ const randomQuote = this.getRandomQuote();
249
+ return this.formatQuote(randomQuote);
250
+ }
251
+ }
252
+ /**
253
+ * Get category emoji
254
+ */
255
+ getCategoryEmoji(category) {
256
+ const emojis = {
257
+ motivational: '🔥',
258
+ inspirational: '✨',
259
+ love: '❤️',
260
+ life: '🌱',
261
+ success: '🏆',
262
+ friendship: '🤝',
263
+ wisdom: '🦉',
264
+ funny: '😂',
265
+ islamic: '☪️',
266
+ philosophy: '🤔'
267
+ };
268
+ return emojis[category] || '💬';
269
+ }
270
+ /**
271
+ * Capitalize first letter
272
+ */
273
+ capitalizeFirst(str) {
274
+ return str.charAt(0).toUpperCase() + str.slice(1);
275
+ }
276
+ }
277
+ // =====================================================
278
+ // FACTORY FUNCTION
279
+ // =====================================================
280
+ export const createQuoteManager = () => {
281
+ return new QuoteManager();
282
+ };
283
+ // =====================================================
284
+ // QUICK HELPERS
285
+ // =====================================================
286
+ const defaultManager = new QuoteManager();
287
+ /**
288
+ * Get random quote
289
+ */
290
+ export const getRandomQuote = (category) => {
291
+ const quote = defaultManager.getRandomQuote({ category });
292
+ return defaultManager.formatQuote(quote);
293
+ };
294
+ /**
295
+ * Get quote of the day
296
+ */
297
+ export const getQuoteOfTheDay = () => {
298
+ const qotd = defaultManager.getQuoteOfTheDay();
299
+ return defaultManager.formatQuote(qotd.quote);
300
+ };
301
+ /**
302
+ * Get motivational quote
303
+ */
304
+ export const getMotivationalQuote = () => {
305
+ return getRandomQuote('motivational');
306
+ };
307
+ /**
308
+ * Get Islamic quote
309
+ */
310
+ export const getIslamicQuote = () => {
311
+ return getRandomQuote('islamic');
312
+ };
313
+ /**
314
+ * Get funny quote
315
+ */
316
+ export const getFunnyQuote = () => {
317
+ return getRandomQuote('funny');
318
+ };
319
+ /**
320
+ * Parse quote command
321
+ */
322
+ export const quoteCommand = (cmd) => {
323
+ return defaultManager.parseCommand(cmd);
324
+ };
325
+ //# sourceMappingURL=quotes.js.map