emojis

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package emojis provides an implementation of the im.ponies emoji protocol.

Index

Constants

View Source
const (
	RoomEmotesEventType event.Type = "im.ponies.room_emotes"
	UserEmotesEventType event.Type = "im.ponies.user_emotes"
)

Variables

This section is empty.

Functions

func RoomHasEmotes

func RoomHasEmotes(c *gotktrix.Client, roomID matrix.RoomID) bool

RoomHasEmotes returns true if the room is known to have emojis.

Types

type Emoji

type Emoji struct {
	URL matrix.URL `json:"url"`
}

Emoji describes the information of an emoji.

type EmojiMap

type EmojiMap = map[EmojiName]Emoji

EmojiMap is a map (object) of emoji names to emoji objects.

func RoomEmotes

func RoomEmotes(c *gotktrix.Client, roomID matrix.RoomID) (EmojiMap, error)

RoomEmotes gets the room's emojis.

func UserEmotes

func UserEmotes(c *gotktrix.Client) (EmojiMap, error)

UserEmotes gets the current user's emojis.

type EmojiName

type EmojiName string

EmojiName describes the name of an emoji, which is surrounded by colons, such as ":gnutroll:".

func (EmojiName) Name

func (n EmojiName) Name() string

Name returns the emoji name without the colons.

type EmoticonEventData

type EmoticonEventData struct {
	Emoticons EmojiMap `json:"emoticons"`
}

EmoticonEventData is a subevent struct that describes part of an emoji event.

type RoomEmotesEvent

type RoomEmotesEvent struct {
	event.StateEventInfo `json:"-"`
	EmoticonEventData
}

RoomEmotesEvent describes the im.ponies.room_emotes event.

type UserEmotesEvent

type UserEmotesEvent struct {
	event.EventInfo `json:"-"`
	EmoticonEventData
}

UserEmotesEvent describes the im.ponies.user_emotes event.

Jump to

Keyboard shortcuts

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