module Vox::HTTP::Routes::AuditLog
HTTP
methods for accessing information about a {Guild}'s {AuditLog}
Constants
- EVENTS
TODO: Is this the best place for these?
Public Instance Methods
Fetch a guild's audit log. [View on Discord's docs](discord.com/developers/docs/resources/audit-log#get-guild-audit-log) @param guild_id [String, Integer] The ID of the guild to fetch audit log entries from. @param user_id [String, Integer] The ID of the user to filter events for. @param action_type [Symbol, Integer] The name of the audit log event to filter for. Either a key from {EVENTS}
or the corresponding integer value.
@param before [String, Integer] The ID of the audit log entry to fetch before chronologically. @param limit [Integer] The maximum amount of entries to return. Defaults to 50 if no value is supplied.
Maximum of 100, minimum of 1.
@return [Hash<:audit_log_entries, Array<Object>>] @vox.permissions VIEW_AUDIT_LOG @vox.api_docs discord.com/developers/docs/resources/audit-log#get-guild-audit-log
# File lib/vox/http/routes/audit_log.rb, line 63 def get_guild_audit_log(guild_id, user_id: :undef, action_type: :undef, before: :undef, limit: :undef) route = HTTP::Route.new(:GET, '/guilds/%{guild_id}/audit-logs', guild_id: guild_id) query_params = filter_undef({ user_id: user_id, action_type: action_type, before: before, limit: limit }) request(route, query: query_params) end