Table of Contents

Class RoleConnectionProperties

Namespace
Discord
Assembly
Discord.Net.Core.dll

Represents the properties used to modify user's RoleConnection.

public class RoleConnectionProperties
Inheritance
RoleConnectionProperties
Inherited Members

Constructors

RoleConnectionProperties()

Initializes a new instance of RoleConnectionProperties.

public RoleConnectionProperties()

RoleConnectionProperties(string, string, IDictionary<string, string>)

Initializes a new instance of RoleConnectionProperties.

public RoleConnectionProperties(string platformName, string platformUsername, IDictionary<string, string> metadata = null)

Parameters

platformName string

The name of the platform a bot has connected.

platformUsername string

Gets the username on the platform a bot has connected.

metadata IDictionary<string, string>

Object mapping RoleConnectionMetadata keys to their values.

Properties

Metadata

Gets or sets object mapping RoleConnectionMetadata keys to their string-ified values.

public Dictionary<string, string> Metadata { get; set; }

Property Value

Dictionary<string, string>

PlatformName

Gets or sets the vanity name of the platform a bot has connected. Max 50 characters.

public string PlatformName { get; set; }

Property Value

string

PlatformUsername

Gets or sets the username on the platform a bot has connected. Max 100 characters.

public string PlatformUsername { get; set; }

Property Value

string

Methods

FromRoleConnection(RoleConnection)

Initializes a new RoleConnectionProperties with the data from provided RoleConnection.

public static RoleConnectionProperties FromRoleConnection(RoleConnection roleConnection)

Parameters

roleConnection RoleConnection

Returns

RoleConnectionProperties

WithBool(string, bool)

Adds a metadata record with the provided key and value.

public RoleConnectionProperties WithBool(string key, bool value)

Parameters

key string
value bool

Returns

RoleConnectionProperties

The current RoleConnectionProperties.

WithDate(string, DateTimeOffset)

Adds a metadata record with the provided key and value.

public RoleConnectionProperties WithDate(string key, DateTimeOffset value)

Parameters

key string
value DateTimeOffset

Returns

RoleConnectionProperties

The current RoleConnectionProperties.

WithNumber(string, int)

Adds a metadata record with the provided key and value.

public RoleConnectionProperties WithNumber(string key, int value)

Parameters

key string
value int

Returns

RoleConnectionProperties

The current RoleConnectionProperties.

WithNumber(string, long)

Adds a metadata record with the provided key and value.

public RoleConnectionProperties WithNumber(string key, long value)

Parameters

key string
value long

Returns

RoleConnectionProperties

The current RoleConnectionProperties.

WithNumber(string, uint)

Adds a metadata record with the provided key and value.

public RoleConnectionProperties WithNumber(string key, uint value)

Parameters

key string
value uint

Returns

RoleConnectionProperties

The current RoleConnectionProperties.

WithNumber(string, ulong)

Adds a metadata record with the provided key and value.

public RoleConnectionProperties WithNumber(string key, ulong value)

Parameters

key string
value ulong

Returns

RoleConnectionProperties

The current RoleConnectionProperties.