Class: Discordrb::AuditLogs
- Inherits:
-
Object
- Object
- Discordrb::AuditLogs
- Defined in:
- lib/discordrb/data.rb
Overview
A server's audit logs
Defined Under Namespace
Classes: Change, Entry, RoleChange
Constant Summary collapse
- ACTIONS =
The numbers associated with the type of action.
{ 1 => :server_update, 10 => :channel_create, 11 => :channel_update, 12 => :channel_delete, 13 => :channel_overwrite_create, 14 => :channel_overwrite_update, 15 => :channel_overwrite_delete, 20 => :member_kick, 21 => :member_prune, 22 => :member_ban_add, 23 => :member_ban_remove, 24 => :member_update, 25 => :member_role_update, 30 => :role_create, 31 => :role_update, 32 => :role_delete, 40 => :invite_create, 41 => :invite_update, 42 => :invite_delete, 50 => :webhook_create, 51 => :webhook_update, 52 => :webhook_delete, 60 => :emoji_create, 61 => :emoji_update, 62 => :emoji_delete, # 70 # 71 72 => :message_delete }.freeze
Instance Attribute Summary collapse
-
#entries ⇒ Array<Entry>
readonly
The entries listed in the audit logs.
-
#users ⇒ Hash<String => User>
readonly
The users included in the audit logs.
-
#webhooks ⇒ Hash<String => Webhook>
readonly
The webhooks included in the audit logs.
Instance Method Summary collapse
-
#latest ⇒ Entry
(also: #first)
The latest entry in the audit logs.
-
#user(id) ⇒ Object
Gets a user in the audit logs data based on user ID.
-
#webhook(id) ⇒ Object
Gets a webhook in the audit logs data based on webhook ID.
Instance Attribute Details
#entries ⇒ Array<Entry> (readonly)
Returns the entries listed in the audit logs.
3921 3922 3923 |
# File 'lib/discordrb/data.rb', line 3921 def entries @entries end |
Instance Method Details
#latest ⇒ Entry Also known as: first
Returns the latest entry in the audit logs.
4122 4123 4124 |
# File 'lib/discordrb/data.rb', line 4122 def latest @entries.first end |
#user(id) ⇒ Object
Note:
This only uses data given by the audit logs request
Gets a user in the audit logs data based on user ID
4130 4131 4132 |
# File 'lib/discordrb/data.rb', line 4130 def user(id) @users[id.resolve_id] end |
#webhook(id) ⇒ Object
Note:
This only uses data given by the audit logs request
Gets a webhook in the audit logs data based on webhook ID
4137 4138 4139 |
# File 'lib/discordrb/data.rb', line 4137 def webhook(id) @webhooks[id.resolve_id] end |