db

package
v0.0.0-...-7ace4a1 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Addr string
View Source
var DiscordToken string
View Source
var Discord_Session *discordgo.Session

Functions

func AddChannelName

func AddChannelName(channelID, channelName string) error

func AddWebhook

func AddWebhook(gid, wi, wt string) error

TODO: Lock something during both Add methods to avoid race condition

func BotIDFromChannelID

func BotIDFromChannelID(s string) (string, error)

func ChannelIDFromGroupID

func ChannelIDFromGroupID(s string) (string, error)

func ChannelNameFromChannelID

func ChannelNameFromChannelID(s string) (string, error)

func Parse

func Parse()

func SetConfig

func SetConfig(c Config)

func WebhookFromGroupID

func WebhookFromGroupID(s string) (string, string, error)

Types

type Config

type Config struct {
	Address         string
	DiscordBotToken string
	Connection      []Connection
}

type Connection

type Connection struct {
	BotID   string `mapstructure:"groupme_bot_id" toml:"groupme_bot_id"`
	GroupID string `mapstructure:"groupme_group_id" toml:"groupme_group_id"`

	ChannelID        map[string]string `mapstructure:"discord_channels" toml:"discord_channels"`
	PrimaryChannelID string            `mapstructure:"primary_channel" toml:"primary_channel"`
	WebhookID        string            `mapstructure:"webhook_id,omitempty" toml:"webhook_id"`
	WebhookToken     string            `mapstructure:"webhook_token,omitempty" toml:"webhook_token"`
}

Jump to

Keyboard shortcuts

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