Skip to content

Commit

Permalink
Fix /start command
Browse files Browse the repository at this point in the history
  • Loading branch information
alufers committed Jun 22, 2023
1 parent 510f0f2 commit 8db4b55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions paczkobot/bot_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
)

type BotApp struct {
Bot *tgbotapi.BotAPI
DB *gorm.DB
Commands []tghelpers.Command
Bot *tgbotapi.BotAPI
DB *gorm.DB

CommandDispatcher *tghelpers.CommandDispatcher
BaseHTTPClient httphelpers.Client
NotificationsService *NotificationsService
Expand Down
2 changes: 1 addition & 1 deletion paczkobot/start_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (s *StartCommand) Help() string {

func (s *StartCommand) Execute(ctx context.Context, args *tghelpers.CommandArguments) error {
categoriesHelp := map[string][]tghelpers.Command{}
for _, cmd := range s.App.Commands {
for _, cmd := range s.App.CommandDispatcher.Commands {
if cmdWithCat, ok := cmd.(tghelpers.CommandWithCategory); ok {
categoriesHelp[cmdWithCat.Category()] = append(categoriesHelp[cmdWithCat.Category()], cmd)
} else {
Expand Down

0 comments on commit 8db4b55

Please sign in to comment.