Class: Discordrb::ServerBan

Inherits:
Object
  • Object
show all
Defined in:
lib/discordrb/data/server.rb

Overview

A ban entry on a server.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#reason ⇒ String? (readonly)

Returns the reason the user was banned, if provided.

Returns:

  • (String, nil) —

    the reason the user was banned, if provided



1531
1532
1533
# File 'lib/discordrb/data/server.rb', line 1531

def reason
  @reason
end

#server ⇒ Server (readonly)

Returns the server this ban belongs to.

Returns:

  • (Server) —

    the server this ban belongs to



1537
1538
1539
# File 'lib/discordrb/data/server.rb', line 1537

def server
  @server
end

#user ⇒ User (readonly)

Returns the user that was banned.

Returns:

  • (User) —

    the user that was banned



1534
1535
1536
# File 'lib/discordrb/data/server.rb', line 1534

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

Parameters:

  • reason (String) (defaults to: nil) —

    the reason for removing the ban



1548
1549
1550
# File 'lib/discordrb/data/server.rb', line 1548

def remove(reason = nil)
  @server.unban(user, reason)
end