1
0
mirror of https://github.com/FactoKit/FactoCord.git synced 2024-11-24 08:02:15 +02:00

Now game name properly displayed as playing: something

This commit is contained in:
Wadimich 2017-11-03 17:12:52 +05:00
parent 01cf42caae
commit bca64ba2f2
3 changed files with 4 additions and 1 deletions

View File

@ -11,3 +11,5 @@ AdminIDs = "AdminIDsHere,SeperateByComma"
Prefix = "$"
ModListLocation = "/path/to/mods/mod-list.json"
GameName = "Factorio"

View File

@ -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)

View File

@ -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"),
}
}