Table of Contents

Class StringExtensions

Namespace
Discord.Rest
Assembly
Discord.Net.Rest.dll

Responsible for formatting certain entities as Json string, to reuse later on.

public static class StringExtensions
Inheritance
StringExtensions
Inherited Members

Methods

ToJsonString(Embed, Formatting)

Gets a Json formatted string from an Embed.

public static string ToJsonString(this Embed embed, Formatting formatting = Formatting.Indented)

Parameters

embed Embed

The embed to format as Json string.

formatting Formatting

The formatting in which the Json will be returned.

Returns

string

A Json string containing the data from the embed.

Remarks

See TryParse(string, out EmbedBuilder) to parse Json back into embed.

ToJsonString(EmbedBuilder, Formatting)

Gets a Json formatted string from an EmbedBuilder.

public static string ToJsonString(this EmbedBuilder builder, Formatting formatting = Formatting.Indented)

Parameters

builder EmbedBuilder

The builder to format as Json string.

formatting Formatting

The formatting in which the Json will be returned.

Returns

string

A Json string containing the data from the builder.

Remarks

See TryParse(string, out EmbedBuilder) to parse Json back into embed.