Class MentionUtils
Provides a series of helper methods for parsing mentions.
Assembly: Discord.Net.Core.dll
Syntax
public static class MentionUtils : object
Methods
|
Improve this Doc
View Source
MentionChannel(UInt64)
Returns a mention string based on the channel ID.
Declaration
public static string MentionChannel(ulong id)
Parameters
Type |
Name |
Description |
UInt64 |
id |
|
Returns
Type |
Description |
String |
A channel mention string (e.g. <#103735883630395392>).
|
|
Improve this Doc
View Source
MentionRole(UInt64)
Returns a mention string based on the role ID.
Declaration
public static string MentionRole(ulong id)
Parameters
Type |
Name |
Description |
UInt64 |
id |
|
Returns
Type |
Description |
String |
A role mention string (e.g. <@&165511591545143296>).
|
|
Improve this Doc
View Source
MentionUser(UInt64)
Returns a mention string based on the user ID.
Declaration
public static string MentionUser(ulong id)
Parameters
Type |
Name |
Description |
UInt64 |
id |
|
Returns
Type |
Description |
String |
A user mention string (e.g. <@80351110224678912>).
|
|
Improve this Doc
View Source
ParseChannel(String)
Parses a provided channel mention string.
Declaration
public static ulong ParseChannel(string text)
Parameters
Type |
Name |
Description |
String |
text |
|
Returns
|
Improve this Doc
View Source
ParseRole(String)
Parses a provided role mention string.
Declaration
public static ulong ParseRole(string text)
Parameters
Type |
Name |
Description |
String |
text |
|
Returns
|
Improve this Doc
View Source
ParseUser(String)
Parses a provided user mention string.
Declaration
public static ulong ParseUser(string text)
Parameters
Type |
Name |
Description |
String |
text |
The user mention.
|
Returns
|
Improve this Doc
View Source
TryParseChannel(String, out UInt64)
Tries to parse a provided channel mention string.
Declaration
public static bool TryParseChannel(string text, out ulong channelId)
Parameters
Returns
|
Improve this Doc
View Source
TryParseRole(String, out UInt64)
Tries to parse a provided role mention string.
Declaration
public static bool TryParseRole(string text, out ulong roleId)
Parameters
Returns
|
Improve this Doc
View Source
TryParseUser(String, out UInt64)
Tries to parse a provided user mention string.
Declaration
public static bool TryParseUser(string text, out ulong userId)
Parameters
Type |
Name |
Description |
String |
text |
The user mention.
|
UInt64 |
userId |
The UserId of the user.
|
Returns