This commit is contained in:
syuilo 2018-08-16 23:33:11 +09:00 committed by GitHub
parent 7f9a35d7ac
commit e5c350d740
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,17 +16,13 @@ export default (params: any, me: ILocalUser) => new Promise(async (res, rej) =>
if (usernameErr) return rej('invalid username param');
if (userId === undefined && username === undefined) {
return rej('userId or pair of username and host is required');
return rej('userId or username is required');
}
// Get 'host' parameter
const [host, hostErr] = $.str.optional.get(params.host);
if (hostErr) return rej('invalid host param');
if (userId === undefined && host === undefined) {
return rej('userId or pair of username and host is required');
}
// Get 'includeReplies' parameter
const [includeReplies = true, includeRepliesErr] = $.bool.optional.get(params.includeReplies);
if (includeRepliesErr) return rej('invalid includeReplies param');