feat(Message): add messageEditHistoryMaxSize to limit stored msg edits (#4867)

This commit is contained in:
Matt (IPv4) Cowley
2020-10-17 14:34:49 +01:00
committed by GitHub
parent 4a6fb9a7d4
commit c412cd7521
5 changed files with 23 additions and 5 deletions

View File

@@ -432,6 +432,13 @@ class Client extends BaseClient {
if (typeof options.messageSweepInterval !== 'number' || isNaN(options.messageSweepInterval)) {
throw new TypeError('CLIENT_INVALID_OPTION', 'messageSweepInterval', 'a number');
}
if (
typeof options.messageEditHistoryMaxSize !== 'number' ||
isNaN(options.messageEditHistoryMaxSize) ||
options.messageEditHistoryMaxSize < -1
) {
throw new TypeError('CLIENT_INVALID_OPTION', 'messageEditHistoryMaxSize', 'a number greater than or equal to -1');
}
if (typeof options.fetchAllMembers !== 'boolean') {
throw new TypeError('CLIENT_INVALID_OPTION', 'fetchAllMembers', 'a boolean');
}