This commit is contained in:
		| @@ -22,13 +22,13 @@ module.exports = (params, user) => new Promise(async (res, rej) => { | ||||
| 	const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$; | ||||
| 	if (sinceIdErr) return rej('invalid since_id param'); | ||||
|  | ||||
| 	// Get 'max_id' parameter | ||||
| 	const [maxId, maxIdErr] = $(params.max_id).optional.id().$; | ||||
| 	if (maxIdErr) return rej('invalid max_id param'); | ||||
| 	// Get 'until_id' parameter | ||||
| 	const [untilId, untilIdErr] = $(params.until_id).optional.id().$; | ||||
| 	if (untilIdErr) return rej('invalid until_id param'); | ||||
|  | ||||
| 	// Check if both of since_id and max_id is specified | ||||
| 	if (sinceId && maxId) { | ||||
| 		return rej('cannot set since_id and max_id'); | ||||
| 	// Check if both of since_id and until_id is specified | ||||
| 	if (sinceId && untilId) { | ||||
| 		return rej('cannot set since_id and until_id'); | ||||
| 	} | ||||
|  | ||||
| 	// Get 'channel_id' parameter | ||||
| @@ -58,9 +58,9 @@ module.exports = (params, user) => new Promise(async (res, rej) => { | ||||
| 		query._id = { | ||||
| 			$gt: sinceId | ||||
| 		}; | ||||
| 	} else if (maxId) { | ||||
| 	} else if (untilId) { | ||||
| 		query._id = { | ||||
| 			$lt: maxId | ||||
| 			$lt: untilId | ||||
| 		}; | ||||
| 	} | ||||
| 	//#endregion Construct query | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 syuilo
					syuilo