File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ Retorna o primeiro resultado de uma pesquisa no google.
8
8
9
9
*args válidos:*
10
10
\`\`\`--help\`\`\` -> _mostra esta mensagem._
11
+ \`\`\`--target\`\`\` -> _define um site especifico para pesquisa._
12
+ \`\`\`--limit\`\`\` -> _define um limite de resultados. O padrão é 1._
11
13
` . trim ( ) ,
12
14
} ;
13
15
@@ -18,7 +20,7 @@ class Search {
18
20
}
19
21
20
22
async execute ( data , message ) {
21
- const { args, text } = data ;
23
+ const { args, text, kwargs } = data ;
22
24
23
25
if ( args . includes ( 'help' ) ) {
24
26
message . reply ( this . strings . help ) ;
@@ -29,12 +31,12 @@ class Search {
29
31
throw new Error ( 'Nenhum texto para pesquisa foi especificado.' ) ;
30
32
}
31
33
32
- const results = await search ( text ) ;
34
+ const results = await search ( text , kwargs . target , kwargs . limit ) ;
33
35
34
36
if ( results . length > 0 ) {
35
37
const stringResult = results
36
38
. map ( ( r ) => Search . formatResult ( r ) )
37
- . join ( '\n\n' ) ;
39
+ . join ( '\n\n🔹🔹🔹\n\n ' ) ;
38
40
message . reply ( stringResult ) ;
39
41
return ;
40
42
}
You can’t perform that action at this time.
0 commit comments