mirror of
https://github.com/FactoKit/FactoCord.git
synced 2024-11-16 10:08:21 +02:00
Now game name properly displayed as playing: something
This commit is contained in:
parent
01cf42caae
commit
bca64ba2f2
@ -11,3 +11,5 @@ AdminIDs = "AdminIDsHere,SeperateByComma"
|
||||
Prefix = "$"
|
||||
|
||||
ModListLocation = "/path/to/mods/mod-list.json"
|
||||
|
||||
GameName = "Factorio"
|
2
main.go
2
main.go
@ -113,7 +113,6 @@ func discord() {
|
||||
fmt.Println("Starting bot..")
|
||||
bot, err := discordgo.New("Bot " + discordToken)
|
||||
Session = bot
|
||||
bot.UpdateStatus(0, support.Config.GameName)
|
||||
if err != nil {
|
||||
fmt.Println("Error creating Discord session: ", err)
|
||||
support.ErrorLog(fmt.Errorf("%s: An error occurred when attempting to create the Discord session\nDetails: %s", time.Now(), err))
|
||||
@ -132,6 +131,7 @@ func discord() {
|
||||
bot.AddHandlerOnce(support.Chat)
|
||||
time.Sleep(3 * time.Second)
|
||||
bot.ChannelMessageSend(support.Config.FactorioChannelID, "The server has started!")
|
||||
bot.UpdateStatus(0, support.Config.GameName)
|
||||
fmt.Println("Bot is now running. Press CTRL-C to exit.")
|
||||
sc := make(chan os.Signal, 1)
|
||||
signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt, os.Kill)
|
||||
|
@ -36,6 +36,7 @@ func (conf *config) LoadEnv() {
|
||||
AdminIDs: strings.Split(os.Getenv("AdminIDs"), ","),
|
||||
Prefix: os.Getenv("Prefix"),
|
||||
ModListLocation: os.Getenv("ModListLocation"),
|
||||
GameName: os.Getenv("GameName"),
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user