discord

package
v0.0.0-...-f12bbbc Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateServer         = "create_server"
	ListServer           = "list_servers"
	DeleteServer         = "delete_server"
	ExtractLogs          = "extract_logs"
	RestartServer        = "restart_server"
	ServerMetadata       = "server_metadata"
	CommandFlagOverrides = "list_command_flag_overrides"
)
View Source
const CreateServerCustomDockerContainerOpt = "custom_container"
View Source
const CreateServerCustomThunderstoreMods = "custom_thunderstore_mods"
View Source
const CreateServerOptBareMetal = "bare_metal"
View Source
const CreateServerOptCheatsEnabled = "cheats_enabled"
View Source
const CreateServerOptInsecure = "insecure"
View Source
const CreateServerOptMasterServer = "master_server"
View Source
const CreateServerTickRate = "tick_rate"
View Source
const CreateServerVersionOpt = "server_version"
View Source
const DefaultMasterServer = "https://northstar.tf"
View Source
const ExtendLifetime = "extend_lifetime"
View Source
const ListServerVerbosityOpt = "verbosity"
View Source
const PinLength = 4

Variables

View Source
var ErrUnableToGenerateUniqueName = errors.New("unable to generate unique name")

Functions

func NewDiscordBot

func NewDiscordBot(config Config) (*discordBot, error)

NewDiscordBot creates a new Discord bot, with cancellable context nolint: revive,golint

Types

type CommandOverrides

type CommandOverrides struct {
	Command string `required:"true"`
	Flag    string `required:"true"`
	Value   string `required:"true"`
}

type Config

type Config struct {
	DcBotToken       string `required:"true"`
	DcGuildID        string `required:"true"`
	BotReportChannel string ``
	// very hardcody, really needs a concept along the lines of: "Data PostProcessing"
	RebalancedLTSRankingMongoDBString string ``
	CommandDefaults                   []CommandOverrides
}

type LTSRebalanceLogID

type LTSRebalanceLogID struct {
	UID     string
	MatchID string
	Round   int
}

type LTSRebalanceLogStruct

type LTSRebalanceLogStruct struct {
	UID                          string  `json:"uid" bson:"uid"`
	Round                        int     `json:"round" bson:"round"`
	MatchID                      string  `json:"matchID" bson:"matchID"`
	MatchTimestamp               int     `json:"matchTimestamp" bson:"matchTimestamp"`
	Ranked                       bool    `json:"ranked" bson:"ranked"`
	Name                         string  `json:"name" bson:"name"`
	Rebalance                    bool    `json:"rebalance" bson:"rebalance"`
	PerfectKits                  bool    `json:"perfectKits" bson:"perfectKits"`
	MapName                      string  `json:"mapName" bson:"mapName"`
	Team                         int     `json:"team" bson:"team"`
	Result                       string  `json:"result" bson:"result"`
	RoundDuration                float32 `json:"roundDuration" bson:"roundDuration"`
	Titan                        string  `json:"titan" bson:"titan"`
	Kit1                         string  `json:"kit1" bson:"kit1"`
	Kit2                         string  `json:"kit2" bson:"kit2"`
	Core1                        string  `json:"core1" bson:"core1"`
	Core2                        string  `json:"core2" bson:"core2"`
	Core3                        string  `json:"core3" bson:"core3"`
	DamageDealtBlockedTarget     int     `json:"damageDealtBlockedTarget" bson:"damageDealtBlockedTarget"`
	DamageTakenBlockedTarget     int     `json:"damageTakenBlockedTarget" bson:"damageTakenBlockedTarget"`
	DamageDealtCloseAlly         int     `json:"damageDealtCloseAlly" bson:"damageDealtCloseAlly"`
	DamageDealtCloseEnemy        int     `json:"damageDealtCloseEnemy" bson:"damageDealtCloseEnemy"`
	DamageDealt                  int     `json:"damageDealt" bson:"damageDealt"`
	DamageDealtShields           int     `json:"damageDealtShields" bson:"damageDealtShields"`
	DamageDealtTempShields       int     `json:"damageDealtTempShields" bson:"damageDealtTempShields"`
	DamageDealtAuto              int     `json:"damageDealtAuto" bson:"damageDealtAuto"`
	DamageDealtPilot             int     `json:"damageDealtPilot" bson:"damageDealtPilot"`
	DamageDealtBlocked           int     `json:"damageDealtBlocked" bson:"damageDealtBlocked"`
	DamageDealtSelf              int     `json:"damageDealtSelf" bson:"damageDealtSelf"`
	CritRateDealt                float32 `json:"critRateDealt" bson:"critRateDealt"`
	DamageTaken                  int     `json:"damageTaken" bson:"damageTaken"`
	DamageTakenShields           int     `json:"damageTakenShields" bson:"damageTakenShields"`
	DamageTakenTempShields       int     `json:"damageTakenTempShields" bson:"damageTakenTempShields"`
	DamageTakenAuto              int     `json:"damageTakenAuto" bson:"damageTakenAuto"`
	DamageTakenBlocked           int     `json:"damageTakenBlocked" bson:"damageTakenBlocked"`
	CritRateTaken                float32 `json:"critRateTaken" bson:"critRateTaken"`
	Kills                        int     `json:"kills" bson:"kills"`
	KillsPilot                   int     `json:"killsPilot" bson:"killsPilot"`
	Terminations                 int     `json:"terminations" bson:"terminations"`
	TerminationDamage            int     `json:"terminationDamage" bson:"terminationDamage"`
	CoreFracEarned               float32 `json:"coreFracEarned" bson:"coreFracEarned"`
	CoresUsed                    int     `json:"coresUsed" bson:"coresUsed"`
	BatteriesPicked              int     `json:"batteriesPicked" bson:"batteriesPicked"`
	BatteriesToSelf              int     `json:"batteriesToSelf" bson:"batteriesToSelf"`
	BatteriesToAlly              int     `json:"batteriesToAlly" bson:"batteriesToAlly"`
	BatteriesToAllyPilot         int     `json:"batteriesToAllyPilot" bson:"batteriesToAllyPilot"`
	ShieldsGained                int     `json:"shieldsGained" bson:"shieldsGained"`
	TempShieldsGained            int     `json:"tempShieldsGained" bson:"tempShieldsGained"`
	HealthWasted                 int     `json:"healthWasted" bson:"healthWasted"`
	ShieldsWasted                int     `json:"shieldsWasted" bson:"shieldsWasted"`
	TimeAsTitan                  float32 `json:"timeAsTitan" bson:"timeAsTitan"`
	TimeDeathTitan               float32 `json:"timeDeathTitan" bson:"timeDeathTitan"`
	TimeAsPilot                  float32 `json:"timeAsPilot" bson:"timeAsPilot"`
	TimeDeathPilot               float32 `json:"timeDeathPilot" bson:"timeDeathPilot"`
	Ejection                     bool    `json:"ejection" bson:"ejection"`
	AvgDistanceToCenterAllies    float32 `json:"avgDistanceToCenterAllies" bson:"avgDistanceToCenterAllies"`
	AvgDistanceToCenterEnemies   float32 `json:"avgDistanceToCenterEnemies" bson:"avgDistanceToCenterEnemies"`
	AvgDistanceBetweenCenters    float32 `json:"avgDistanceBetweenCenters" bson:"avgDistanceBetweenCenters"`
	AvgDistanceToBatteries       float32 `json:"avgDistanceToBatteries" bson:"avgDistanceToBatteries"`
	AvgDistanceToCloseBattery    float32 `json:"avgDistanceToCloseBattery" bson:"avgDistanceToCloseBattery"`
	AvgDistanceOnCritDealt       float32 `json:"avgDistanceOnCritDealt" bson:"avgDistanceOnCritDealt"`
	AvgDistanceOnNonCritDealt    float32 `json:"avgDistanceOnNonCritDealt" bson:"avgDistanceOnNonCritDealt"`
	AvgDistanceToAllies          float32 `json:"avgDistanceToAllies" bson:"avgDistanceToAllies"`
	AvgDistanceToCloseAlly       float32 `json:"avgDistanceToCloseAlly" bson:"avgDistanceToCloseAlly"`
	AvgDistanceToEnemies         float32 `json:"avgDistanceToEnemies" bson:"avgDistanceToEnemies"`
	AvgDistanceToCloseEnemy      float32 `json:"avgDistanceToCloseEnemy" bson:"avgDistanceToCloseEnemy"`
	AvgDistanceToAlliesPilot     float32 `json:"avgDistanceToAlliesPilot" bson:"avgDistanceToAlliesPilot"`
	AvgDistanceToCloseAllyPilot  float32 `json:"avgDistanceToCloseAllyPilot" bson:"avgDistanceToCloseAllyPilot"`
	AvgDistanceToEnemiesPilot    float32 `json:"avgDistanceToEnemiesPilot" bson:"avgDistanceToEnemiesPilot"`
	AvgDistanceToCloseEnemyPilot float32 `json:"avgDistanceToCloseEnemyPilot" bson:"avgDistanceToCloseEnemyPilot"`
	DistanceTravelled            float32 `json:"distanceTravelled" bson:"distanceTravelled"`
	DistanceTravelledPilot       float32 `json:"distanceTravelledPilot" bson:"distanceTravelledPilot"`
	Version                      string  `json:"version" bson:"version"`

	// Additional Metadata fields
	ServerName   string `json:"serverName" bson:"serverName"`
	IsPreRelease bool   `json:"isPreRelease" bson:"isPreRelease"`
}

type Notifier

type Notifier struct {
	RebalancedLTSRankingMongoDBString string
	// contains filtered or unexported fields
}

func NewNotifier

func NewNotifier(discordClient *discordgo.Session, reportChannel string, rebalancedLTSRankingMongoDBString string) *Notifier

func (*Notifier) NotifyAndAttachServerData

func (d *Notifier) NotifyAndAttachServerData(server *nsserver.NSServer, message string, filename string, file *bytes.Buffer)

func (*Notifier) NotifyServer

func (d *Notifier) NotifyServer(server *nsserver.NSServer, message string)

Jump to

Keyboard shortcuts

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