Method: Minecraft::Extensions#validate_hops

Defined in:
lib/minecraft/extensions.rb

#validate_hops(user, command, message = true) ⇒ Boolean

Check if a user has half op privileges and print a privilege error if not.

Parameters:

  • user (String)

    The specified user.

  • command (String)

    The command they tried to use.

Returns:

  • (Boolean)

    Returns true if the user is an op.



486
487
488
489
# File 'lib/minecraft/extensions.rb', line 486

def validate_hops(user, command, message = true)
  return true if is_hop? user.downcase
  say("#{user} is not a half-op, cannot use !#{command}.") if message
end