diff --git a/cli/commands/broadcast.go b/cli/commands/broadcast.go index 6136765..2b19410 100644 --- a/cli/commands/broadcast.go +++ b/cli/commands/broadcast.go @@ -52,7 +52,7 @@ func (b broadcastCommand) ExecuteCommand(bot *tgbotapi.BotAPI, update *tgbotapi. return false, err } - msg := tgbotapi.NewMessage(currentGroup.GroupID, strings.Join(parts[2:], "")) + msg := tgbotapi.NewMessage(currentGroup.GroupID, strings.Join(parts[2:], " ")) _, err := bot.Send(msg) return err == nil, err } diff --git a/cli/commands/info.go b/cli/commands/info.go index 88ea723..56ea62a 100644 --- a/cli/commands/info.go +++ b/cli/commands/info.go @@ -30,7 +30,7 @@ func (i infoCommand) ExecuteCommand(bot *tgbotapi.BotAPI, update *tgbotapi.Updat "General Information to this Bot\n" + "===============================\n" + "Developer: @Alphyron\n" + - "Version: 2.2.2\n" + + "Version: 2.2.4\n" + "Git: [Gitea Repository](https://git.dragon-labs.de/alphyron/group_assistant)\n" + "===============================" diff --git a/repository/sql/grouphelprepository.go b/repository/sql/grouphelprepository.go index 01acbfd..0efdc6c 100644 --- a/repository/sql/grouphelprepository.go +++ b/repository/sql/grouphelprepository.go @@ -94,7 +94,7 @@ func (g groupHelperRepository) GetGroupByID(id int64) (*models.Group, error) { defaultGroup.FillDefaultValues() defaultGroup.GroupID = id - err := g.Conn.Set("gorm:auto_preload", true).Where("group_id = ?", id).First(&group) + err := g.Conn.Preload("ControlledGroups").Where("group_id = ?", id).First(&group) if err.RecordNotFound() { return g.CreateGroup(defaultGroup) @@ -214,7 +214,7 @@ func (g groupHelperRepository) GetGroupByDBID(id uint64) (*models.Group, error) defaultGroup.FillDefaultValues() defaultGroup.ID = id - err := g.Conn.Set("gorm:auto_preload", true).Where("id = ?", id).First(&group) + err := g.Conn.Preload("ControlledGroups").Where("id = ?", id).First(&group) if err.RecordNotFound() { return g.CreateGroup(defaultGroup)