ircFormat

package module
v0.0.0-...-7df2828 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2020 License: MIT Imports: 1 Imported by: 1

README

Build Status

ircFormat

Library to format irc messages

https://godoc.org/github.com/rendom/ircFormat

####Example usage:####

// Bold text with red foreground
i.Privmsg(CHAN, ircFormat.New("Test").SetBold().SetFg(ircFormat.Red));

// Bold text
i.Privmsg(CHAN, ircFormat.Bold("Test!"));

// Italic text
i.Privmsg(CHAN, ircFormat.Italic("Test!"));

// Underline text
i.Privmsg(CHAN, ircFormat.Underline("Test!"));

// Red text
i.Privmsg(CHAN, ircFormat.Colorize("Test!", ircFormat.Red, ircFormat.None));

// Red text with green background
i.Privmsg(CHAN, ircFormat.Colorize("Test!", ircFormat.Red, ircFormat.Green));

Documentation

Index

Constants

View Source
const (
	White = iota
	Black
	Blue
	Green
	Red
	Brown
	Purple
	Orange
	Yellow
	Lime
	Teal
	Cyan
	Darkblue
	Pink
	Grey
	Lightgrey
	None
)
View Source
const (
	ResetFormatDelim = "\x0F"
	BoldDelim        = "\x02"
	ItalicDelim      = "\x1D"
	UnderlineDelim   = "\x1F"
	SwapDelim        = "\x16"
	ColorDelim       = "\x03"
)

Variables

This section is empty.

Functions

func Bold

func Bold(text string) string

func Colorize

func Colorize(text string, fg int, bg int) string

func Italic

func Italic(text string) string

func Underline

func Underline(text string) string

Types

type IrcText

type IrcText struct {
	// contains filtered or unexported fields
}

func New

func New(s string) *IrcText

New creates IrcText object and take your text as argument.

func (*IrcText) SetBg

func (i *IrcText) SetBg(c int) *IrcText

SetBg sets background color

func (*IrcText) SetBold

func (i *IrcText) SetBold() *IrcText

Bold text

func (*IrcText) SetFg

func (i *IrcText) SetFg(c int) *IrcText

SetFg sets foreground color

func (*IrcText) SetItalic

func (i *IrcText) SetItalic() *IrcText

Italic text

func (*IrcText) SetUnderline

func (i *IrcText) SetUnderline() *IrcText

Underline text

func (*IrcText) String

func (i *IrcText) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL