types

package
v0.0.0-...-e72cd69 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelMapping

type ChannelMapping struct {
	DiscordChanId  string `json:"discord_chan_id,omitempty"`
	TelegramChanId int64  `json:"telegram_chan_id,omitempty"`
	MatrixChanId   string `json:"matrix_chan_id,omitempty"`
	DiscordWebhook string `json:"discord_webhook,omitempty"`
}

type Context

type Context struct {
	Discord  *discordgo.Session
	Telegram *tgbotapi.BotAPI
	Matrix   *mautrix.Client
	Config   GoferConfig
	Listener map[string]Listeners
}

type DiscordChannel

type DiscordChannel string

type GoferConfig

type GoferConfig struct {
	Channels         map[string]ChannelMapping `json:"channels"`
	DiscordApiToken  string                    `json:"discord_api_token,omitempty"`
	TelegramApiToken string                    `json:"telegram_api_token,omitempty"`
	MatrixHomeServer string                    `json:"matrix_homeserver,omitempty"`
	MatrixUsername   string                    `json:"matrix_username,omitempty"`
	MatrixPassword   string                    `json:"matrix_password,omitempty"`
}

type GoferEditedMessage

type GoferEditedMessage struct {
	From       string
	Message    string
	OldMessage string
	Origin     string
}

type GoferFile

type GoferFile struct {
	From           string
	Url            string
	Message        string
	ReplyTo        string
	Origin         string
	ReplyToMessage string
}

type GoferMessage

type GoferMessage struct {
	From               string
	FromUserProfilePic string
	Message            string
	ReplyTo            string
	ReplyToMessage     string
	Origin             string
}

type GoferMisc

type GoferMisc struct {
	From           string
	Url            string
	Message        string
	ReplyTo        string
	Origin         string
	Identifier     string
	ReplyToMessage string
}

type GoferPhoto

type GoferPhoto struct {
	From           string
	Url            string
	Message        string
	ReplyTo        string
	Origin         string
	ReplyToMessage string
}

type ListenerEditMessageCb

type ListenerEditMessageCb func(ctx Context, channel ChannelMapping, message GoferEditedMessage) error

type ListenerFileCb

type ListenerFileCb func(ctx Context, channel ChannelMapping, file GoferFile) error

type ListenerMessageCb

type ListenerMessageCb func(ctx Context, channel ChannelMapping, message GoferMessage) error

type ListenerMiscCb

type ListenerMiscCb func(ctx Context, channel ChannelMapping, misc GoferMisc) error

type ListenerPhotoCb

type ListenerPhotoCb func(ctx Context, channel ChannelMapping, photo GoferPhoto) error

type Listeners

type Listeners struct {
	File        ListenerFileCb
	Message     ListenerMessageCb
	Misc        ListenerMiscCb
	Photo       ListenerPhotoCb
	EditMessage ListenerEditMessageCb
}

type TelegramChannel

type TelegramChannel int64

Jump to

Keyboard shortcuts

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