trompot 1.0.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.
- package/LICENSE +21 -0
- package/README.md +560 -0
- package/lib/bot/BotBase.d.ts +82 -0
- package/lib/bot/BotBase.js +144 -0
- package/lib/bot/BotBase.js.map +1 -0
- package/lib/bot/BotEvents.d.ts +87 -0
- package/lib/bot/BotEvents.js +51 -0
- package/lib/bot/BotEvents.js.map +1 -0
- package/lib/bot/BotServer.d.ts +34 -0
- package/lib/bot/BotServer.js +118 -0
- package/lib/bot/BotServer.js.map +1 -0
- package/lib/bot/BotStatus.d.ts +4 -0
- package/lib/bot/BotStatus.js +9 -0
- package/lib/bot/BotStatus.js.map +1 -0
- package/lib/bot/IBot.d.ts +292 -0
- package/lib/bot/IBot.js +3 -0
- package/lib/bot/IBot.js.map +1 -0
- package/lib/bot/index.d.ts +5 -0
- package/lib/bot/index.js +13 -0
- package/lib/bot/index.js.map +1 -0
- package/lib/client/Client.d.ts +120 -0
- package/lib/client/Client.js +687 -0
- package/lib/client/Client.js.map +1 -0
- package/lib/client/ClientEvents.d.ts +147 -0
- package/lib/client/ClientEvents.js +93 -0
- package/lib/client/ClientEvents.js.map +1 -0
- package/lib/client/ClientFunctionHandler.d.ts +15 -0
- package/lib/client/ClientFunctionHandler.js +70 -0
- package/lib/client/ClientFunctionHandler.js.map +1 -0
- package/lib/client/ConnectionType.d.ts +4 -0
- package/lib/client/ConnectionType.js +3 -0
- package/lib/client/ConnectionType.js.map +1 -0
- package/lib/client/IAuth.d.ts +9 -0
- package/lib/client/IAuth.js +3 -0
- package/lib/client/IAuth.js.map +1 -0
- package/lib/client/IClient.d.ts +358 -0
- package/lib/client/IClient.js +3 -0
- package/lib/client/IClient.js.map +1 -0
- package/lib/client/index.d.ts +7 -0
- package/lib/client/index.js +13 -0
- package/lib/client/index.js.map +1 -0
- package/lib/cluster/ClientCluster.d.ts +428 -0
- package/lib/cluster/ClientCluster.js +1746 -0
- package/lib/cluster/ClientCluster.js.map +1 -0
- package/lib/cluster/WorkerMessage.d.ts +99 -0
- package/lib/cluster/WorkerMessage.js +84 -0
- package/lib/cluster/WorkerMessage.js.map +1 -0
- package/lib/cluster/index.d.ts +5 -0
- package/lib/cluster/index.js +27 -0
- package/lib/cluster/index.js.map +1 -0
- package/lib/configs/ConnectionConfig.d.ts +22 -0
- package/lib/configs/ConnectionConfig.js +3 -0
- package/lib/configs/ConnectionConfig.js.map +1 -0
- package/lib/configs/Defaults.d.ts +2 -0
- package/lib/configs/Defaults.js +16 -0
- package/lib/configs/Defaults.js.map +1 -0
- package/lib/configs/WAConfigs.d.ts +1 -0
- package/lib/configs/WAConfigs.js +5 -0
- package/lib/configs/WAConfigs.js.map +1 -0
- package/lib/configs/index.d.ts +3 -0
- package/lib/configs/index.js +18 -0
- package/lib/configs/index.js.map +1 -0
- package/lib/errors/ChatNotDefinedError.d.ts +4 -0
- package/lib/errors/ChatNotDefinedError.js +9 -0
- package/lib/errors/ChatNotDefinedError.js.map +1 -0
- package/lib/errors/ClientNotDefinedError.d.ts +4 -0
- package/lib/errors/ClientNotDefinedError.js +9 -0
- package/lib/errors/ClientNotDefinedError.js.map +1 -0
- package/lib/errors/UserNotDefinedError.d.ts +4 -0
- package/lib/errors/UserNotDefinedError.js +9 -0
- package/lib/errors/UserNotDefinedError.js.map +1 -0
- package/lib/index.d.ts +17 -0
- package/lib/index.js +60 -0
- package/lib/index.js.map +1 -0
- package/lib/messages/AudioMessage.d.ts +42 -0
- package/lib/messages/AudioMessage.js +66 -0
- package/lib/messages/AudioMessage.js.map +1 -0
- package/lib/messages/ButtonMessage.d.ts +88 -0
- package/lib/messages/ButtonMessage.js +137 -0
- package/lib/messages/ButtonMessage.js.map +1 -0
- package/lib/messages/ContactMessage.d.ts +37 -0
- package/lib/messages/ContactMessage.js +93 -0
- package/lib/messages/ContactMessage.js.map +1 -0
- package/lib/messages/CustomMessage.d.ts +35 -0
- package/lib/messages/CustomMessage.js +88 -0
- package/lib/messages/CustomMessage.js.map +1 -0
- package/lib/messages/EmptyMessage.d.ts +25 -0
- package/lib/messages/EmptyMessage.js +78 -0
- package/lib/messages/EmptyMessage.js.map +1 -0
- package/lib/messages/ErrorMessage.d.ts +35 -0
- package/lib/messages/ErrorMessage.js +86 -0
- package/lib/messages/ErrorMessage.js.map +1 -0
- package/lib/messages/FileMessage.d.ts +36 -0
- package/lib/messages/FileMessage.js +60 -0
- package/lib/messages/FileMessage.js.map +1 -0
- package/lib/messages/ImageMessage.d.ts +41 -0
- package/lib/messages/ImageMessage.js +65 -0
- package/lib/messages/ImageMessage.js.map +1 -0
- package/lib/messages/ListMessage.d.ts +91 -0
- package/lib/messages/ListMessage.js +126 -0
- package/lib/messages/ListMessage.js.map +1 -0
- package/lib/messages/LocationMessage.d.ts +48 -0
- package/lib/messages/LocationMessage.js +107 -0
- package/lib/messages/LocationMessage.js.map +1 -0
- package/lib/messages/MediaMessage.d.ts +54 -0
- package/lib/messages/MediaMessage.js +113 -0
- package/lib/messages/MediaMessage.js.map +1 -0
- package/lib/messages/Message.d.ts +144 -0
- package/lib/messages/Message.js +223 -0
- package/lib/messages/Message.js.map +1 -0
- package/lib/messages/PollMessage.d.ts +87 -0
- package/lib/messages/PollMessage.js +145 -0
- package/lib/messages/PollMessage.js.map +1 -0
- package/lib/messages/PollUpdateMessage.d.ts +40 -0
- package/lib/messages/PollUpdateMessage.js +98 -0
- package/lib/messages/PollUpdateMessage.js.map +1 -0
- package/lib/messages/ReactionMessage.d.ts +36 -0
- package/lib/messages/ReactionMessage.js +91 -0
- package/lib/messages/ReactionMessage.js.map +1 -0
- package/lib/messages/StickerMessage.d.ts +49 -0
- package/lib/messages/StickerMessage.js +73 -0
- package/lib/messages/StickerMessage.js.map +1 -0
- package/lib/messages/TextMessage.d.ts +33 -0
- package/lib/messages/TextMessage.js +84 -0
- package/lib/messages/TextMessage.js.map +1 -0
- package/lib/messages/VideoMessage.d.ts +42 -0
- package/lib/messages/VideoMessage.js +66 -0
- package/lib/messages/VideoMessage.js.map +1 -0
- package/lib/messages/index.d.ts +19 -0
- package/lib/messages/index.js +81 -0
- package/lib/messages/index.js.map +1 -0
- package/lib/models/Address.d.ts +11 -0
- package/lib/models/Address.js +18 -0
- package/lib/models/Address.js.map +1 -0
- package/lib/models/Call.d.ts +68 -0
- package/lib/models/Call.js +127 -0
- package/lib/models/Call.js.map +1 -0
- package/lib/modules/chat/Chat.d.ts +142 -0
- package/lib/modules/chat/Chat.js +246 -0
- package/lib/modules/chat/Chat.js.map +1 -0
- package/lib/modules/chat/ChatAction.d.ts +3 -0
- package/lib/modules/chat/ChatAction.js +3 -0
- package/lib/modules/chat/ChatAction.js.map +1 -0
- package/lib/modules/chat/ChatStatus.d.ts +9 -0
- package/lib/modules/chat/ChatStatus.js +13 -0
- package/lib/modules/chat/ChatStatus.js.map +1 -0
- package/lib/modules/chat/ChatType.d.ts +7 -0
- package/lib/modules/chat/ChatType.js +11 -0
- package/lib/modules/chat/ChatType.js.map +1 -0
- package/lib/modules/chat/index.d.ts +5 -0
- package/lib/modules/chat/index.js +13 -0
- package/lib/modules/chat/index.js.map +1 -0
- package/lib/modules/command/Command.d.ts +67 -0
- package/lib/modules/command/Command.js +139 -0
- package/lib/modules/command/Command.js.map +1 -0
- package/lib/modules/command/CommandController.d.ts +50 -0
- package/lib/modules/command/CommandController.js +119 -0
- package/lib/modules/command/CommandController.js.map +1 -0
- package/lib/modules/command/CommandControllerEvent.d.ts +9 -0
- package/lib/modules/command/CommandControllerEvent.js +25 -0
- package/lib/modules/command/CommandControllerEvent.js.map +1 -0
- package/lib/modules/command/CommandEnums.d.ts +14 -0
- package/lib/modules/command/CommandEnums.js +20 -0
- package/lib/modules/command/CommandEnums.js.map +1 -0
- package/lib/modules/command/CommandKey.d.ts +17 -0
- package/lib/modules/command/CommandKey.js +67 -0
- package/lib/modules/command/CommandKey.js.map +1 -0
- package/lib/modules/command/CommandPermission.d.ts +9 -0
- package/lib/modules/command/CommandPermission.js +35 -0
- package/lib/modules/command/CommandPermission.js.map +1 -0
- package/lib/modules/command/ICommandControllerConfig.d.ts +7 -0
- package/lib/modules/command/ICommandControllerConfig.js +3 -0
- package/lib/modules/command/ICommandControllerConfig.js.map +1 -0
- package/lib/modules/command/advanced/AdvancedCommand.d.ts +23 -0
- package/lib/modules/command/advanced/AdvancedCommand.js +131 -0
- package/lib/modules/command/advanced/AdvancedCommand.js.map +1 -0
- package/lib/modules/command/advanced/AdvancedCommandContext.d.ts +10 -0
- package/lib/modules/command/advanced/AdvancedCommandContext.js +3 -0
- package/lib/modules/command/advanced/AdvancedCommandContext.js.map +1 -0
- package/lib/modules/command/advanced/AdvancedCommandController.d.ts +29 -0
- package/lib/modules/command/advanced/AdvancedCommandController.js +118 -0
- package/lib/modules/command/advanced/AdvancedCommandController.js.map +1 -0
- package/lib/modules/command/advanced/AdvancedCommandData.d.ts +6 -0
- package/lib/modules/command/advanced/AdvancedCommandData.js +3 -0
- package/lib/modules/command/advanced/AdvancedCommandData.js.map +1 -0
- package/lib/modules/command/advanced/AdvancedCommandJob.d.ts +12 -0
- package/lib/modules/command/advanced/AdvancedCommandJob.js +3 -0
- package/lib/modules/command/advanced/AdvancedCommandJob.js.map +1 -0
- package/lib/modules/command/advanced/AdvancedCommandNext.d.ts +4 -0
- package/lib/modules/command/advanced/AdvancedCommandNext.js +3 -0
- package/lib/modules/command/advanced/AdvancedCommandNext.js.map +1 -0
- package/lib/modules/command/advanced/AdvancedCommandOptions.d.ts +8 -0
- package/lib/modules/command/advanced/AdvancedCommandOptions.js +3 -0
- package/lib/modules/command/advanced/AdvancedCommandOptions.js.map +1 -0
- package/lib/modules/command/advanced/AdvancedCommandStart.d.ts +11 -0
- package/lib/modules/command/advanced/AdvancedCommandStart.js +3 -0
- package/lib/modules/command/advanced/AdvancedCommandStart.js.map +1 -0
- package/lib/modules/command/advanced/AdvancedCommandStop.d.ts +3 -0
- package/lib/modules/command/advanced/AdvancedCommandStop.js +3 -0
- package/lib/modules/command/advanced/AdvancedCommandStop.js.map +1 -0
- package/lib/modules/command/advanced/AdvancedCommandTask.d.ts +2 -0
- package/lib/modules/command/advanced/AdvancedCommandTask.js +3 -0
- package/lib/modules/command/advanced/AdvancedCommandTask.js.map +1 -0
- package/lib/modules/command/defaults.d.ts +2 -0
- package/lib/modules/command/defaults.js +8 -0
- package/lib/modules/command/defaults.js.map +1 -0
- package/lib/modules/command/index.d.ts +12 -0
- package/lib/modules/command/index.js +36 -0
- package/lib/modules/command/index.js.map +1 -0
- package/lib/modules/command/keys.d.ts +9 -0
- package/lib/modules/command/keys.js +27 -0
- package/lib/modules/command/keys.js.map +1 -0
- package/lib/modules/command/perms.d.ts +2 -0
- package/lib/modules/command/perms.js +11 -0
- package/lib/modules/command/perms.js.map +1 -0
- package/lib/modules/quickResponse/QuickResponse.d.ts +49 -0
- package/lib/modules/quickResponse/QuickResponse.js +64 -0
- package/lib/modules/quickResponse/QuickResponse.js.map +1 -0
- package/lib/modules/quickResponse/QuickResponseController.d.ts +55 -0
- package/lib/modules/quickResponse/QuickResponseController.js +125 -0
- package/lib/modules/quickResponse/QuickResponseController.js.map +1 -0
- package/lib/modules/quickResponse/QuickResponseOptions.d.ts +56 -0
- package/lib/modules/quickResponse/QuickResponseOptions.js +76 -0
- package/lib/modules/quickResponse/QuickResponseOptions.js.map +1 -0
- package/lib/modules/quickResponse/QuickResponsePattern.d.ts +28 -0
- package/lib/modules/quickResponse/QuickResponsePattern.js +3 -0
- package/lib/modules/quickResponse/QuickResponsePattern.js.map +1 -0
- package/lib/modules/quickResponse/QuickResponseReply.d.ts +6 -0
- package/lib/modules/quickResponse/QuickResponseReply.js +3 -0
- package/lib/modules/quickResponse/QuickResponseReply.js.map +1 -0
- package/lib/modules/quickResponse/index.d.ts +6 -0
- package/lib/modules/quickResponse/index.js +13 -0
- package/lib/modules/quickResponse/index.js.map +1 -0
- package/lib/modules/user/User.d.ts +91 -0
- package/lib/modules/user/User.js +173 -0
- package/lib/modules/user/User.js.map +1 -0
- package/lib/modules/user/UserAction.d.ts +4 -0
- package/lib/modules/user/UserAction.js +3 -0
- package/lib/modules/user/UserAction.js.map +1 -0
- package/lib/modules/user/UserEvent.d.ts +3 -0
- package/lib/modules/user/UserEvent.js +3 -0
- package/lib/modules/user/UserEvent.js.map +1 -0
- package/lib/modules/user/index.d.ts +4 -0
- package/lib/modules/user/index.js +9 -0
- package/lib/modules/user/index.js.map +1 -0
- package/lib/routes/botServer/api/v1/emitEvent.d.ts +3 -0
- package/lib/routes/botServer/api/v1/emitEvent.js +17 -0
- package/lib/routes/botServer/api/v1/emitEvent.js.map +1 -0
- package/lib/routes/botServer/api/v1/function.d.ts +3 -0
- package/lib/routes/botServer/api/v1/function.js +22 -0
- package/lib/routes/botServer/api/v1/function.js.map +1 -0
- package/lib/routes/botServer/api/v1/ping.d.ts +3 -0
- package/lib/routes/botServer/api/v1/ping.js +12 -0
- package/lib/routes/botServer/api/v1/ping.js.map +1 -0
- package/lib/routes/botServer/api/v1/register.d.ts +3 -0
- package/lib/routes/botServer/api/v1/register.js +23 -0
- package/lib/routes/botServer/api/v1/register.js.map +1 -0
- package/lib/routes/botServer/api/v1/setValue.d.ts +3 -0
- package/lib/routes/botServer/api/v1/setValue.js +18 -0
- package/lib/routes/botServer/api/v1/setValue.js.map +1 -0
- package/lib/routes/botServer/api/v1/unregister.d.ts +3 -0
- package/lib/routes/botServer/api/v1/unregister.js +22 -0
- package/lib/routes/botServer/api/v1/unregister.js.map +1 -0
- package/lib/routes/botServer/middlewares/setBotServer.d.ts +4 -0
- package/lib/routes/botServer/middlewares/setBotServer.js +16 -0
- package/lib/routes/botServer/middlewares/setBotServer.js.map +1 -0
- package/lib/routes/botServer/routes.d.ts +8 -0
- package/lib/routes/botServer/routes.js +33 -0
- package/lib/routes/botServer/routes.js.map +1 -0
- package/lib/services/AddressService.d.ts +12 -0
- package/lib/services/AddressService.js +51 -0
- package/lib/services/AddressService.js.map +1 -0
- package/lib/services/BaseService.d.ts +5 -0
- package/lib/services/BaseService.js +19 -0
- package/lib/services/BaseService.js.map +1 -0
- package/lib/services/index.d.ts +3 -0
- package/lib/services/index.js +11 -0
- package/lib/services/index.js.map +1 -0
- package/lib/telegram/TelegramAuth.d.ts +17 -0
- package/lib/telegram/TelegramAuth.js +96 -0
- package/lib/telegram/TelegramAuth.js.map +1 -0
- package/lib/telegram/TelegramBot.d.ts +88 -0
- package/lib/telegram/TelegramBot.js +345 -0
- package/lib/telegram/TelegramBot.js.map +1 -0
- package/lib/telegram/TelegramEvents.d.ts +13 -0
- package/lib/telegram/TelegramEvents.js +131 -0
- package/lib/telegram/TelegramEvents.js.map +1 -0
- package/lib/telegram/TelegramSendingController.d.ts +36 -0
- package/lib/telegram/TelegramSendingController.js +213 -0
- package/lib/telegram/TelegramSendingController.js.map +1 -0
- package/lib/telegram/TelegramToRompotConverter.d.ts +22 -0
- package/lib/telegram/TelegramToRompotConverter.js +226 -0
- package/lib/telegram/TelegramToRompotConverter.js.map +1 -0
- package/lib/telegram/TelegramUtils.d.ts +14 -0
- package/lib/telegram/TelegramUtils.js +98 -0
- package/lib/telegram/TelegramUtils.js.map +1 -0
- package/lib/telegram/index.d.ts +7 -0
- package/lib/telegram/index.js +19 -0
- package/lib/telegram/index.js.map +1 -0
- package/lib/utils/ClientUtils.d.ts +27 -0
- package/lib/utils/ClientUtils.js +62 -0
- package/lib/utils/ClientUtils.js.map +1 -0
- package/lib/utils/Generic.d.ts +47 -0
- package/lib/utils/Generic.js +173 -0
- package/lib/utils/Generic.js.map +1 -0
- package/lib/utils/Libs.d.ts +10 -0
- package/lib/utils/Libs.js +55 -0
- package/lib/utils/Libs.js.map +1 -0
- package/lib/utils/MessageHandler.d.ts +54 -0
- package/lib/utils/MessageHandler.js +81 -0
- package/lib/utils/MessageHandler.js.map +1 -0
- package/lib/utils/MessageUtils.d.ts +3 -0
- package/lib/utils/MessageUtils.js +114 -0
- package/lib/utils/MessageUtils.js.map +1 -0
- package/lib/utils/index.d.ts +6 -0
- package/lib/utils/index.js +27 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/nonce.d.ts +1 -0
- package/lib/utils/nonce.js +16 -0
- package/lib/utils/nonce.js.map +1 -0
- package/lib/utils/server.d.ts +33 -0
- package/lib/utils/server.js +75 -0
- package/lib/utils/server.js.map +1 -0
- package/lib/wa/Auth.d.ts +19 -0
- package/lib/wa/Auth.js +123 -0
- package/lib/wa/Auth.js.map +1 -0
- package/lib/wa/ConfigWAEvents.d.ts +22 -0
- package/lib/wa/ConfigWAEvents.js +526 -0
- package/lib/wa/ConfigWAEvents.js.map +1 -0
- package/lib/wa/ConvertToWAMessage.d.ts +67 -0
- package/lib/wa/ConvertToWAMessage.js +403 -0
- package/lib/wa/ConvertToWAMessage.js.map +1 -0
- package/lib/wa/ConvertWAMessage.d.ts +108 -0
- package/lib/wa/ConvertWAMessage.js +527 -0
- package/lib/wa/ConvertWAMessage.js.map +1 -0
- package/lib/wa/ID.d.ts +4 -0
- package/lib/wa/ID.js +19 -0
- package/lib/wa/ID.js.map +1 -0
- package/lib/wa/WAMessage.d.ts +3 -0
- package/lib/wa/WAMessage.js +8 -0
- package/lib/wa/WAMessage.js.map +1 -0
- package/lib/wa/WAModule.d.ts +3 -0
- package/lib/wa/WAModule.js +3 -0
- package/lib/wa/WAModule.js.map +1 -0
- package/lib/wa/WAStatus.d.ts +3 -0
- package/lib/wa/WAStatus.js +15 -0
- package/lib/wa/WAStatus.js.map +1 -0
- package/lib/wa/WhatsAppBot.d.ts +188 -0
- package/lib/wa/WhatsAppBot.js +980 -0
- package/lib/wa/WhatsAppBot.js.map +1 -0
- package/lib/wa/index.d.ts +12 -0
- package/lib/wa/index.js +37 -0
- package/lib/wa/index.js.map +1 -0
- package/lib/wa/makeInMemoryStore.d.ts +43 -0
- package/lib/wa/makeInMemoryStore.js +430 -0
- package/lib/wa/makeInMemoryStore.js.map +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import ConnectionConfig from "../configs/ConnectionConfig";
|
|
2
|
+
import Message from "../messages/Message";
|
|
3
|
+
import MediaMessage from "../messages/MediaMessage";
|
|
4
|
+
import ChatStatus from "../modules/chat/ChatStatus";
|
|
5
|
+
import Chat from "../modules/chat/Chat";
|
|
6
|
+
import User from "../modules/user/User";
|
|
7
|
+
import CommandController from "../modules/command/CommandController";
|
|
8
|
+
import Command from "../modules/command/Command";
|
|
9
|
+
import { QuickResponsePattern } from "../modules/quickResponse/QuickResponsePattern";
|
|
10
|
+
import { QuickResponseReply } from "../modules/quickResponse/QuickResponseReply";
|
|
11
|
+
import QuickResponseOptions from "../modules/quickResponse/QuickResponseOptions";
|
|
12
|
+
import QuickResponse from "../modules/quickResponse/QuickResponse";
|
|
13
|
+
import ClientEvents, { ClientEventsMap } from "./ClientEvents";
|
|
14
|
+
import ClientFunctionHandler from "./ClientFunctionHandler";
|
|
15
|
+
import IAuth from "./IAuth";
|
|
16
|
+
import IBot from "../bot/IBot";
|
|
17
|
+
import MessageHandler, { MessageHandlerConfig } from "../utils/MessageHandler";
|
|
18
|
+
import Call from "../models/Call";
|
|
19
|
+
export default interface IClient<Bot extends IBot = IBot> extends ClientEvents {
|
|
20
|
+
/** Tratador de mensagens */
|
|
21
|
+
messageHandler: MessageHandler;
|
|
22
|
+
/** Controlador de comandos */
|
|
23
|
+
commandController: CommandController;
|
|
24
|
+
/** Configuração */
|
|
25
|
+
config: ConnectionConfig;
|
|
26
|
+
/** Bot */
|
|
27
|
+
bot: Bot;
|
|
28
|
+
/** Vezes que o bot reconectou */
|
|
29
|
+
reconnectTimes: number;
|
|
30
|
+
/** Id do cliente */
|
|
31
|
+
id: string;
|
|
32
|
+
/** Tratador de funções */
|
|
33
|
+
funcHandler: ClientFunctionHandler<Bot, "bot" | "chat" | "user" | "message" | "sendMessage" | "sendMediaMessage" | "downloadMedia">;
|
|
34
|
+
/** Configura os eventos do cliente */
|
|
35
|
+
configEvents(): void;
|
|
36
|
+
/** Conectar bot
|
|
37
|
+
* @param auth Autenticação do bot
|
|
38
|
+
*/
|
|
39
|
+
connect(auth: IAuth | string): Promise<void>;
|
|
40
|
+
/** Reconectar bot
|
|
41
|
+
* @param alert Alerta que está reconectando
|
|
42
|
+
*/
|
|
43
|
+
reconnect(alert?: boolean): Promise<void>;
|
|
44
|
+
/** Parar bot
|
|
45
|
+
* @param reason Razão por parar bot
|
|
46
|
+
*/
|
|
47
|
+
stop(reason?: any): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Desconecta o bot
|
|
50
|
+
*/
|
|
51
|
+
logout(): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* * Aguarda um evento ser chamado.
|
|
54
|
+
* @param eventName - Nome do evento que será aguardado.
|
|
55
|
+
* @param maxTimeout - Para automaticamente após
|
|
56
|
+
* @returns {Promise<ClientEventsMap[T]>} Argumento retornado do evento esperado.
|
|
57
|
+
*/
|
|
58
|
+
awaitEvent<T extends keyof ClientEventsMap>(eventName: T, maxTimeout?: number): Promise<ClientEventsMap[T]>;
|
|
59
|
+
/**
|
|
60
|
+
* * Aguarda a conexão for aberta.
|
|
61
|
+
*/
|
|
62
|
+
awaitConnectionOpen(): Promise<void>;
|
|
63
|
+
/** @returns Controlador de comando do cliente */
|
|
64
|
+
getCommandController(): CommandController;
|
|
65
|
+
/** Define o controlador de comando do cliente */
|
|
66
|
+
setCommandController(controller: CommandController): void;
|
|
67
|
+
/** Define os comandos do bot
|
|
68
|
+
* @param commands Comandos que será injetado
|
|
69
|
+
*/
|
|
70
|
+
setCommands(commands: Command[]): void;
|
|
71
|
+
/** @returns Retorna os comandos do bot */
|
|
72
|
+
getCommands(): void;
|
|
73
|
+
/** Adiciona um comando na lista de comandos
|
|
74
|
+
* @param command Comando que será adicionado
|
|
75
|
+
*/
|
|
76
|
+
addCommand(command: Command): void;
|
|
77
|
+
/** Remove um comando na lista de comandos
|
|
78
|
+
* @param command Comando que será removido
|
|
79
|
+
*/
|
|
80
|
+
removeCommand(command: Command): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Procura um comando no texto.
|
|
83
|
+
* @param text - Texto que contem o comando.
|
|
84
|
+
* */
|
|
85
|
+
searchCommand(text: string): Command | null;
|
|
86
|
+
/**
|
|
87
|
+
* Execução do comando.
|
|
88
|
+
* @param command - Comando que será executado.
|
|
89
|
+
* @param message - Mensagem associada ao comando.
|
|
90
|
+
*/
|
|
91
|
+
runCommand(command: Command, message: Message, type?: string): any;
|
|
92
|
+
/** Adiciona uma resposta rápida */
|
|
93
|
+
addQuickResponse(pattern: QuickResponse): QuickResponse;
|
|
94
|
+
addQuickResponse(pattern: QuickResponsePattern, reply: QuickResponseReply, options?: Partial<QuickResponseOptions>): QuickResponse;
|
|
95
|
+
addQuickResponse(pattern: QuickResponsePattern[], reply: QuickResponseReply, options?: Partial<QuickResponseOptions>): QuickResponse;
|
|
96
|
+
addQuickResponse(content: QuickResponse | QuickResponsePattern | QuickResponsePattern[], reply?: QuickResponseReply, options?: Partial<QuickResponseOptions>): QuickResponse;
|
|
97
|
+
/** Remove uma resposta rápida */
|
|
98
|
+
removeQuickResponse(quickMessage: QuickResponse | string): void;
|
|
99
|
+
/**
|
|
100
|
+
* Deletar mensagem
|
|
101
|
+
* @param message Mensagem que será deletada da sala de bate-papos
|
|
102
|
+
*/
|
|
103
|
+
deleteMessage(message: Message): Promise<void>;
|
|
104
|
+
/** Remover mensagem
|
|
105
|
+
* @param message Mensagem que será removida da sala de bate-papo
|
|
106
|
+
*/
|
|
107
|
+
removeMessage(message: Message): Promise<void>;
|
|
108
|
+
/** Marca uma mensagem como visualizada
|
|
109
|
+
* @param message Mensagem que será visualizada
|
|
110
|
+
*/
|
|
111
|
+
readMessage(message: Message): Promise<void>;
|
|
112
|
+
/** Edita o texto de uma mensagem enviada
|
|
113
|
+
* @param message Mensagem que será editada
|
|
114
|
+
* @param text Novo texto da mensagem
|
|
115
|
+
*/
|
|
116
|
+
editMessage(message: Message, text: string): Promise<void>;
|
|
117
|
+
/** Adiciona uma reação na mensagem
|
|
118
|
+
* @param message Mensagem
|
|
119
|
+
* @param reaction Reação
|
|
120
|
+
*/
|
|
121
|
+
addReaction(message: Message, reaction: string): Promise<void>;
|
|
122
|
+
/** Remove a reação da mensagem
|
|
123
|
+
* @param message Mensagem que terá sua reação removida
|
|
124
|
+
*/
|
|
125
|
+
removeReaction(message: Message): Promise<void>;
|
|
126
|
+
/** Adiciona animações na reação da mensagem
|
|
127
|
+
* @param message Mensagem que receberá a animação
|
|
128
|
+
* @param reactions Reações em sequência
|
|
129
|
+
* @param interval Intervalo entre cada reação
|
|
130
|
+
* @param maxTimeout Maximo de tempo reagindo
|
|
131
|
+
*/
|
|
132
|
+
addAnimatedReaction(message: Message, reactions: string[], interval?: number, maxTimeout?: number): (reactionStop?: string) => Promise<void>;
|
|
133
|
+
/** Envia uma mensagem
|
|
134
|
+
* @param message Menssagem que será enviada
|
|
135
|
+
* @returns Retorna o conteudo enviado
|
|
136
|
+
*/
|
|
137
|
+
send(message: Message): Promise<Message>;
|
|
138
|
+
/** Envia uma mensagem
|
|
139
|
+
* @param chat Sala de bate-papo onde irá ser enviado a mensagem
|
|
140
|
+
* @param message Mensagem que será enviada
|
|
141
|
+
* @param mention Mensagem que será mencionada
|
|
142
|
+
*/
|
|
143
|
+
sendMessage(chat: Chat | string, message: string | Message, mention?: Message): Promise<Message>;
|
|
144
|
+
/** Aguarda uma mensagem ser recebida em uma sala de bate-papo
|
|
145
|
+
* @param chat Sala de bate-papo que irá receber a mensagem
|
|
146
|
+
* @param config Configuração do aguardo da mensagem
|
|
147
|
+
*/
|
|
148
|
+
awaitMessage(chat: Chat | string, config?: Partial<MessageHandlerConfig>): Promise<Message>;
|
|
149
|
+
/**
|
|
150
|
+
* Retorna a stream da mídia
|
|
151
|
+
* @param message Mídia que será baixada
|
|
152
|
+
* @returns Stream da mídia
|
|
153
|
+
*/
|
|
154
|
+
downloadStreamMessage(message: MediaMessage): Promise<Buffer>;
|
|
155
|
+
/** @returns Retorna o nome do bot */
|
|
156
|
+
getBotName(): Promise<string>;
|
|
157
|
+
/** Define o nome do bot
|
|
158
|
+
* @param name Nome do bot
|
|
159
|
+
*/
|
|
160
|
+
setBotName(name: string): Promise<void>;
|
|
161
|
+
/** @returns Retorna a descrição do bot */
|
|
162
|
+
getBotDescription(): Promise<string>;
|
|
163
|
+
/** Define a descrição do bot
|
|
164
|
+
* @param description Descrição do bot
|
|
165
|
+
*/
|
|
166
|
+
setBotDescription(description: string): Promise<void>;
|
|
167
|
+
/** @returns Retorna foto de perfil do bot */
|
|
168
|
+
getBotProfile(lowQuality?: boolean): Promise<Buffer>;
|
|
169
|
+
/** Define a imagem de perfil do bot
|
|
170
|
+
* @param image Imagem de perfil do bot
|
|
171
|
+
*/
|
|
172
|
+
setBotProfile(profile: Buffer): Promise<void>;
|
|
173
|
+
/**
|
|
174
|
+
* @param chat Sala de bate-papo
|
|
175
|
+
* @returns Retorna uma sala de bate-papo
|
|
176
|
+
*/
|
|
177
|
+
getChat(chat: Chat | string): Promise<Chat | null>;
|
|
178
|
+
/**
|
|
179
|
+
* Atualiza os dados de um chat.
|
|
180
|
+
* @param id - Id do chat que será atualizado.
|
|
181
|
+
* @param chat - Dados do chat que será atualizado.
|
|
182
|
+
*/
|
|
183
|
+
updateChat(id: string, chat: Partial<Chat>): Promise<void>;
|
|
184
|
+
/** @returns Retorna as sala de bate-papo que o bot está */
|
|
185
|
+
getChats(): Promise<Chat[]>;
|
|
186
|
+
/** Define as salas de bate-papo que o bot está
|
|
187
|
+
* @param chats Salas de bate-papo
|
|
188
|
+
*/
|
|
189
|
+
setChats(chats: Chat[]): Promise<void>;
|
|
190
|
+
/** Remove uma sala de bate-papo
|
|
191
|
+
* @param chat Sala de bate-papo
|
|
192
|
+
*/
|
|
193
|
+
removeChat(chat: string | Chat): Promise<void>;
|
|
194
|
+
/** Cria uma sala de bate-papo
|
|
195
|
+
* @param chat Sala de bate-papo
|
|
196
|
+
*/
|
|
197
|
+
createChat(chat: Chat): Promise<void>;
|
|
198
|
+
/** Sai de uma sala de bate-papo
|
|
199
|
+
* @param chat Sala de bate-papo
|
|
200
|
+
*/
|
|
201
|
+
leaveChat(chat: Chat | string): Promise<void>;
|
|
202
|
+
/**
|
|
203
|
+
* @param chat Sala de bate-papo
|
|
204
|
+
* @returns Retorna o nome da sala de bate-papo
|
|
205
|
+
*/
|
|
206
|
+
getChatName(chat: Chat | string): Promise<string>;
|
|
207
|
+
/** Define o nome da sala de bate-papo
|
|
208
|
+
* @param chat Sala de bate-papo
|
|
209
|
+
* @param name Nome da sala de bate-papo
|
|
210
|
+
*/
|
|
211
|
+
setChatName(chat: Chat | string, name: string): Promise<void>;
|
|
212
|
+
/**
|
|
213
|
+
* @param chat Sala de bate-papo
|
|
214
|
+
* @returns Retorna a descrição da sala de bate-papo
|
|
215
|
+
*/
|
|
216
|
+
getChatDescription(chat: Chat | string): Promise<string>;
|
|
217
|
+
/** Define a descrição da sala de bate-papo
|
|
218
|
+
* @param chat Sala de bate-papo
|
|
219
|
+
* @param description Descrição da sala de bate-papo
|
|
220
|
+
*/
|
|
221
|
+
setChatDescription(chat: Chat | string, description: string): Promise<void>;
|
|
222
|
+
/**
|
|
223
|
+
* @param chat Sala de bate-papo
|
|
224
|
+
* @returns Retorna a imagem de perfil da sala de bate-papo
|
|
225
|
+
*/
|
|
226
|
+
getChatProfile(chat: Chat | string, lowQuality?: boolean): Promise<Buffer>;
|
|
227
|
+
/** Define a imagem de perfil da sala de bate-papo
|
|
228
|
+
* @param chat Sala de bate-papo
|
|
229
|
+
* @param profile Imagem de perfil da sala de bate-papo
|
|
230
|
+
*/
|
|
231
|
+
setChatProfile(chat: Chat | string, profile: Buffer): Promise<void>;
|
|
232
|
+
/**
|
|
233
|
+
* @param chat Sala de bate-papo
|
|
234
|
+
* @returns Retorna o lider da sala de bate-papo
|
|
235
|
+
*/
|
|
236
|
+
getChatLeader(chat: Chat | string): Promise<User>;
|
|
237
|
+
/**
|
|
238
|
+
* @param chat Sala de bate-papo
|
|
239
|
+
* @returns Retorna os usuários de uma sala de bate-papo
|
|
240
|
+
*/
|
|
241
|
+
getChatUsers(chat: Chat | string): Promise<string[]>;
|
|
242
|
+
/**
|
|
243
|
+
* @param chat Sala de bate-papo
|
|
244
|
+
* @returns Retorna os administradores de uma sala de bate-papo
|
|
245
|
+
*/
|
|
246
|
+
getChatAdmins(chat: Chat | string): Promise<string[]>;
|
|
247
|
+
/** Adiciona um novo usuário a uma sala de bate-papo
|
|
248
|
+
* @param chat Sala de bate-papo
|
|
249
|
+
* @param user Usuário
|
|
250
|
+
*/
|
|
251
|
+
addUserInChat(chat: Chat | string, user: User | string): Promise<void>;
|
|
252
|
+
/** Adiciona um novo usuário a uma sala de bate-papo
|
|
253
|
+
* @param chat Sala de bate-papo
|
|
254
|
+
* @param user Usuário
|
|
255
|
+
*/
|
|
256
|
+
removeUserInChat(chat: Chat | string, user: User | string): Promise<void>;
|
|
257
|
+
/** Promove há administrador um usuário da sala de bate-papo
|
|
258
|
+
* @param chat Sala de bate-papo
|
|
259
|
+
* @param user Usuário
|
|
260
|
+
*/
|
|
261
|
+
promoteUserInChat(chat: Chat | string, user: User | string): Promise<void>;
|
|
262
|
+
/** Remove a administração um usuário da sala de bate-papo
|
|
263
|
+
* @param chat Sala de bate-papo
|
|
264
|
+
* @param user Usuário
|
|
265
|
+
*/
|
|
266
|
+
demoteUserInChat(chat: Chat | string, user: User | string): Promise<void>;
|
|
267
|
+
/** Altera o status da sala de bate-papo
|
|
268
|
+
* @param chat Sala de bate-papo
|
|
269
|
+
* @param status Status da sala de bate-papo
|
|
270
|
+
*/
|
|
271
|
+
changeChatStatus(chat: Chat | string, status: ChatStatus): Promise<void>;
|
|
272
|
+
/**
|
|
273
|
+
* Entra no chat pelo código de convite.
|
|
274
|
+
* @param code - Código de convite do chat.
|
|
275
|
+
*/
|
|
276
|
+
joinChat(code: string): Promise<void>;
|
|
277
|
+
/**
|
|
278
|
+
* Obtem o código de convite do chat.
|
|
279
|
+
* @param chat - Chat que será obtido o código de convite.
|
|
280
|
+
* @returns O código de convite do chat.
|
|
281
|
+
*/
|
|
282
|
+
getChatInvite(chat: Chat | string): Promise<string>;
|
|
283
|
+
/**
|
|
284
|
+
* Revoga o código de convite do chat.
|
|
285
|
+
* @param chat - Chat que terá seu código de convite revogado.
|
|
286
|
+
* @returns O novo código de convite do chat.
|
|
287
|
+
*/
|
|
288
|
+
revokeChatInvite(chat: Chat | string): Promise<string>;
|
|
289
|
+
/**
|
|
290
|
+
* Rejeita uma chamada.
|
|
291
|
+
* @param call - A chamada que será rejeitada.
|
|
292
|
+
*/
|
|
293
|
+
rejectCall(call: Call | string): Promise<void>;
|
|
294
|
+
/** @returns Retorna a lista de usuários do bot */
|
|
295
|
+
getUsers(): Promise<User[]>;
|
|
296
|
+
/**
|
|
297
|
+
* Obter lista de usuários salvos.
|
|
298
|
+
* @returns Lista de usuários salvos.
|
|
299
|
+
*/
|
|
300
|
+
getSavedUsers(): Promise<User[]>;
|
|
301
|
+
/** Define a lista de usuários do bot
|
|
302
|
+
* @param users Usuários
|
|
303
|
+
*/
|
|
304
|
+
setUsers(users: User[]): Promise<void>;
|
|
305
|
+
/**
|
|
306
|
+
* @param user Usuário
|
|
307
|
+
* @returns Retorna um usuário
|
|
308
|
+
*/
|
|
309
|
+
getUser(user: User | string): Promise<User | null>;
|
|
310
|
+
/**
|
|
311
|
+
* Atualiza os dados de um usuário.
|
|
312
|
+
* @param id - Id do usuário que será atualizado.
|
|
313
|
+
* @param user - Dados do usuário que será atualizado.
|
|
314
|
+
*/
|
|
315
|
+
updateUser(id: string, user: Partial<User>): Promise<void>;
|
|
316
|
+
/** Remove um usuário
|
|
317
|
+
* @param user Usuário
|
|
318
|
+
*/
|
|
319
|
+
removeUser(user: User | string): Promise<void>;
|
|
320
|
+
/**
|
|
321
|
+
* @param user Usuário
|
|
322
|
+
* @returns Retorna o nome do usuário
|
|
323
|
+
*/
|
|
324
|
+
getUserName(user: User | string): Promise<string>;
|
|
325
|
+
/** Define o nome do usuário
|
|
326
|
+
* @param user Usuário
|
|
327
|
+
* @param name Nome do usuário
|
|
328
|
+
*/
|
|
329
|
+
setUserName(user: User | string, name: string): Promise<void>;
|
|
330
|
+
/**
|
|
331
|
+
* @param user Usuário
|
|
332
|
+
* @returns Retorna a descrição do usuário
|
|
333
|
+
*/
|
|
334
|
+
getUserDescription(user: User | string): Promise<string>;
|
|
335
|
+
/** Define a descrição do usuário
|
|
336
|
+
* @param user Usuário
|
|
337
|
+
* @param description Descrição do usuário
|
|
338
|
+
*/
|
|
339
|
+
setUserDescription(user: User | string, description: string): Promise<void>;
|
|
340
|
+
/**
|
|
341
|
+
* @param user Usuário
|
|
342
|
+
* @returns Retorna a foto de perfil do usuário
|
|
343
|
+
*/
|
|
344
|
+
getUserProfile(user: User | string, lowQuality?: boolean): Promise<Buffer>;
|
|
345
|
+
/** Define a imagem de perfil do usuário
|
|
346
|
+
* @param user Usuário
|
|
347
|
+
* @param profile Imagem de perfil do usuário
|
|
348
|
+
*/
|
|
349
|
+
setUserProfile(user: User | string, profile: Buffer): Promise<void>;
|
|
350
|
+
/** Desbloqueia um usuário
|
|
351
|
+
* @param user Usuário
|
|
352
|
+
*/
|
|
353
|
+
unblockUser(user: User | string): Promise<void>;
|
|
354
|
+
/** Bloqueia um usuário
|
|
355
|
+
* @param user Usuário
|
|
356
|
+
*/
|
|
357
|
+
blockUser(user: User | string): Promise<void>;
|
|
358
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IClient.js","sourceRoot":"","sources":["../../src/client/IClient.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import Client from "./Client";
|
|
2
|
+
import ClientEvents from "./ClientEvents";
|
|
3
|
+
import ClientFunctionHandler from "./ClientFunctionHandler";
|
|
4
|
+
import { ConnectionType } from "./ConnectionType";
|
|
5
|
+
import IAuth from "./IAuth";
|
|
6
|
+
import IClient from "./IClient";
|
|
7
|
+
export { Client, ClientEvents, ClientFunctionHandler, ConnectionType, IAuth, IClient };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ClientFunctionHandler = exports.ClientEvents = exports.Client = void 0;
|
|
7
|
+
const Client_1 = __importDefault(require("./Client"));
|
|
8
|
+
exports.Client = Client_1.default;
|
|
9
|
+
const ClientEvents_1 = __importDefault(require("./ClientEvents"));
|
|
10
|
+
exports.ClientEvents = ClientEvents_1.default;
|
|
11
|
+
const ClientFunctionHandler_1 = __importDefault(require("./ClientFunctionHandler"));
|
|
12
|
+
exports.ClientFunctionHandler = ClientFunctionHandler_1.default;
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA8B;AAOrB,iBAPF,gBAAM,CAOE;AANf,kEAA0C;AAMzB,uBANV,sBAAY,CAMU;AAL7B,oFAA4D;AAK7B,gCALxB,+BAAqB,CAKwB"}
|