Table of Contents

Method CreateRoleAsync

Namespace
DisCatSharp.Entities
Assembly
DisCatSharp.dll

CreateRoleAsync(string, Permissions?, DiscordColor?, bool?, bool?, string)

Creates a new role in this guild.

public Task<DiscordRole> CreateRoleAsync(string name = null, Permissions? permissions = null, DiscordColor? color = null, bool? hoist = null, bool? mentionable = null, string reason = null)

Parameters

name string

Name of the role.

permissions Permissions?

Permissions for the role.

color DiscordColor?

Color for the role.

hoist bool?

Whether the role is to be hoisted.

mentionable bool?

Whether the role is to be mentionable.

reason string

Reason for audit logs.

Returns

Task<DiscordRole>

The newly-created role.

Exceptions

UnauthorizedException

Thrown when the client does not have the ManageRoles permission.

ServerErrorException

Thrown when Discord is unable to process the request.