Table of Contents

Class MentionUtils

Namespace
Kook
Assembly
Kook.Net.Core.dll

Provides a series of helper methods for parsing mentions.

public static class MentionUtils
Inheritance
MentionUtils
Inherited Members

Methods

KMarkdownMentionChannel(ulong)

Returns a KMarkdown formatted mention string based on the channel ID.

public static string KMarkdownMentionChannel(ulong id)

Parameters

id ulong

Returns

string

A channel mention string formatted to KMarkdown.

KMarkdownMentionRole(uint)

Returns a KMarkdown formatted mention string based on the role ID.

public static string KMarkdownMentionRole(uint id)

Parameters

id uint

Returns

string

A role mention string formatted to KMarkdown.

KMarkdownMentionUser(ulong)

Returns a KMarkdown formatted mention string based on the user ID.

public static string KMarkdownMentionUser(ulong id)

Parameters

id ulong

Returns

string

A user mention string formatted to KMarkdown.

ParseChannel(string, TagMode)

Parses a provided channel mention string.

public static ulong ParseChannel(string text, TagMode tagMode)

Parameters

text string
tagMode TagMode

Returns

ulong

Exceptions

ArgumentException

Invalid mention format.

ParseRole(string, TagMode)

Parses a provided role mention string.

public static ulong ParseRole(string text, TagMode tagMode)

Parameters

text string
tagMode TagMode

Returns

ulong

Exceptions

ArgumentException

Invalid mention format.

ParseUser(string, TagMode)

Parses a provided user mention string.

public static ulong ParseUser(string text, TagMode tagMode)

Parameters

text string

The user mention.

tagMode TagMode

Returns

ulong

Exceptions

ArgumentException

Invalid mention format.

PlainTextMentionChannel(ulong)

Returns a plain text formatted mention string based on the channel ID.

public static string PlainTextMentionChannel(ulong id)

Parameters

id ulong

Returns

string

A channel mention string formatted to plain text.

PlainTextMentionRole(uint)

Returns a plain text formatted mention string based on the role ID.

public static string PlainTextMentionRole(uint id)

Parameters

id uint

Returns

string

A role mention string formatted to plain text.

PlainTextMentionUser(string, ulong)

Returns a plain text formatted mention string based on the user ID.

public static string PlainTextMentionUser(string username, ulong id)

Parameters

username string
id ulong

Returns

string

A user mention string formatted to plain text.

TryParseChannel(string, out ulong, TagMode)

Tries to parse a provided channel mention string.

public static bool TryParseChannel(string text, out ulong channelId, TagMode tagMode)

Parameters

text string
channelId ulong
tagMode TagMode

Returns

bool

TryParseRole(string, out uint, TagMode)

Tries to parse a provided role mention string.

public static bool TryParseRole(string text, out uint roleId, TagMode tagMode)

Parameters

text string
roleId uint
tagMode TagMode

Returns

bool

TryParseUser(string, out ulong, TagMode)

Tries to parse a provided user mention string.

public static bool TryParseUser(string text, out ulong userId, TagMode tagMode)

Parameters

text string

The user mention.

userId ulong

The UserId of the user.

tagMode TagMode

Parse as PlainText or KMarkdown.

Returns

bool