# Class IrcMessageFormatter | EchoHub Documentation

# Class IrcMessageFormatter

Namespace
  EchoHub.Server.Irc

Assembly
  EchoHub.Server.Irc.dll

    public static class IrcMessageFormatter

Inheritance
  object
  IrcMessageFormatter

Inherited Members
  object.GetType()
  object.MemberwiseClone()
  object.ToString()
  object.Equals(object)
  object.Equals(object, object)
  object.ReferenceEquals(object, object)
  object.GetHashCode()

## Methods

### FormatMessage(MessageDto, string?)

Format a MessageDto as one or more IRC PRIVMSG lines. Attachments are rendered as single link lines \u2014 the widely-supported IRC convention (clients auto-preview or open plain http(s) URLs) \u2014 never as terminal color art. `publicBaseUrl` makes the links absolute so any IRC client can open them.

    public static List<string> FormatMessage(MessageDto message, string? publicBaseUrl = null)

#### Parameters

`message` MessageDto
`publicBaseUrl` string

#### Returns

List<string>

### SplitMessage(string, int)

Split a message into chunks of approximately maxBytes (UTF-8), at word boundaries.

    public static List<string> SplitMessage(string content, int maxBytes)

#### Parameters

`content` string
`maxBytes` int

#### Returns

List<string>

### ToAbsoluteUrl(string, string?)

Joins a relative attachment path onto the configured public base URL. Already-absolute URLs and unset base URLs pass through unchanged.

    public static string ToAbsoluteUrl(string url, string? publicBaseUrl)

#### Parameters

`url` string
`publicBaseUrl` string

#### Returns

string