createRole static method

Role createRole(
  1. INyxx client,
  2. Snowflake guildId,
  3. RawApiMap rawJson
)

Creates a Role object, can be used for other classes where you have correct rawJson data from the API.

void main() {
    var bot = Nyxx("TOKEN");
    RawApiMap rawJson = /* rawJson from the API */
    Role role = EntityUtility.createRole(bot, Snowflake("81384788765712384"), rawJson);
}

Implementation

static Role createRole(
        INyxx client, Snowflake guildId, RawApiMap rawJson) =>
    Role._new(client, rawJson, guildId);