Skip to content

Commit 8b28342

Browse files
committed
[FEAT] adds target & limit kwargs
1 parent 0d331a7 commit 8b28342

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/commands/search.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Retorna o primeiro resultado de uma pesquisa no google.
88
99
*args válidos:*
1010
\`\`\`--help\`\`\` -> _mostra esta mensagem._
11+
\`\`\`--target\`\`\` -> _define um site especifico para pesquisa._
12+
\`\`\`--limit\`\`\` -> _define um limite de resultados. O padrão é 1._
1113
`.trim(),
1214
};
1315

@@ -18,7 +20,7 @@ class Search {
1820
}
1921

2022
async execute(data, message) {
21-
const { args, text } = data;
23+
const { args, text, kwargs } = data;
2224

2325
if (args.includes('help')) {
2426
message.reply(this.strings.help);
@@ -29,12 +31,12 @@ class Search {
2931
throw new Error('Nenhum texto para pesquisa foi especificado.');
3032
}
3133

32-
const results = await search(text);
34+
const results = await search(text, kwargs.target, kwargs.limit);
3335

3436
if (results.length > 0) {
3537
const stringResult = results
3638
.map((r) => Search.formatResult(r))
37-
.join('\n\n');
39+
.join('\n\n🔹🔹🔹\n\n');
3840
message.reply(stringResult);
3941
return;
4042
}

0 commit comments

Comments
 (0)