Skip to content
This repository has been archived by the owner on Jul 20, 2024. It is now read-only.

Commit

Permalink
finally fix botway init --docker command, bump to v0.1.0-beta.4
Browse files Browse the repository at this point in the history
  • Loading branch information
abdfnx committed May 11, 2022
1 parent 9f0db10 commit e3786c6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ var (
BotwayConfigFile = filepath.Join(HomeDir, ".botway", "botway.json")
BotwayConfig, Berr = ioutil.ReadFile(BotwayConfigFile)
BotConfig, Oerr = ioutil.ReadFile(".botway.yaml")
Guilds, Gerr = ioutil.ReadFile("guilds.json")

BotwayDirPath = func () string {
if runtime.GOOS == "windows" {
Expand Down
14 changes: 10 additions & 4 deletions internal/pipes/initx/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"log"
"os"
"path/filepath"
"strings"

"github.com/abdfnx/botway/constants"
"github.com/abdfnx/tran/dfs"
Expand Down Expand Up @@ -67,11 +68,16 @@ func DockerInit() {
}

if t == "discord" {
// viper.Set("botway.bots." + GetBotName() + ".guilds." + m.inputs[1].Value() + ".server_id", m.inputs[2].Value())
guilds := gjson.Get(string(constants.BotConfig), "guilds.#")
if constants.Gerr != nil {
panic(constants.Gerr)
} else {
guilds := gjson.Get(string(constants.Guilds), "guilds.#")

for x := 0; x < int(guilds.Int()); x++ {

for x := 0; x < int(guilds.Int()); x++ {
server := gjson.Get(string(constants.Guilds), "guilds." + fmt.Sprint(x)).String()

viper.Set("botway.bots." + GetBotName() + ".guilds." + server + ".server_id", os.Getenv(strings.ToUpper(server + "_GUILD_ID")))
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "botway",
"version": "0.1.0-beta.32",
"version": "0.1.0-beta.4",
"description": "🤖 Generate, build, handle and deploy your own bot with your favorite language, for Discord, or Telegram, or Slack.",
"type": "module",
"author": "abdfnx",
Expand Down

0 comments on commit e3786c6

Please sign in to comment.