Class: Discordrb::ServerBan
- Inherits:
-
Object
- Object
- Discordrb::ServerBan
- Defined in:
- lib/discordrb/data/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.
1028 1029 1030 |
# File 'lib/discordrb/data/server.rb', line 1028 def reason @reason end |
#server ⇒ Server (readonly)
Returns the server this ban belongs to.
1034 1035 1036 |
# File 'lib/discordrb/data/server.rb', line 1034 def server @server end |
#user ⇒ User (readonly)
Returns the user that was banned.
1031 1032 1033 |
# File 'lib/discordrb/data/server.rb', line 1031 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
1045 1046 1047 |
# File 'lib/discordrb/data/server.rb', line 1045 def remove(reason = nil) @server.unban(user, reason) end |