config

package
v0.0.0-...-eae27d5 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CopyPipelines = []CopyPipeline{}
View Source
var CreatorID = "204752740503650304"
View Source
var DateFormat string
View Source
var DoubleTL = false
View Source
var EightBallEnabled bool
View Source
var ErrorChannel = "793361959046217778"
View Source
var Extractions = make(map[string]Extraction)
View Source
var GoogleClientID string
View Source
var GoogleCredentials bson.M
View Source
var GoogleCredentialsAlt1 bson.M
View Source
var GoogleOauthCredentials bson.M
View Source
var GoogleSecret string
View Source
var GrantRoles = map[string]RoleConfig{
	"755437328515989564": {
		Alpha:   "760705266953355295",
		Special: "783112023570513970",
		Whale:   "761570574794489886",
		Fanbox:  "",
		Former:  "782479385185615953",
	},
}
View Source
var LogChannels = map[string]string{
	"755437328515989564": "772322798546321428",
}
View Source
var ModeratorRoles = map[string][]string{
	"755437328515989564": {
		"755623281238867980",
		"775181732864852048",
		"778288741504516096",
		"775667196969877504",
		"755788358994755664",
		"770268062871715850",
		"770266890882383912",
		"770040458666836049",
	},
}
View Source
var ModmailCategories = map[string]string{
	"755437328515989564": "779849308525690900",
}
View Source
var Proposals = make(map[string]string)
View Source
var RoleGrantEnabled = map[string]bool{}
View Source
var RoleRemoveEnabled = map[string]bool{}
View Source
var StaffRoles = map[string][]string{
	"755437328515989564": {
		"755623281238867980",
		"775181732864852048",
		"778288741504516096",
		"775667196969877504",
		"755788358994755664",
		"770268062871715850",
		"770266890882383912",
		"770040458666836049",
	},
}
View Source
var SyncSheets = map[string]string{}
View Source
var TimeFormat string
View Source
var TweetSyncChannels = []TweetSyncConfig{}
View Source
var TweetUpdates = make(map[string]TweetUpdate)
View Source
var YoutubeCredentials []YoutubeCredential

Functions

func AlphaRole

func AlphaRole(guildID string) string

AlphaRole get the designated alpha role for the given guild

func Emoji

func Emoji(emojiCode string) string

func FanboxRole

func FanboxRole(guildID string) string

FanboxRole get the designated Fanbox role for the given guild

func FormerRole

func FormerRole(guildID string) string

FormerRole get the designated former member role for the given guild

func Get

Get Load the config object

func IsModmailChannel

func IsModmailChannel(ds *discordgo.Session, guildID, channelID string) bool

func LoadConfig

func LoadConfig() error

func LogChannel

func LogChannel(guildID string) string

LogChannel get the designated log channel for the given guild

func MessageLink(msg *discordgo.Message) string

func ModmailCategory

func ModmailCategory(guildID string) string

ModmailCategory get the designated modmail category ID for the given guild

func MuteRole

func MuteRole(guildID string) string

MuteRole get the designated muted role for the given guild

func NativeEmoji

func NativeEmoji(emojiCode string) string

func Now

func Now() time.Time

func ParseTime

func ParseTime(raw string) time.Time

func PrintDate

func PrintDate(t time.Time) string

func PrintTime

func PrintTime(t time.Time) string

func RoleGrantIsEnabled

func RoleGrantIsEnabled(guildID string) bool

RoleGrantIsEnabled Return whether syncing is enabled for the given guild

func RoleRemoveIsEnabled

func RoleRemoveIsEnabled(guildID string) bool

RoleRemoveIsEnabled Return whether syncing is enabled for the given guild

func SetAlphaRole

func SetAlphaRole(guildID, roleID string) error

func SetCopyPipeline

func SetCopyPipeline(cp CopyPipeline) error

func SetDoubleTLEnabled

func SetDoubleTLEnabled(enabled bool) error

func SetEightBallEnabled

func SetEightBallEnabled(enabled bool) error

func SetFanboxRole

func SetFanboxRole(guildID, roleID string) error

func SetFormerRole

func SetFormerRole(guildID, roleID string) error

func SetMuteRole

func SetMuteRole(guildID, roleID string) error

func SetRoleGrantEnabled

func SetRoleGrantEnabled(guildID string, enabled bool) error

func SetRoleRemoveEnabled

func SetRoleRemoveEnabled(guildID string, enabled bool) error

func SetSpecialRole

func SetSpecialRole(guildID, roleID string) error

func SetSyncSheet

func SetSyncSheet(guildID, sheetID string) error

func SetTweetSyncSinceID

func SetTweetSyncSinceID(handle, channelID string, sinceID int64) error

func SetWhaleRole

func SetWhaleRole(guildID, roleID string) error

func SpecialRole

func SpecialRole(guildID string) string

SpecialRole get the designated special role for the given guild

func SyncSheet

func SyncSheet(guildID string) string

SyncSheet get the designated sync sheet for the given guild

func UpdateConfig

func UpdateConfig(update bson.M) error

func WhaleRole

func WhaleRole(guildID string) string

WhaleRole get the designated whale role for the given guild

Types

type BotConfig

type BotConfig struct {
	ModeratorRoles         map[string][]string   `json:"moderator_roles" bson:"moderator_roles"`
	StaffRoles             map[string][]string   `json:"staff_roles" bson:"staff_roles"`
	GrantRoles             map[string]RoleConfig `json:"grant_roles" bson:"grant_roles"`
	SyncSheets             map[string]string     `json:"sync_sheets" bson:"sync_sheets"`
	RoleGrantEnabled       map[string]bool       `json:"role_grant_enabled" bson:"role_grant_enabled"`
	RoleRemoveEnabled      map[string]bool       `json:"role_remove_enabled" bson:"role_remove_enabled"`
	TimeFormat             string                `json:"time_format" bson:"time_format"`
	DateFormat             string                `json:"date_format" bson:"date_format"`
	GoogleCredentials      bson.M                `json:"-" bson:"google_credentials"`
	GoogleCredentialsAlt1  bson.M                `json:"-" bson:"google_credentials_alt1"`
	GoogleOauthCredentials bson.M                `json:"-" bson:"google_oauth_credentials"`
	GoogleClientID         string                `json:"-" bson:"google_client_id"`
	GoogleSecret           string                `json:"-" bson:"google_secret"`
	YoutubeCredentials     []YoutubeCredential   `json:"-" bson:"youtube_credentials"`
	EightBallEnabled       bool                  `json:"eight_ball_enabled" bson:"eight_ball_enabled"`
	TweetSyncChannels      []TweetSyncConfig     `json:"tweet_sync_channels" bson:"tweet_sync_channels"`
	CopyPipelines          []CopyPipeline        `json:"copy_pipelines" bson:"copy_pipelines"`
	DoubleTL               bool                  `json:"double_tl" bson:"double_tl"`
}

type CopyPipeline

type CopyPipeline struct {
	OID       bson.ObjectId `json:"_id" bson:"_id,omitempty"`
	CreatedAt time.Time     `json:"created_at" bson:"created_at"`

	CreatedBy      string `json:"created_by" bson:"created_by"`
	CreatedByName  string `json:"created_by_name" bson:"created_by_name"`
	Type           string `json:"type" bson:"type"`
	ChannelID      string `json:"channel_id" bson:"channel_id"`
	Prefix         string `json:"prefix" bson:"prefix"`
	YoutubeVideoID string `json:"youtube_video_id" bson:"youtube_video_id"`

	YoutubeVideoTitle string `json:"youtube_video_title" bson:"youtube_video_title"`
	YoutubeLivechatID string `json:"youtube_livechat_id" bson:"youtube_livechat_id"`
}

func GetCopyPipeline

func GetCopyPipeline(channelID, videoID string) *CopyPipeline

func GetCopyPipelines

func GetCopyPipelines(channelID string) []CopyPipeline

func RemoveCopyPipeline

func RemoveCopyPipeline(channelID string) ([]CopyPipeline, error)

type Extraction

type Extraction struct {
	ChannelID         string   `json:"channel_id" bson:"channel_id"`
	UserMessageID     string   `json:"user_message_id" bson:"user_message_id"`
	BotMessageID      string   `json:"bot_message_id" bson:"bot_message_id"`
	ExtractMessageIDs []string `json:"extract_message_ids" bson:"extract_message_ids"`
}

type RoleConfig

type RoleConfig struct {
	Alpha   string `json:"alpha" bson:"alpha"`
	Special string `json:"special" bson:"special"`
	Whale   string `json:"whale" bson:"whale"`
	Fanbox  string `json:"fanbox" bson:"fanbox"`
	Former  string `json:"former" bson:"former"`
	Mute    string `json:"mute" bson:"mute"`
}

type TweetSyncConfig

type TweetSyncConfig struct {
	Handle           string `json:"handle" bson:"handle"`
	ChannelID        string `json:"channel_id" bson:"channel_id"`
	ControlChannelID string `json:"control_channel_id" bson:"control_channel_id"`
	SinceID          int64  `json:"since_id" bson:"since_id"`
}

func MaybeGetTweetConfig

func MaybeGetTweetConfig(channelID string) *TweetSyncConfig

type TweetUpdate

type TweetUpdate struct {
	ChannelID      string `json:"channel_id" bson:"channel_id"`
	UserMessageID  string `json:"user_message_id" bson:"user_message_id"`
	BotMessageID   string `json:"bot_message_id" bson:"bot_message_id"`
	TweetMessageID string `json:"tweet_message_id" bson:"tweet_message_id"`
	Translation    string `json:"translation" bson:"translation"`
	Translator     string `json:"translator" bson:"translator"`
}

type YoutubeCredential

type YoutubeCredential struct {
	Email        string `json:"email" bson:"email"`
	OauthToken   string `json:"oauth_token" bson:"oauth_token"`
	RefreshToken string `json:"refresh_token" bson:"refresh_token"`
}

Jump to

Keyboard shortcuts

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