@kaikybrofc/omnizap-system 2.1.8

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 (166) hide show
  1. package/.env.example +534 -0
  2. package/LICENSE +21 -0
  3. package/README.md +431 -0
  4. package/RELEASE-v2.1.2.md +83 -0
  5. package/app/config/adminIdentity.js +87 -0
  6. package/app/config/baileysConfig.js +693 -0
  7. package/app/config/groupUtils.js +388 -0
  8. package/app/connection/socketController.js +992 -0
  9. package/app/controllers/messageController.js +354 -0
  10. package/app/modules/adminModule/groupCommandHandlers.js +1294 -0
  11. package/app/modules/adminModule/groupEventHandlers.js +355 -0
  12. package/app/modules/aiModule/catCommand.js +1006 -0
  13. package/app/modules/broadcastModule/noticeCommand.js +416 -0
  14. package/app/modules/gameModule/diceCommand.js +67 -0
  15. package/app/modules/menuModule/common.js +311 -0
  16. package/app/modules/menuModule/menus.js +59 -0
  17. package/app/modules/playModule/playCommand.js +1615 -0
  18. package/app/modules/quoteModule/quoteCommand.js +851 -0
  19. package/app/modules/rpgPokemonModule/rpgBattleCanvasRenderer.js +786 -0
  20. package/app/modules/rpgPokemonModule/rpgBattleService.js +2082 -0
  21. package/app/modules/rpgPokemonModule/rpgBattleService.test.js +760 -0
  22. package/app/modules/rpgPokemonModule/rpgEvolutionUtils.js +22 -0
  23. package/app/modules/rpgPokemonModule/rpgPokemonCommand.js +172 -0
  24. package/app/modules/rpgPokemonModule/rpgPokemonDomain.js +192 -0
  25. package/app/modules/rpgPokemonModule/rpgPokemonDomain.test.js +93 -0
  26. package/app/modules/rpgPokemonModule/rpgPokemonEvolution.test.js +46 -0
  27. package/app/modules/rpgPokemonModule/rpgPokemonMessages.js +746 -0
  28. package/app/modules/rpgPokemonModule/rpgPokemonRepository.js +1859 -0
  29. package/app/modules/rpgPokemonModule/rpgPokemonService.js +6738 -0
  30. package/app/modules/rpgPokemonModule/rpgProfileCanvasRenderer.js +354 -0
  31. package/app/modules/statsModule/globalRankingCommand.js +65 -0
  32. package/app/modules/statsModule/noMessageCommand.js +288 -0
  33. package/app/modules/statsModule/rankingCommand.js +60 -0
  34. package/app/modules/statsModule/rankingCommon.js +889 -0
  35. package/app/modules/stickerModule/addStickerMetadata.js +239 -0
  36. package/app/modules/stickerModule/convertToWebp.js +390 -0
  37. package/app/modules/stickerModule/stickerCommand.js +454 -0
  38. package/app/modules/stickerModule/stickerConvertCommand.js +156 -0
  39. package/app/modules/stickerModule/stickerTextCommand.js +657 -0
  40. package/app/modules/stickerPackModule/autoPackCollectorRuntime.js +20 -0
  41. package/app/modules/stickerPackModule/autoPackCollectorService.js +284 -0
  42. package/app/modules/stickerPackModule/semanticReclassificationEngine.js +466 -0
  43. package/app/modules/stickerPackModule/semanticReclassificationEngine.test.js +88 -0
  44. package/app/modules/stickerPackModule/semanticThemeClusterService.js +571 -0
  45. package/app/modules/stickerPackModule/stickerAssetClassificationRepository.js +449 -0
  46. package/app/modules/stickerPackModule/stickerAssetRepository.js +400 -0
  47. package/app/modules/stickerPackModule/stickerAssetReprocessQueueRepository.js +180 -0
  48. package/app/modules/stickerPackModule/stickerAutoPackByTagsRuntime.js +4078 -0
  49. package/app/modules/stickerPackModule/stickerClassificationBackgroundRuntime.js +598 -0
  50. package/app/modules/stickerPackModule/stickerClassificationService.js +588 -0
  51. package/app/modules/stickerPackModule/stickerMarketplaceDriftService.js +102 -0
  52. package/app/modules/stickerPackModule/stickerPackCatalogHttp.js +7506 -0
  53. package/app/modules/stickerPackModule/stickerPackCommandHandlers.js +1095 -0
  54. package/app/modules/stickerPackModule/stickerPackEngagementRepository.js +108 -0
  55. package/app/modules/stickerPackModule/stickerPackErrors.js +30 -0
  56. package/app/modules/stickerPackModule/stickerPackInteractionEventRepository.js +110 -0
  57. package/app/modules/stickerPackModule/stickerPackItemRepository.js +440 -0
  58. package/app/modules/stickerPackModule/stickerPackMarketplaceService.js +337 -0
  59. package/app/modules/stickerPackModule/stickerPackMessageService.js +296 -0
  60. package/app/modules/stickerPackModule/stickerPackRepository.js +442 -0
  61. package/app/modules/stickerPackModule/stickerPackService.js +788 -0
  62. package/app/modules/stickerPackModule/stickerPackServiceRuntime.js +51 -0
  63. package/app/modules/stickerPackModule/stickerPackUtils.js +97 -0
  64. package/app/modules/stickerPackModule/stickerStorageService.js +507 -0
  65. package/app/modules/stickerPackModule/stickerWorkerPipelineRuntime.js +233 -0
  66. package/app/modules/stickerPackModule/stickerWorkerTaskQueueRepository.js +205 -0
  67. package/app/modules/systemMetricsModule/pingCommand.js +421 -0
  68. package/app/modules/tiktokModule/tiktokCommand.js +798 -0
  69. package/app/modules/userModule/userCommand.js +1217 -0
  70. package/app/modules/waifuPicsModule/waifuPicsCommand.js +177 -0
  71. package/app/observability/metrics.js +734 -0
  72. package/app/services/captchaService.js +492 -0
  73. package/app/services/dbWriteQueue.js +572 -0
  74. package/app/services/groupMetadataService.js +279 -0
  75. package/app/services/lidMapService.js +663 -0
  76. package/app/services/messagePersistenceService.js +56 -0
  77. package/app/services/newsBroadcastService.js +351 -0
  78. package/app/services/pokeApiService.js +398 -0
  79. package/app/services/queueUtils.js +57 -0
  80. package/app/services/socketState.js +7 -0
  81. package/app/store/aiPromptStore.js +38 -0
  82. package/app/store/groupConfigStore.js +58 -0
  83. package/app/store/premiumUserStore.js +36 -0
  84. package/app/utils/antiLink/antiLinkModule.js +804 -0
  85. package/app/utils/http/getImageBufferModule.js +18 -0
  86. package/app/utils/json/jsonSanitizer.js +113 -0
  87. package/app/utils/json/jsonSanitizer.test.js +40 -0
  88. package/app/utils/logger/loggerModule.js +262 -0
  89. package/app/utils/systemMetrics/systemMetricsModule.js +91 -0
  90. package/database/index.js +2052 -0
  91. package/database/init.js +516 -0
  92. package/database/migrations/20260203_0001_sticker_packs.sql +54 -0
  93. package/database/migrations/20260210_0003_rpg_pokemon.sql +58 -0
  94. package/database/migrations/20260210_0004_rpg_shiny_biome.sql +9 -0
  95. package/database/migrations/20260210_0005_rpg_missions.sql +14 -0
  96. package/database/migrations/20260210_0006_rpg_world_pokedex_traits.sql +27 -0
  97. package/database/migrations/20260210_0007_rpg_raid_pvp.sql +56 -0
  98. package/database/migrations/20260210_0008_rpg_social_system.sql +195 -0
  99. package/database/migrations/20260211_0009_rpg_social_xp.sql +36 -0
  100. package/database/migrations/20260222_0010_remove_message_xp.sql +2 -0
  101. package/database/migrations/20260226_0011_sticker_asset_classification.sql +17 -0
  102. package/database/migrations/20260226_0012_sticker_pack_engagement.sql +16 -0
  103. package/database/migrations/20260226_0013_sticker_marketplace_intelligence.sql +19 -0
  104. package/database/migrations/20260226_0014_sticker_pack_publish_flow.sql +30 -0
  105. package/database/migrations/20260226_0014_sticker_worker_queues.sql +42 -0
  106. package/database/migrations/20260226_0015_sticker_auto_pack_curation_integrity.sql +18 -0
  107. package/database/migrations/20260226_0016_sticker_web_google_auth_persistence.sql +34 -0
  108. package/database/migrations/20260226_0017_sticker_web_admin_ban.sql +22 -0
  109. package/database/migrations/20260226_0018_sticker_web_admin_moderator.sql +18 -0
  110. package/database/migrations/20260227_0019_sticker_classification_v2_signals.sql +12 -0
  111. package/database/migrations/20260227_0020_semantic_theme_clusters.sql +35 -0
  112. package/docker-compose.yml +103 -0
  113. package/ecosystem.prod.config.cjs +35 -0
  114. package/eslint.config.js +61 -0
  115. package/index.js +437 -0
  116. package/ml/clip_classifier/Dockerfile +16 -0
  117. package/ml/clip_classifier/README.md +120 -0
  118. package/ml/clip_classifier/adaptive_scoring.py +40 -0
  119. package/ml/clip_classifier/classifier.py +654 -0
  120. package/ml/clip_classifier/embedding_store.py +481 -0
  121. package/ml/clip_classifier/env_loader.py +15 -0
  122. package/ml/clip_classifier/llm_label_expander.py +144 -0
  123. package/ml/clip_classifier/main.py +213 -0
  124. package/ml/clip_classifier/requirements.txt +10 -0
  125. package/ml/clip_classifier/similarity_engine.py +74 -0
  126. package/observability/alert-rules.yml +60 -0
  127. package/observability/grafana/dashboards/omnizap-mysql.json +136 -0
  128. package/observability/grafana/dashboards/omnizap-overview.json +170 -0
  129. package/observability/grafana/provisioning/dashboards/dashboards.yml +11 -0
  130. package/observability/grafana/provisioning/datasources/datasources.yml +15 -0
  131. package/observability/loki-config.yml +38 -0
  132. package/observability/mysql-exporter.cnf +5 -0
  133. package/observability/mysql-setup.sql +46 -0
  134. package/observability/prometheus.yml +32 -0
  135. package/observability/promtail-config.yml +84 -0
  136. package/package.json +109 -0
  137. package/public/api-docs/index.html +144 -0
  138. package/public/css/github-project-panel.css +297 -0
  139. package/public/css/stickers-admin.css +1272 -0
  140. package/public/css/styles.css +671 -0
  141. package/public/index.html +1311 -0
  142. package/public/js/apps/apiDocsApp.js +310 -0
  143. package/public/js/apps/createPackApp.js +2069 -0
  144. package/public/js/apps/homeApp.js +396 -0
  145. package/public/js/apps/stickersAdminApp.js +1744 -0
  146. package/public/js/apps/stickersApp.js +4830 -0
  147. package/public/js/catalog.js +1019 -0
  148. package/public/js/github-panel/components/CommitList.js +34 -0
  149. package/public/js/github-panel/components/ErrorState.js +16 -0
  150. package/public/js/github-panel/components/GithubProjectPanel.js +106 -0
  151. package/public/js/github-panel/components/ReleaseList.js +38 -0
  152. package/public/js/github-panel/components/SkeletonPanel.js +22 -0
  153. package/public/js/github-panel/components/StatCard.js +15 -0
  154. package/public/js/github-panel/index.js +15 -0
  155. package/public/js/github-panel/useGithubRepoData.js +154 -0
  156. package/public/js/github-panel/vendor/react.js +11 -0
  157. package/public/js/runtime/react-runtime.js +19 -0
  158. package/public/licenca/index.html +106 -0
  159. package/public/stickers/admin/index.html +23 -0
  160. package/public/stickers/create/index.html +47 -0
  161. package/public/stickers/index.html +48 -0
  162. package/public/termos-de-uso/index.html +125 -0
  163. package/scripts/cache-bust.mjs +107 -0
  164. package/scripts/deploy.sh +458 -0
  165. package/scripts/github-deploy-notify.mjs +174 -0
  166. package/scripts/release.sh +129 -0
@@ -0,0 +1,311 @@
1
+ import { getWaifuPicsUsageText } from '../waifuPicsModule/waifuPicsCommand.js';
2
+
3
+ export const buildMenuCaption = (senderName, commandPrefix) => `
4
+ Olá, ${senderName}. Seja bem-vindo(a)!
5
+
6
+ ━━━━━━━━━━━━━━━━━━━━
7
+ 📌 MENU PRINCIPAL
8
+ ━━━━━━━━━━━━━━━━━━━━
9
+
10
+ Selecione uma categoria para visualizar os comandos disponíveis:
11
+
12
+ • 🖼️ Figurinhas
13
+ → ${commandPrefix}menu figurinhas
14
+ 💡 Exemplo: ${commandPrefix}menu figurinhas
15
+
16
+ • 🎵 Mídia
17
+ → ${commandPrefix}menu midia
18
+ 💡 Exemplo: ${commandPrefix}menu midia
19
+
20
+ • 💬 Quotes
21
+ → ${commandPrefix}menu quote
22
+ 💡 Exemplo: ${commandPrefix}menu quote
23
+
24
+ • 🤖 Inteligência Artificial
25
+ → ${commandPrefix}menu ia
26
+ 💡 Exemplo: ${commandPrefix}menu ia
27
+
28
+ • 📊 Estatísticas
29
+ → ${commandPrefix}menu stats
30
+ 💡 Exemplo: ${commandPrefix}menu stats
31
+
32
+ • 🌸 Anime
33
+ → ${commandPrefix}menu anime
34
+ 💡 Exemplo: ${commandPrefix}menu anime
35
+
36
+ • 🎮 Brincadeiras
37
+ → ${commandPrefix}dado
38
+ 💡 Exemplo: ${commandPrefix}dado
39
+
40
+ • 🛡️ Administração
41
+ → ${commandPrefix}menuadm
42
+ 💡 Exemplo: ${commandPrefix}menuadm
43
+
44
+ ━━━━━━━━━━━━━━━━━━━━
45
+ 📊 STATUS DO SISTEMA
46
+ ━━━━━━━━━━━━━━━━━━━━
47
+
48
+ → ${commandPrefix}ping
49
+ 💡 Exemplo: ${commandPrefix}ping
50
+ Sistema em evolução (beta)
51
+
52
+ ━━━━━━━━━━━━━━━━━━━━
53
+ 🌐 PROJETO OPEN SOURCE
54
+ ━━━━━━━━━━━━━━━━━━━━
55
+
56
+ GitHub:
57
+ https://github.com/kaikybrofc/omnizap-system
58
+
59
+ Site oficial:
60
+ https://omnizap.shop/
61
+ `;
62
+
63
+ export const buildStickerMenu = (commandPrefix) => `
64
+ ━━━━━━━━━━━━━━━━━━━━
65
+ 🖼️ FIGURINHAS
66
+ ━━━━━━━━━━━━━━━━━━━━
67
+
68
+ Imagem ou GIF
69
+ • Responda uma mídia com:
70
+ → ${commandPrefix}sticker | ${commandPrefix}s
71
+ 💡 Exemplo: (na legenda da mídia) ${commandPrefix}s
72
+
73
+ • Ou envie com legenda usando o mesmo comando.
74
+
75
+ ━━━━━━━━━━━━━━━━━━━━
76
+ 📝 TEXTO
77
+ ━━━━━━━━━━━━━━━━━━━━
78
+
79
+ • Texto padrão (preto):
80
+ → ${commandPrefix}stickertext | ${commandPrefix}st
81
+ 💡 Exemplo: ${commandPrefix}st Bom dia, equipe
82
+
83
+ • Texto alternativo (branco):
84
+ → ${commandPrefix}stickertextwhite | ${commandPrefix}stw
85
+ 💡 Exemplo: ${commandPrefix}stw Bora trabalhar
86
+
87
+ ━━━━━━━━━━━━━━━━━━━━
88
+ ✨ TEXTO PISCANTE
89
+ ━━━━━━━━━━━━━━━━━━━━
90
+
91
+ → ${commandPrefix}stickertextblink | ${commandPrefix}stb
92
+ 💡 Exemplo: ${commandPrefix}stb bom dia -verde
93
+
94
+ ━━━━━━━━━━━━━━━━━━━━
95
+ 🔁 CONVERSÃO
96
+ ━━━━━━━━━━━━━━━━━━━━
97
+
98
+ • Responda uma figurinha com:
99
+ → ${commandPrefix}toimg
100
+ 💡 Exemplo: responda uma figurinha com ${commandPrefix}toimg
101
+
102
+ Resultado:
103
+ – Figurinha estática → imagem
104
+ – Figurinha animada → vídeo
105
+
106
+ ━━━━━━━━━━━━━━━━━━━━
107
+ 📦 STICKER PACKS
108
+ ━━━━━━━━━━━━━━━━━━━━
109
+
110
+ → ${commandPrefix}pack create "Meu Pack"
111
+ 💡 Exemplo: ${commandPrefix}pack create "Memes da Firma"
112
+
113
+ → ${commandPrefix}pack add <pack>
114
+ 💡 Exemplo: ${commandPrefix}pack add "Memes da Firma"
115
+
116
+ → ${commandPrefix}pack list
117
+ 💡 Exemplo: ${commandPrefix}pack list
118
+
119
+ → ${commandPrefix}pack send <pack>
120
+ 💡 Exemplo: ${commandPrefix}pack send "Memes da Firma"
121
+ `;
122
+
123
+ export const buildMediaMenu = (commandPrefix) => `
124
+ ━━━━━━━━━━━━━━━━━━━━
125
+ 🎵 MÍDIA
126
+ ━━━━━━━━━━━━━━━━━━━━
127
+
128
+ → ${commandPrefix}play <link ou termo> (áudio)
129
+ 💡 Exemplo: ${commandPrefix}play Coldplay Yellow
130
+
131
+ → ${commandPrefix}playvid <link ou termo> (vídeo)
132
+ 💡 Exemplo: ${commandPrefix}playvid Imagine Dragons Believer
133
+
134
+ → ${commandPrefix}tiktok <link> (TikTok HD)
135
+ 💡 Exemplo: ${commandPrefix}tiktok https://www.tiktok.com/@usuario/video/123
136
+ `;
137
+
138
+ export const buildQuoteMenu = (commandPrefix) => `
139
+ ━━━━━━━━━━━━━━━━━━━━
140
+ 💬 QUOTES
141
+ ━━━━━━━━━━━━━━━━━━━━
142
+
143
+ → ${commandPrefix}quote
144
+ 💡 Exemplo: responda uma mensagem com ${commandPrefix}quote
145
+ Responda uma mensagem ou envie um texto.
146
+ `;
147
+
148
+ export const buildAnimeMenu = (commandPrefix) => `
149
+ ━━━━━━━━━━━━━━━━━━━━
150
+ 🌸 ANIME
151
+ ━━━━━━━━━━━━━━━━━━━━
152
+
153
+ ${getWaifuPicsUsageText(commandPrefix)}
154
+ `;
155
+
156
+ export const buildAiMenu = (commandPrefix) => `
157
+ ━━━━━━━━━━━━━━━━━━━━
158
+ 🤖 INTELIGÊNCIA ARTIFICIAL
159
+ ━━━━━━━━━━━━━━━━━━━━
160
+
161
+ → ${commandPrefix}cat <mensagem ou pergunta> [--audio]
162
+ 💡 Exemplo: ${commandPrefix}cat Explique buraco negro em 1 minuto
163
+ Responda ou envie uma imagem com legenda.
164
+
165
+ → ${commandPrefix}catimg <prompt>
166
+ 💡 Exemplo: ${commandPrefix}catimg um gato astronauta na lua
167
+ Geração ou edição de imagens por IA.
168
+
169
+ → ${commandPrefix}catprompt <novo prompt>
170
+ 💡 Exemplo: ${commandPrefix}catprompt Responda em português e direto ao ponto
171
+
172
+ → ${commandPrefix}catprompt reset
173
+ 💡 Exemplo: ${commandPrefix}catprompt reset
174
+ `;
175
+
176
+ export const buildStatsMenu = (commandPrefix) => `
177
+ ━━━━━━━━━━━━━━━━━━━━
178
+ 📊 ESTATÍSTICAS
179
+ ━━━━━━━━━━━━━━━━━━━━
180
+
181
+ → ${commandPrefix}ranking
182
+ 💡 Exemplo: ${commandPrefix}ranking
183
+ Ranking do grupo (top 5)
184
+
185
+ → ${commandPrefix}rankingglobal
186
+ 💡 Exemplo: ${commandPrefix}rankingglobal
187
+ Ranking geral do bot
188
+
189
+ → ${commandPrefix}semmsg
190
+ 💡 Exemplo: ${commandPrefix}semmsg
191
+ Membros inativos
192
+
193
+ → ${commandPrefix}ping
194
+ 💡 Exemplo: ${commandPrefix}ping
195
+ Status do sistema
196
+
197
+ → ${commandPrefix}user perfil <id|telefone>
198
+ 💡 Exemplo: ${commandPrefix}user perfil 5511999999999
199
+ Resumo rápido de um usuário
200
+ `;
201
+
202
+ export const buildStickerBlinkCaption = (commandPrefix) => `
203
+ ━━━━━━━━━━━━━━━━━━━━
204
+ ✨ FIGURINHAS — TEXTO PISCANTE
205
+ ━━━━━━━━━━━━━━━━━━━━
206
+
207
+ → ${commandPrefix}stickertextblink | ${commandPrefix}stb
208
+ 💡 Exemplo: ${commandPrefix}stb foco total -azul
209
+
210
+ Para definir cor, use “-cor” ao final:
211
+ 💡 Exemplo:
212
+ → ${commandPrefix}stb bom dia -verde
213
+
214
+ Cores disponíveis:
215
+ -branco, -preto, -vermelho, -verde, -azul, -amarelo, -rosa, -roxo, -laranja
216
+ `;
217
+
218
+ export const buildAdminMenu = (commandPrefix = '/') => `
219
+ ━━━━━━━━━━━━━━━━━━━━
220
+ 🛡️ ADMINISTRAÇÃO
221
+ ━━━━━━━━━━━━━━━━━━━━
222
+
223
+ Membros
224
+ → ${commandPrefix}add @user
225
+ 💡 Exemplo: ${commandPrefix}add @joao
226
+
227
+ → ${commandPrefix}ban @user
228
+ 💡 Exemplo: ${commandPrefix}ban @maria
229
+
230
+ → ${commandPrefix}up @user
231
+ 💡 Exemplo: ${commandPrefix}up @carlos
232
+
233
+ → ${commandPrefix}down @user
234
+ 💡 Exemplo: ${commandPrefix}down @carlos
235
+
236
+ Grupo
237
+ → ${commandPrefix}setsubject <texto>
238
+ 💡 Exemplo: ${commandPrefix}setsubject Avisos do Projeto
239
+
240
+ → ${commandPrefix}setdesc <texto>
241
+ 💡 Exemplo: ${commandPrefix}setdesc Grupo oficial da equipe
242
+
243
+ → ${commandPrefix}setgroup <announcement|not_announcement|locked|unlocked>
244
+ 💡 Exemplo: ${commandPrefix}setgroup announcement
245
+
246
+ → ${commandPrefix}invite
247
+ 💡 Exemplo: ${commandPrefix}invite
248
+
249
+ → ${commandPrefix}revoke
250
+ 💡 Exemplo: ${commandPrefix}revoke
251
+
252
+ → ${commandPrefix}leave
253
+ 💡 Exemplo: ${commandPrefix}leave
254
+
255
+ Solicitações
256
+ → ${commandPrefix}requests
257
+ 💡 Exemplo: ${commandPrefix}requests
258
+
259
+ → ${commandPrefix}updaterequests <approve|reject> @user
260
+ 💡 Exemplo: ${commandPrefix}updaterequests approve @joao
261
+
262
+ → ${commandPrefix}autorequests <on|off|status>
263
+ 💡 Exemplo: ${commandPrefix}autorequests status
264
+
265
+ Gerais
266
+ → ${commandPrefix}newgroup <título> <users>
267
+ 💡 Exemplo: ${commandPrefix}newgroup "Time Produto" @ana @carlos
268
+
269
+ → ${commandPrefix}join <convite>
270
+ 💡 Exemplo: ${commandPrefix}join https://chat.whatsapp.com/ABCDE12345
271
+
272
+ → ${commandPrefix}info [grupo]
273
+ 💡 Exemplo: ${commandPrefix}info
274
+
275
+ → ${commandPrefix}metadata [grupo]
276
+ 💡 Exemplo: ${commandPrefix}metadata
277
+
278
+ → ${commandPrefix}groups
279
+ 💡 Exemplo: ${commandPrefix}groups
280
+
281
+ Outros
282
+ → ${commandPrefix}temp <segundos>
283
+ 💡 Exemplo: ${commandPrefix}temp 60
284
+
285
+ → ${commandPrefix}addmode <all_member_add|admin_add>
286
+ 💡 Exemplo: ${commandPrefix}addmode admin_add
287
+
288
+ → ${commandPrefix}welcome <on|off|set>
289
+ 💡 Exemplo: ${commandPrefix}welcome on
290
+
291
+ → ${commandPrefix}farewell <on|off|set>
292
+ 💡 Exemplo: ${commandPrefix}farewell on
293
+
294
+ → ${commandPrefix}premium <add|remove|list>
295
+ 💡 Exemplo: ${commandPrefix}premium list
296
+
297
+ → ${commandPrefix}nsfw <on|off|status>
298
+ 💡 Exemplo: ${commandPrefix}nsfw status
299
+
300
+ → ${commandPrefix}autosticker <on|off|status>
301
+ 💡 Exemplo: ${commandPrefix}autosticker on
302
+
303
+ → ${commandPrefix}noticias <on|off|status>
304
+ 💡 Exemplo: ${commandPrefix}noticias on
305
+
306
+ → ${commandPrefix}prefix <novo|status|reset>
307
+ 💡 Exemplo: ${commandPrefix}prefix !
308
+
309
+ → ${commandPrefix}captcha <on|off|status>
310
+ 💡 Exemplo: ${commandPrefix}captcha on
311
+ `;
@@ -0,0 +1,59 @@
1
+ import logger from '../../utils/logger/loggerModule.js';
2
+ import { buildAnimeMenu, buildAiMenu, buildMediaMenu, buildMenuCaption, buildQuoteMenu, buildStatsMenu, buildStickerMenu, buildAdminMenu } from './common.js';
3
+ import getImageBuffer from '../../utils/http/getImageBufferModule.js';
4
+ import { sendAndStore } from '../../services/messagePersistenceService.js';
5
+
6
+ const MENU_IMAGE_ENV = 'IMAGE_MENU';
7
+
8
+ const sendMenuImage = async (sock, remoteJid, messageInfo, expirationMessage, caption) => {
9
+ const imageUrl = process.env[MENU_IMAGE_ENV];
10
+ if (!imageUrl) {
11
+ logger.error('IMAGE_MENU environment variable not set.');
12
+ await sendAndStore(sock, remoteJid, { text: 'Ocorreu um erro ao carregar o menu.' }, { quoted: messageInfo, ephemeralExpiration: expirationMessage });
13
+ return;
14
+ }
15
+
16
+ try {
17
+ const imageBuffer = await getImageBuffer(imageUrl);
18
+ await sendAndStore(
19
+ sock,
20
+ remoteJid,
21
+ {
22
+ image: imageBuffer,
23
+ caption,
24
+ },
25
+ { quoted: messageInfo, ephemeralExpiration: expirationMessage },
26
+ );
27
+ } catch (error) {
28
+ logger.error('Error fetching menu image:', error);
29
+ await sendAndStore(sock, remoteJid, { text: 'Ocorreu um erro ao carregar a imagem do menu.' }, { quoted: messageInfo, ephemeralExpiration: expirationMessage });
30
+ }
31
+ };
32
+
33
+ export async function handleMenuCommand(sock, remoteJid, messageInfo, expirationMessage, senderName, commandPrefix, args = []) {
34
+ const category = args?.[0]?.toLowerCase();
35
+ const categoryMap = new Map([
36
+ ['figurinhas', (prefix) => buildStickerMenu(prefix)],
37
+ ['sticker', (prefix) => buildStickerMenu(prefix)],
38
+ ['stickers', (prefix) => buildStickerMenu(prefix)],
39
+ ['midia', (prefix) => buildMediaMenu(prefix)],
40
+ ['media', (prefix) => buildMediaMenu(prefix)],
41
+ ['quote', (prefix) => buildQuoteMenu(prefix)],
42
+ ['quotes', (prefix) => buildQuoteMenu(prefix)],
43
+ ['ia', (prefix) => buildAiMenu(prefix)],
44
+ ['ai', (prefix) => buildAiMenu(prefix)],
45
+ ['stats', (prefix) => buildStatsMenu(prefix)],
46
+ ['estatisticas', (prefix) => buildStatsMenu(prefix)],
47
+ ['estatistica', (prefix) => buildStatsMenu(prefix)],
48
+ ['anime', (prefix) => buildAnimeMenu(prefix)],
49
+ ]);
50
+
51
+ const buildCategory = categoryMap.get(category);
52
+ const caption = buildCategory ? buildCategory(commandPrefix).trim() : buildMenuCaption(senderName, commandPrefix).trim();
53
+
54
+ await sendMenuImage(sock, remoteJid, messageInfo, expirationMessage, caption);
55
+ }
56
+
57
+ export async function handleMenuAdmCommand(sock, remoteJid, messageInfo, expirationMessage, commandPrefix) {
58
+ await sendMenuImage(sock, remoteJid, messageInfo, expirationMessage, buildAdminMenu(commandPrefix).trim());
59
+ }