discordjs / discord.js

A powerful JavaScript library for interacting with the Discord API
https://discord.js.org
Apache License 2.0
25.38k stars 3.97k forks source link

Guild.fetchAuditLogs corresponding API endpoint does not accept the documented "after" parameter #3141

Closed monbrey closed 5 years ago

monbrey commented 5 years ago

Please describe the problem you are having in as much detail as possible: Guild.fetchAuditLogs() is documented as and coded to accept options.after, however the API endpoint does not accept this parameter. https://discord.js.org/#/docs/main/stable/class/Guild?scrollTo=fetchAuditLogs https://github.com/discordjs/discord.js/blob/master/src/structures/Guild.js#L569 https://discordapp.com/developers/docs/resources/audit-log#get-guild-audit-log-query-string-parameters

Include a reproducible code sample here, if possible:

client.guilds.get("guild_id_here").fetchAuditLogs({limit: "2"})
// Will correctly return two logs. Get the Snowflake of the older log
client.guilds.get("same_guild_id_here").fetchAuditLogs({after: "older_audit_log_id"})
// Expected behaviour would be to return 1 or 2 logs, depending on if `after` was inclusive. Since it doesnt exist at all, it returns the default 50

Further details:

monbrey commented 5 years ago

3142