Class: Rubycord::AllowedMentions

Inherits:
Object
  • Object
show all
Defined in:
lib/rubycord/allowed_mentions.rb

Overview

Builder class for allowed_mentions when sending messages.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parse: nil, users: nil, roles: nil) ⇒ AllowedMentions

Returns a new instance of AllowedMentions.

Parameters:

  • parse (Array<"users", "roles", "everyone">) (defaults to: nil)

    Mention types that can be inferred from the message. users and roles allow for all mentions of the respective type to ping. everyone allows usage of @everyone and @here

  • users (Array<User, String, Integer>) (defaults to: nil)

    Users or user IDs that can be pinged. Cannot be used in conjunction with "users" in parse

  • roles (Array<Role, String, Integer>) (defaults to: nil)

    Roles or role IDs that can be pinged. Cannot be used in conjunction with "roles" in parse



19
20
21
22
23
# File 'lib/rubycord/allowed_mentions.rb', line 19

def initialize(parse: nil, users: nil, roles: nil)
  @parse = parse
  @users = users
  @roles = roles
end

Instance Attribute Details

#parseArray<"users", "roles", "everyone">?

Returns:



7
8
9
# File 'lib/rubycord/allowed_mentions.rb', line 7

def parse
  @parse
end

#rolesArray<String, Integer>?

Returns:



13
14
15
# File 'lib/rubycord/allowed_mentions.rb', line 13

def roles
  @roles
end

#usersArray<String, Integer>?

Returns:



10
11
12
# File 'lib/rubycord/allowed_mentions.rb', line 10

def users
  @users
end