-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: new upgrades in docs and commands
- Loading branch information
Showing
23 changed files
with
327 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*.json | ||
*.json | ||
!auto-responder.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[ | ||
{ | ||
"match": "Oi", | ||
"answer": "Olá, tudo bem?" | ||
}, | ||
{ | ||
"match": "Tudo bem", | ||
"answer": "Estou bem, obrigado por perguntar" | ||
}, | ||
{ | ||
"match": "Qual seu nome", | ||
"answer": "Meu nome é Sky Bot" | ||
} | ||
] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const { PREFIX } = require("../../config"); | ||
const { InvalidParameterError } = require("../../errors/InvalidParameterError"); | ||
const { | ||
activateAutoResponderGroup, | ||
deactivateAutoResponderGroup, | ||
} = require("../../utils/database"); | ||
|
||
module.exports = { | ||
name: "auto-responder", | ||
description: "Ativo/desativo o recurso de auto-responder no grupo.", | ||
commands: ["auto-responder"], | ||
usage: `${PREFIX}auto-responder (1/0)`, | ||
handle: async ({ args, sendReply, sendSuccessReact, remoteJid }) => { | ||
if (!args.length) { | ||
throw new InvalidParameterError( | ||
"Você precisa digitar 1 ou 0 (ligar ou desligar)!" | ||
); | ||
} | ||
|
||
const autoResponder = args[0] === "1"; | ||
const notAutoResponder = args[0] === "0"; | ||
|
||
if (!autoResponder && !notAutoResponder) { | ||
throw new InvalidParameterError( | ||
"Você precisa digitar 1 ou 0 (ligar ou desligar)!" | ||
); | ||
} | ||
|
||
if (autoResponder) { | ||
activateAutoResponderGroup(remoteJid); | ||
} else { | ||
deactivateAutoResponderGroup(remoteJid); | ||
} | ||
|
||
await sendSuccessReact(); | ||
|
||
const context = autoResponder ? "ativado" : "desativado"; | ||
|
||
await sendReply(`Recurso de auto-responder ${context} com sucesso!`); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const { PREFIX } = require("../../config"); | ||
const { playAudio, playVideo } = require("../../services/spider-x-api"); | ||
const { InvalidParameterError } = require("../../errors/InvalidParameterError"); | ||
|
||
module.exports = { | ||
name: "play-video", | ||
description: "Faço o download de vídeos", | ||
commands: ["play-video", "pv"], | ||
usage: `${PREFIX}play-video MC Hariel`, | ||
handle: async ({ | ||
sendVideoFromURL, | ||
args, | ||
sendWaitReact, | ||
sendSuccessReact, | ||
sendErrorReply, | ||
}) => { | ||
if (!args.length) { | ||
throw new InvalidParameterError( | ||
"Você precisa me dizer o que deseja buscar!" | ||
); | ||
} | ||
|
||
await sendWaitReact(); | ||
|
||
try { | ||
const data = await playVideo(args[0]); | ||
|
||
if (!data) { | ||
await sendErrorReply("Nenhum resultado encontrado!"); | ||
return; | ||
} | ||
|
||
await sendSuccessReact(); | ||
|
||
await sendVideoFromURL(data.url); | ||
} catch (error) { | ||
console.log(error); | ||
await sendErrorReply(JSON.stringify(error.message)); | ||
} | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
const path = require("path"); | ||
|
||
// Prefixo dos comandos | ||
exports.PREFIX = "/"; | ||
exports.PREFIX = "#"; | ||
|
||
// Emoji do bot (mude se preferir) | ||
exports.BOT_EMOJI = "🤖"; | ||
|
@@ -25,13 +25,13 @@ exports.ASSETS_DIR = path.resolve(__dirname, "..", "assets"); | |
exports.TEMP_DIR = path.resolve(__dirname, "..", "assets", "temp"); | ||
|
||
// Timeout em milissegundos por evento (evita banimento) | ||
exports.TIMEOUT_IN_MILLISECONDS_BY_EVENT = 700; | ||
exports.TIMEOUT_IN_MILLISECONDS_BY_EVENT = 300; | ||
|
||
// Plataforma de API's | ||
exports.SPIDER_API_BASE_URL = "https://api.spiderx.com.br/api"; | ||
|
||
// Obtenha seu token, criando uma conta em: https://api.spiderx.com.br | ||
exports.SPIDER_API_TOKEN = "seu_token_aqui"; | ||
|
||
// Permita o sistema registrar os logs | ||
exports.REGISTER_LOGS = true; | ||
// Caso queira responder apenas um grupo específico, coloque o ID dele aqui (ex: [email protected]). Apenas para testes internos! | ||
exports.ONLY_GROUP_ID = "[email protected]"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.