Class: OnyxCord::ServerBan
- Inherits:
-
Object
- Object
- OnyxCord::ServerBan
- Defined in:
- lib/onyxcord/models/server.rb
Overview
A ban entry on a server.
Instance Attribute Summary collapse
-
#reason ⇒ String?
readonly
The reason the user was banned, if provided.
-
#server ⇒ Server
readonly
The server this ban belongs to.
-
#user ⇒ User
readonly
The user that was banned.
Instance Method Summary collapse
-
#remove(reason = nil) ⇒ Object
(also: #unban, #lift)
Removes this ban on the associated user in the server.
Instance Attribute Details
#reason ⇒ String? (readonly)
Returns the reason the user was banned, if provided.
1545 1546 1547 |
# File 'lib/onyxcord/models/server.rb', line 1545 def reason @reason end |
#server ⇒ Server (readonly)
Returns the server this ban belongs to.
1551 1552 1553 |
# File 'lib/onyxcord/models/server.rb', line 1551 def server @server end |
#user ⇒ User (readonly)
Returns the user that was banned.
1548 1549 1550 |
# File 'lib/onyxcord/models/server.rb', line 1548 def user @user end |
Instance Method Details
#remove(reason = nil) ⇒ Object Also known as: unban, lift
Removes this ban on the associated user in the server
1562 1563 1564 |
# File 'lib/onyxcord/models/server.rb', line 1562 def remove(reason = nil) @server.unban(user, reason) end |