lib/chatrix/api/room_actions.rb
# Kicks and bans a user from a room.
#
# @param room [String] The room to ban the user from.
# @param user [String] The user to ban.
# @param reason [String] Reason why the ban was made.
# @return [Boolean] `true` if the ban was carried out successfully,
#   otherwise `false`.
#
# @example Banning a spammer
#   ban('#haven:matrix.org', '@spammer:spam.com', 'Spamming the room')
Kicks and bans a user from a room.
Kicks and bans a user from a room .
def ban(room, user, reason)
        make_request(
          :post,
          "/rooms/#{room}/ban",
          content: { reason: reason, user_id: user }
        ).code == 200
      end
def ban ( room , user , reason ) make_request ( :post , "/rooms/#{room}/ban" , content : { reason : reason , user_id : user } ) . code == 200 end
Kicks and bans a user from a room.
Kicks and bans a user from a room .
`true` if the ban was carried out successfully, otherwise `false`.
` true ` if the ban was carried out successfully otherwise ` false ` .
Boolean
room
The room to ban the user from.
The room to ban the user from .
user
The user to ban.
The user to ban .
reason
Reason why the ban was made.
Reason why the ban was made .
example
Banning a spammer ban('#haven:matrix.org', '@spammer:spam.com', 'Spamming the room')
Banning a spammer ban ( ' #haven : matrix . org ' ' @spammer : spam . com ' ' Spamming the room ' )