discord_to_groupme

package module
v0.0.0-...-c6ffbf3 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2021 License: GPL-3.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

discord-to-groupme

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App interface {
	Start() (finishedSignal chan struct{}, err error)
	Stop()
}

App simple application interface to allow starting and stopping

func NewApp

func NewApp(config *Config) App

NewApp - Return a new App instance

type Config

type Config struct {
	Filename string `json:"-"`

	GroupMeBotToken groupme.ID
	Discord         DiscordConfig

	StartupMessage  string
	ShutdownMessage string
}

Config - defines the tokens used to connect to GroupMe and Discord, as well as the messages the bot sends

func ReadConfig

func ReadConfig(filename string) (*Config, error)

ReadConfig - opens the file with filename and tries the parse the json in a Config

type DiscordConfig

type DiscordConfig struct {
	BotToken                 string
	SyncChannelID            string
	AdminChannelID           string
	TroubleshootingChannelID string
}

type DiscordMessage

type DiscordMessage struct {
	*discordgo.Message
}

DiscordMessage - wrapper used to add Message interface functions

func (DiscordMessage) GetText

func (m DiscordMessage) GetText() string

GetText - satisfies the Message interface

func (DiscordMessage) GetUsername

func (m DiscordMessage) GetUsername() string

GetUsername - satisfies the Message interface

type GroupMeMessage

type GroupMeMessage struct {
	*groupme.Message
}

GroupMeMessage - wrapper used to add Message interface functions

func (GroupMeMessage) GetText

func (m GroupMeMessage) GetText() string

GetText - satisfies the Message interface

func (GroupMeMessage) GetUsername

func (m GroupMeMessage) GetUsername() string

GetUsername - satisfies the Message interface

type Link struct {
	DiscordUsername string
	GroupMeUsername string
	Name            string
}

type Message

type Message interface {
	GetText() string
	GetUsername() string
}

Message - used to parse commands whether it is a GroupMe or Discord message

Directories

Path Synopsis
cmd
sync-bot command

Jump to

Keyboard shortcuts

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