diff --git a/packages/megalodon/src/misskey.ts b/packages/megalodon/src/misskey.ts index 0ea66cb49a..2f2cf3b9c9 100644 --- a/packages/megalodon/src/misskey.ts +++ b/packages/megalodon/src/misskey.ts @@ -2035,6 +2035,27 @@ export default class Misskey implements MegalodonInterface { }) } } + const match = q.match(/^@?(?[a-zA-Z0-9_]+)(?:@(?[a-zA-Z0-9-.]+\.[a-zA-Z0-9-]+)|)$/); + if (match) { + const lookupQuery = { + username: match.groups?.user, + host: match.groups?.host, + }; + + return await this.client.post('/api/users/show', lookupQuery).then((res) => ({ + ...res, + data: { + accounts: [ + MisskeyAPI.Converter.userDetail( + res.data, + this.baseUrl, + ), + ], + statuses: [], + hashtags: [], + }, + })); + } return this.client.post>('/api/users/search', params).then(res => ({ ...res, data: {