format

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package format https://discord.com/developers/docs/reference#message-formatting

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnimatedEmoji

func AnimatedEmoji(name, id string) string

AnimatedEmoji returns a custom animated emoji

func Channel

func Channel(id string) string

Channel returns a channel mention

func Emoji

func Emoji(name, id string) string

Emoji returns a custom emoji

func Role

func Role(id string) string

Role returns a role mention

func Timestamp

func Timestamp(ts time.Time) string

Timestamp returns a timestamp

func TimestampStyled

func TimestampStyled(ts time.Time, style TimestampStyle) string

TimestampStyled returns a styled timestamp

func User

func User(id string) string

User returns a user mention

func UserNick

func UserNick(id string) string

UserNick returns a user (nickname) mention

Types

type TimestampStyle

type TimestampStyle string

TimestampStyle https://discord.com/developers/docs/reference#message-formatting-timestamp-styles

const (
	TimestampShortTime     TimestampStyle = "t"
	TimestampLongTime      TimestampStyle = "T"
	TimestampShortDate     TimestampStyle = "d"
	TimestampLongDate      TimestampStyle = "D"
	TimestampShortDateTime TimestampStyle = "f"
	TimestampLongDateTime  TimestampStyle = "F"
	TimestampRelative      TimestampStyle = "R"
)

Jump to

Keyboard shortcuts

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