diff --git a/megalodon/src/misskey.ts b/megalodon/src/misskey.ts index 7a348d2..cc94478 100644 --- a/megalodon/src/misskey.ts +++ b/megalodon/src/misskey.ts @@ -2355,6 +2355,39 @@ export default class Misskey implements MegalodonInterface { limit: 20 }) } + + try { + const match = q.match(/^@(?.*?)(?:@(?.*?)|)$/); + if (match) { + const lookupQuery = { + username: match.groups?.user, + host: match.groups?.host + }; + + const result = await this.client.post('/api/users/show', lookupQuery).then(res => ({ + ...res, + data: { + accounts: [this.converter.userDetail(res.data, this.baseUrlToHost(this.baseUrl))], + statuses: [], + hashtags: [] + } + })); + + if (result.status !== 200) { + result.status = 200; + result.statusText = "OK"; + result.data = { + accounts: [], + statuses: [], + hashtags: [] + }; + } + + return result; + } + } + catch {} + return this.client.post>('/api/users/search', params).then(res => ({ ...res, data: {