Class: Discordrb::AllowedMentions

Inherits:
Object
  • Object
show all
Defined in:
lib/discordrb/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


21
22
23
24
25
# File 'lib/discordrb/allowed_mentions.rb', line 21

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

Instance Attribute Details

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

Returns:


9
10
11
# File 'lib/discordrb/allowed_mentions.rb', line 9

def parse
  @parse
end

#rolesArray<String, Integer>?

Returns:


15
16
17
# File 'lib/discordrb/allowed_mentions.rb', line 15

def roles
  @roles
end

#usersArray<String, Integer>?

Returns:


12
13
14
# File 'lib/discordrb/allowed_mentions.rb', line 12

def users
  @users
end