Class: Discordrb::Role
- Inherits:
-
Object
- Object
- Discordrb::Role
- Includes:
- IDObject
- Defined in:
- lib/discordrb/data.rb
Overview
A Discord role that contains permissions and applies to certain users
Defined Under Namespace
Classes: RoleWriter
Instance Attribute Summary collapse
-
#colour ⇒ ColourRGB
(also: #color)
The role colour.
-
#hoist ⇒ true, false
Whether or not this role should be displayed separately from other users.
-
#name ⇒ String
This role's name ("new role" if it hasn't been changed).
-
#permissions ⇒ Permissions
readonly
This role's permissions.
Attributes included from IDObject
Instance Method Summary collapse
-
#delete ⇒ Object
Delets this role.
-
#inspect ⇒ Object
The inspect method is overwritten to give more useful output.
Methods included from IDObject
Instance Attribute Details
#colour ⇒ ColourRGB Also known as: color
Returns the role colour.
520 521 522 |
# File 'lib/discordrb/data.rb', line 520 def colour @colour end |
#hoist ⇒ true, false
Returns whether or not this role should be displayed separately from other users.
517 518 519 |
# File 'lib/discordrb/data.rb', line 517 def hoist @hoist end |
#name ⇒ String
Returns this role's name ("new role" if it hasn't been changed).
514 515 516 |
# File 'lib/discordrb/data.rb', line 514 def name @name end |
#permissions ⇒ Permissions (readonly)
Returns this role's permissions.
511 512 513 |
# File 'lib/discordrb/data.rb', line 511 def @permissions end |
Instance Method Details
#delete ⇒ Object
Delets this role. This cannot be undone without recreating the role!
599 600 601 602 |
# File 'lib/discordrb/data.rb', line 599 def delete API.delete_role(@bot.token, @server.id, @id) @server.delete_role(@id) end |
#inspect ⇒ Object
The inspect method is overwritten to give more useful output
605 606 607 |
# File 'lib/discordrb/data.rb', line 605 def inspect "<Role name=#{@name} permissions=#{@permissions.inspect} hoist=#{@hoist} colour=#{@colour.inspect} server=#{@server.inspect}>" end |