@@ -9,7 +9,6 @@ import { fetch } from 'undici';
9
9
import { REMOTE_TAG_URL , PREFIX_SUCCESS } from '../util/constants.js' ;
10
10
import { logger } from '../util/logger.js' ;
11
11
import { prepareResponse , prepareErrorResponse } from '../util/respond.js' ;
12
- import { suggestionString } from '../util/suggestionString.js' ;
13
12
14
13
export type Tag = {
15
14
content : string ;
@@ -49,11 +48,11 @@ export async function loadTags(tagCache: Collection<string, Tag>, remote = false
49
48
}
50
49
}
51
50
52
- export function findTag ( tagCache : Collection < string , Tag > , query : string , target ?: string ) : string | null {
51
+ export function findTag ( tagCache : Collection < string , Tag > , query : string ) : string | null {
53
52
const cleanQuery = query . replaceAll ( / \s + / g, '-' ) ;
54
53
const tag = tagCache . get ( cleanQuery ) ?? tagCache . find ( ( tag ) => tag . keywords . includes ( cleanQuery ) ) ;
55
54
if ( ! tag ) return null ;
56
- return suggestionString ( ' tag' , tag . content , target ) ;
55
+ return tag . content ;
57
56
}
58
57
59
58
export async function reloadTags ( res : Response , tagCache : Collection < string , Tag > , remote = true ) {
@@ -84,13 +83,12 @@ export function showTag(
84
83
res : Response ,
85
84
query : string ,
86
85
tagCache : Collection < string , Tag > ,
87
- target ?: string ,
88
86
ephemeral ?: boolean ,
89
87
) : Response {
90
88
const trimmedQuery = query . trim ( ) . toLowerCase ( ) ;
91
- const content = findTag ( tagCache , trimmedQuery , target ) ;
89
+ const content = findTag ( tagCache , trimmedQuery ) ;
92
90
if ( content ) {
93
- prepareResponse ( res , content , ephemeral ?? false , target ? [ target ] : [ ] ) ;
91
+ prepareResponse ( res , content , ephemeral ?? false ) ;
94
92
} else {
95
93
prepareErrorResponse ( res , `Could not find a tag with name or alias similar to \`${ trimmedQuery } \`.` ) ;
96
94
}
0 commit comments